#include "cuda_runtime.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "time.h"

#define A_w 50
#define A_h 50
#define B_w 32
#define B_h 32

typedef struct{
	int width;
	int height;
	float * elements;
}Matrix;

// #define 

void rightKronecker1(Matrix A, Matrix B, Matrix C){
	for(int c_row=0; c_row<C.height; c_row++){
		for(int c_col=0; c_col<C.width; c_col++){
			C.elements[c_col + c_row*C.width] = 
			A.elements[c_col/B.width + c_row/B.height * A.width]
			* B.elements[c_col%B.width + c_row%B.height*B.width];
		}
	}
}

void rightKronecker2(Matrix A, Matrix B, Matrix C){
	for(int a_row=0; a_row<A.height; a_row++){
		for(int a_col=0; a_col<A.width; a_col++){
			for(int b_row=0; b_row<B.height; b_row++){
				for(int b_col=0; b_col<B.width; b_col++){
					C.elements[(b_col+a_col*B.width)+(b_row+a_row*B.height)*A.width*B.width] 
					= A.elements[a_col+a_row*A.width] * B.elements[b_col+b_row*B.width];
				}
			}
		}
	}
}


void generatorNum(float* array, int num)
{
//	srand((unsigned)time(NULL));
	for(int i=0;i<num;i++)
	{
		array[i]=rand()%5;
	}
}

void printUsage(void)
{
                printf("\n");
                printf("The program aims to calculate the product of matrix A and B\n");
                printf("-h matrix A row num\n");
                printf("-w matrix A col num\n");
                printf("-H matrix B row num\n");
                printf("-W matrix B col num\n");
}

int main(int argc,char** argv){

	// int A_w,B_w,A_h,B_h;
 //    if(argc==1)
 //    {
 //        printf("Error: no enough parameters.Please input the col and row number of Matrix A and B,respectively\n");
 //        exit(0);
 //    }
 //    else if(argc==2)
 //    {
 //        if(strcmp("--help",argv[1])==0)
 //        {
 //            printUsage();
 //            exit(0);
 //        }

 //    }
	// for(int id=1;id<argc;id+=2)
 //    {
 //        if(strcmp("-h",argv[id])==0)
 //                A_h=atoi(argv[id+1]);
 //        else if(strcmp("-w",argv[id])==0)
 //                A_w=atoi(argv[id+1]);
 //        else if(strcmp("-W",argv[id])==0)
 //                B_w=atoi(argv[id+1]);
 //        else if(strcmp("-H",argv[id])==0)
 //                B_h=atoi(argv[id+1]);
 //    }
    

    // Matrix A,d_A,B,d_B,C,d_C;
    Matrix A, B, C1, C2;
    A.width=A_w;A.height=A_h;
    B.width=B_w;B.height=B_h;
    C1.width=A_w*B_w;C1.height=A_h*B_h;
    C2.width=A_w*B_w;C2.height=A_h*B_h;

    A.elements=(float *)malloc(A.width*A.height*sizeof(float));
	B.elements=(float *)malloc(B.width*B.height*sizeof(float));
	C1.elements=(float *)malloc(C1.width*C1.height*sizeof(float));
	C2.elements=(float *)malloc(C2.width*C2.height*sizeof(float));

 //    A.elements=(float *)malloc(A.width*A.height*sizeof(float));
	// B.elements=(float *)malloc(B.width*B.height*sizeof(float));
	// C.elements=(float *)malloc(C.width*C.height*sizeof(float));

   	generatorNum(A.elements,A.width*A.height);
	generatorNum(B.elements,B.width*B.height);
	memset(C1.elements,0,C1.width*sizeof(float)*C1.height);
	memset(C2.elements,0,C2.width*sizeof(float)*C2.height);

	// printf("A.elements:\n");
	// for(int i=0;i<A.height;i++){
	// 	for(int j=0;j<A.width;j++){
	// 		printf("%d ", int(A.elements[j+i*A.width]));
	// 	}
	// printf("\n");
	// }
	// printf("B.elements:\n");
	// for(int i=0;i<B.height;i++){
	// 	for(int j=0;j<B.width;j++){
	// 		printf("%d ", int(B.elements[j+i*B.width]));
	// 	}
	// printf("\n");
	// }

	srand(time(0));
	clock_t start,finish1, finish2;
	start=clock();
	rightKronecker1(A, B, C1);
	finish1=clock();
	rightKronecker2(A, B, C2);
	finish2=clock();

	// printf("C1.elements:\n");
	// for(int i=0;i<C1.height;i++){
	// 	for(int j=0;j<C1.width;j++){
	// 		printf("%d ", C1.elements[j+i*C1.width]);
	// 	}
	// printf("\n");
	// }

	// printf("C2.elements:\n");
	// for(int i=0;i<C2.height;i++){
	// 	for(int j=0;j<C2.width;j++){
	// 		printf("%d ", C2.elements[j+i*C2.width]);
	// 	}
	// printf("\n");
	// }

	printf("Difference between 2 method:\n");
	float diff = 0;
	for(int i=0;i<C2.height;i++){
		for(int j=0;j<C2.width;j++){
			diff = C2.elements[j+i*C2.width] - C1.elements[j+i*C2.width];
		}
	}
	printf("%f\n", diff);

	printf("method1 cost time %f ms\n",(finish1-start)*1000.0/CLOCKS_PER_SEC);
	printf("method2 cost time %f ms\n",(finish2-finish1)*1000.0/CLOCKS_PER_SEC);
	// malloc matrix A B C on GPU
	// cudaMalloc(&d_A.elements,sizeof(float)*A.width*A.height);
	// cudaMalloc(&d_B.elements,sizeof(float)*B.width*B.height);
	// cudaMalloc(&d_C.elements,sizeof(float)*C.width*C.height);

	return 0;


}
	.file	"tmpxft_00314db1_00000000-6_kronecker_product_baseline.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2034:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2034:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z15rightKronecker16MatrixS_S_
	.type	_Z15rightKronecker16MatrixS_S_, @function
_Z15rightKronecker16MatrixS_S_:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%r8, %rax
	movl	%r8d, %r15d
	movl	%edi, %r11d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	shrq	$32, %rax
	xorl	%r10d, %r10d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%eax, %r14d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	xorl	%esi, %esi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	shrq	$32, %rdx
	movl	%edx, -8(%rsp)
.L3:
	cmpl	%esi, %r14d
	jle	.L2
	movslq	%r10d, %rax
	xorl	%ecx, %ecx
	leaq	(%r9,%rax,4), %r13
.L6:
	movl	%ecx, %eax
	cmpl	%ecx, %r15d
	jle	.L9
	cltd
	idivl	%ebx
	movl	%eax, %edi
	movl	%esi, %eax
	movl	%edx, -4(%rsp)
	cltd
	idivl	-8(%rsp)
	imull	%r11d, %eax
	imull	%ebx, %edx
	addl	%edi, %eax
	movl	-4(%rsp), %edi
	cltq
	addl	%edi, %edx
	movss	0(%rbp,%rax,4), %xmm0
	movslq	%edx, %rdx
	mulss	(%r12,%rdx,4), %xmm0
	movss	%xmm0, 0(%r13,%rcx,4)
	incq	%rcx
	jmp	.L6
.L9:
	incl	%esi
	addl	%r8d, %r10d
	jmp	.L3
.L2:
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z15rightKronecker16MatrixS_S_, .-_Z15rightKronecker16MatrixS_S_
	.globl	_Z15rightKronecker26MatrixS_S_
	.type	_Z15rightKronecker26MatrixS_S_, @function
_Z15rightKronecker26MatrixS_S_:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	shrq	$32, %rbx
	movq	%rcx, -8(%rsp)
	movq	%rdx, %rcx
	sarq	$32, %rcx
	movl	%edi, -32(%rsp)
	movl	%ecx, -24(%rsp)
	imull	%edi, %ecx
	movl	%edi, -16(%rsp)
	movl	%edx, %edi
	imull	%eax, %edi
	xorl	%eax, %eax
	movl	%edx, -28(%rsp)
	imull	%edx, %ecx
	movl	%ebx, -36(%rsp)
	movl	%eax, -40(%rsp)
	movl	%edi, -20(%rsp)
	xorl	%edi, %edi
	movl	%ecx, -12(%rsp)
	xorl	%ecx, %ecx
.L11:
	cmpl	%ecx, -36(%rsp)
	jle	.L20
	xorl	%r8d, %r8d
	xorl	%edx, %edx
.L17:
	movl	-32(%rsp), %eax
	cmpl	%eax, %edx
	jge	.L15
	leal	(%rdx,%rdi), %eax
	movl	-40(%rsp), %ebx
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	cltq
	movslq	%r8d, %r12
	leaq	(%rsi,%rax,4), %r13
.L16:
	movl	-24(%rsp), %eax
	cmpl	%eax, %r10d
	jge	.L13
	movq	-8(%rsp), %r14
	movslq	%r11d, %rax
	leaq	(%r14,%rax,4), %r15
	movslq	%ebx, %rax
	addq	%r12, %rax
	leaq	(%r9,%rax,4), %r14
	xorl	%eax, %eax
.L14:
	cmpl	%eax, -28(%rsp)
	jle	.L21
	movss	0(%r13), %xmm0
	mulss	(%r15,%rax,4), %xmm0
	movss	%xmm0, (%r14,%rax,4)
	incq	%rax
	jmp	.L14
.L21:
	movl	-20(%rsp), %eax
	incl	%r10d
	addl	%ebp, %r11d
	addl	%eax, %ebx
	jmp	.L16
.L13:
	incl	%edx
	addl	%ebp, %r8d
	jmp	.L17
.L15:
	movl	-16(%rsp), %eax
	movl	-12(%rsp), %ebx
	incl	%ecx
	addl	%ebx, -40(%rsp)
	addl	%eax, %edi
	jmp	.L11
.L20:
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z15rightKronecker26MatrixS_S_, .-_Z15rightKronecker26MatrixS_S_
	.globl	_Z12generatorNumPfi
	.type	_Z12generatorNumPfi, @function
_Z12generatorNumPfi:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$5, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rdx
	.cfi_def_cfa_offset 48
.L23:
	cmpl	%ebx, %ebp
	jle	.L26
	call	rand@PLT
	cltd
	idivl	%r13d
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, (%r12,%rbx,4)
	incq	%rbx
	jmp	.L23
.L26:
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z12generatorNumPfi, .-_Z12generatorNumPfi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\n"
.LC1:
	.string	"The program aims to calculate the product of matrix A and B\n"
.LC2:
	.string	"-h matrix A row num\n"
.LC3:
	.string	"-w matrix A col num\n"
.LC4:
	.string	"-H matrix B row num\n"
.LC5:
	.string	"-W matrix B col num\n"
	.text
	.globl	_Z10printUsagev
	.type	_Z10printUsagev, @function
_Z10printUsagev:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	popq	%rdx
	.cfi_def_cfa_offset 8
	movl	$2, %edi
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2030:
	.size	_Z10printUsagev, .-_Z10printUsagev
	.section	.rodata.str1.1
.LC6:
	.string	"Difference between 2 method:\n"
.LC7:
	.string	"%f\n"
.LC10:
	.string	"method1 cost time %f ms\n"
.LC11:
	.string	"method2 cost time %f ms\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$10000, %edi
	movabsq	$137438953504, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	malloc@PLT
	movl	$4096, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movl	$10240000, %edi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movl	$10240000, %edi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	%r12, %rdi
	movl	$2500, %esi
	movq	%rax, %rbp
	call	_Z12generatorNumPfi
	movq	8(%rsp), %rdi
	movl	$1024, %esi
	call	_Z12generatorNumPfi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	movl	$2560000, %ecx
	rep stosl
	movq	%rbp, %rdi
	movl	$2560000, %ecx
	rep stosl
	xorl	%edi, %edi
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	call	clock@PLT
	movq	8(%rsp), %rcx
	movq	%rbx, %r9
	movq	%r15, %rdx
	movabsq	$214748364850, %rdi
	movq	%r12, %rsi
	movq	%rax, %r13
	movabsq	$6871947675200, %r8
	call	_Z15rightKronecker16MatrixS_S_
	call	clock@PLT
	movq	8(%rsp), %rcx
	movq	%rbp, %r9
	movq	%r15, %rdx
	movabsq	$6871947675200, %r8
	movq	%r12, %rsi
	movq	%rax, %r14
	movabsq	$214748364850, %rdi
	call	_Z15rightKronecker26MatrixS_S_
	call	clock@PLT
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %r12
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$2, %edi
	movb	$1, %al
	subq	%r14, %r12
	movss	10239996(%rbp), %xmm0
	subss	10239996(%rbx), %xmm0
	leaq	.LC7(%rip), %rsi
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movq	%r14, %rax
	leaq	.LC10(%rip), %rsi
	subq	%r13, %rax
	movl	$2, %edi
	cvtsi2sdq	%rax, %xmm0
	mulsd	.LC8(%rip), %xmm0
	movb	$1, %al
	divsd	.LC9(%rip), %xmm0
	call	__printf_chk@PLT
	movb	$1, %al
	cvtsi2sdq	%r12, %xmm0
	leaq	.LC11(%rip), %rsi
	mulsd	.LC8(%rip), %xmm0
	movl	$2, %edi
	divsd	.LC9(%rip), %xmm0
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2057:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2057:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC8:
	.long	0
	.long	1083129856
	.align 8
.LC9:
	.long	0
	.long	1093567616
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include "hip/hip_runtime.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "time.h"

#define A_w 50
#define A_h 50
#define B_w 32
#define B_h 32

typedef struct{
	int width;
	int height;
	float * elements;
}Matrix;

// #define 

void rightKronecker1(Matrix A, Matrix B, Matrix C){
	for(int c_row=0; c_row<C.height; c_row++){
		for(int c_col=0; c_col<C.width; c_col++){
			C.elements[c_col + c_row*C.width] = 
			A.elements[c_col/B.width + c_row/B.height * A.width]
			* B.elements[c_col%B.width + c_row%B.height*B.width];
		}
	}
}

void rightKronecker2(Matrix A, Matrix B, Matrix C){
	for(int a_row=0; a_row<A.height; a_row++){
		for(int a_col=0; a_col<A.width; a_col++){
			for(int b_row=0; b_row<B.height; b_row++){
				for(int b_col=0; b_col<B.width; b_col++){
					C.elements[(b_col+a_col*B.width)+(b_row+a_row*B.height)*A.width*B.width] 
					= A.elements[a_col+a_row*A.width] * B.elements[b_col+b_row*B.width];
				}
			}
		}
	}
}


void generatorNum(float* array, int num)
{
//	srand((unsigned)time(NULL));
	for(int i=0;i<num;i++)
	{
		array[i]=rand()%5;
	}
}

void printUsage(void)
{
                printf("\n");
                printf("The program aims to calculate the product of matrix A and B\n");
                printf("-h matrix A row num\n");
                printf("-w matrix A col num\n");
                printf("-H matrix B row num\n");
                printf("-W matrix B col num\n");
}

int main(int argc,char** argv){

	// int A_w,B_w,A_h,B_h;
 //    if(argc==1)
 //    {
 //        printf("Error: no enough parameters.Please input the col and row number of Matrix A and B,respectively\n");
 //        exit(0);
 //    }
 //    else if(argc==2)
 //    {
 //        if(strcmp("--help",argv[1])==0)
 //        {
 //            printUsage();
 //            exit(0);
 //        }

 //    }
	// for(int id=1;id<argc;id+=2)
 //    {
 //        if(strcmp("-h",argv[id])==0)
 //                A_h=atoi(argv[id+1]);
 //        else if(strcmp("-w",argv[id])==0)
 //                A_w=atoi(argv[id+1]);
 //        else if(strcmp("-W",argv[id])==0)
 //                B_w=atoi(argv[id+1]);
 //        else if(strcmp("-H",argv[id])==0)
 //                B_h=atoi(argv[id+1]);
 //    }
    

    // Matrix A,d_A,B,d_B,C,d_C;
    Matrix A, B, C1, C2;
    A.width=A_w;A.height=A_h;
    B.width=B_w;B.height=B_h;
    C1.width=A_w*B_w;C1.height=A_h*B_h;
    C2.width=A_w*B_w;C2.height=A_h*B_h;

    A.elements=(float *)malloc(A.width*A.height*sizeof(float));
	B.elements=(float *)malloc(B.width*B.height*sizeof(float));
	C1.elements=(float *)malloc(C1.width*C1.height*sizeof(float));
	C2.elements=(float *)malloc(C2.width*C2.height*sizeof(float));

 //    A.elements=(float *)malloc(A.width*A.height*sizeof(float));
	// B.elements=(float *)malloc(B.width*B.height*sizeof(float));
	// C.elements=(float *)malloc(C.width*C.height*sizeof(float));

   	generatorNum(A.elements,A.width*A.height);
	generatorNum(B.elements,B.width*B.height);
	memset(C1.elements,0,C1.width*sizeof(float)*C1.height);
	memset(C2.elements,0,C2.width*sizeof(float)*C2.height);

	// printf("A.elements:\n");
	// for(int i=0;i<A.height;i++){
	// 	for(int j=0;j<A.width;j++){
	// 		printf("%d ", int(A.elements[j+i*A.width]));
	// 	}
	// printf("\n");
	// }
	// printf("B.elements:\n");
	// for(int i=0;i<B.height;i++){
	// 	for(int j=0;j<B.width;j++){
	// 		printf("%d ", int(B.elements[j+i*B.width]));
	// 	}
	// printf("\n");
	// }

	srand(time(0));
	clock_t start,finish1, finish2;
	start=clock();
	rightKronecker1(A, B, C1);
	finish1=clock();
	rightKronecker2(A, B, C2);
	finish2=clock();

	// printf("C1.elements:\n");
	// for(int i=0;i<C1.height;i++){
	// 	for(int j=0;j<C1.width;j++){
	// 		printf("%d ", C1.elements[j+i*C1.width]);
	// 	}
	// printf("\n");
	// }

	// printf("C2.elements:\n");
	// for(int i=0;i<C2.height;i++){
	// 	for(int j=0;j<C2.width;j++){
	// 		printf("%d ", C2.elements[j+i*C2.width]);
	// 	}
	// printf("\n");
	// }

	printf("Difference between 2 method:\n");
	float diff = 0;
	for(int i=0;i<C2.height;i++){
		for(int j=0;j<C2.width;j++){
			diff = C2.elements[j+i*C2.width] - C1.elements[j+i*C2.width];
		}
	}
	printf("%f\n", diff);

	printf("method1 cost time %f ms\n",(finish1-start)*1000.0/CLOCKS_PER_SEC);
	printf("method2 cost time %f ms\n",(finish2-finish1)*1000.0/CLOCKS_PER_SEC);
	// malloc matrix A B C on GPU
	// cudaMalloc(&d_A.elements,sizeof(float)*A.width*A.height);
	// cudaMalloc(&d_B.elements,sizeof(float)*B.width*B.height);
	// cudaMalloc(&d_C.elements,sizeof(float)*C.width*C.height);

	return 0;


}
	.text
	.file	"kronecker_product_baseline.hip"
	.globl	_Z15rightKronecker16MatrixS_S_  # -- Begin function _Z15rightKronecker16MatrixS_S_
	.type	_Z15rightKronecker16MatrixS_S_,@function
_Z15rightKronecker16MatrixS_S_:         # @_Z15rightKronecker16MatrixS_S_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, -8(%rsp)                   # 8-byte Spill
	movq	%rdi, -16(%rsp)                 # 8-byte Spill
	movq	%r8, %r15
	shrq	$32, %r15
	testl	%r15d, %r15d
	jle	.LBB0_6
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdx, %r10
	movq	%rdx, %rdi
	shrq	$32, %rdi
	movl	%r8d, %r13d
	xorl	%r12d, %r12d
	xorl	%r11d, %r11d
.LBB0_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_4 Depth 2
	testl	%r8d, %r8d
	jle	.LBB0_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	%r11d, %eax
	cltd
	idivl	%edi
	movl	%eax, %ebx
	movl	%edx, %ebp
	movl	%r12d, %eax
	movq	-8(%rsp), %rdx                  # 8-byte Reload
	leaq	(%rdx,%rax,4), %r9
	imull	-16(%rsp), %ebx                 # 4-byte Folded Reload
	imull	%r10d, %ebp
	xorl	%r14d, %r14d
.LBB0_4:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r14d, %eax
	cltd
	idivl	%r10d
	addl	%ebx, %eax
	cltq
	movss	(%rsi,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	addl	%ebp, %edx
	movslq	%edx, %rax
	mulss	(%rcx,%rax,4), %xmm0
	movss	%xmm0, (%r9,%r14,4)
	incq	%r14
	cmpq	%r14, %r13
	jne	.LBB0_4
.LBB0_5:                                # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	incq	%r11
	addl	%r8d, %r12d
	cmpq	%r15, %r11
	jne	.LBB0_2
.LBB0_6:                                # %._crit_edge21
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z15rightKronecker16MatrixS_S_, .Lfunc_end0-_Z15rightKronecker16MatrixS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z15rightKronecker26MatrixS_S_  # -- Begin function _Z15rightKronecker26MatrixS_S_
	.type	_Z15rightKronecker26MatrixS_S_,@function
_Z15rightKronecker26MatrixS_S_:         # @_Z15rightKronecker26MatrixS_S_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rcx, -24(%rsp)                 # 8-byte Spill
	movq	%rsi, -48(%rsp)                 # 8-byte Spill
	movq	%rdi, %rax
	movq	%rdi, -80(%rsp)                 # 8-byte Spill
	shrq	$32, %rdi
	movq	%rdi, -32(%rsp)                 # 8-byte Spill
	testl	%edi, %edi
	jle	.LBB1_12
# %bb.1:                                # %.preheader29.lr.ph
	movq	%rdx, %r8
	shrq	$32, %r8
	movq	%rdx, %rax
	shlq	$32, %rax
	movq	%rax, -8(%rsp)                  # 8-byte Spill
	movslq	%edx, %r11
	movq	-80(%rsp), %rax                 # 8-byte Reload
	movl	%eax, %ecx
	movq	%rcx, -16(%rsp)                 # 8-byte Spill
	movl	%r11d, %r14d
	shlq	$2, %r11
	movq	%rdx, %r15
	imulq	%rax, %r15
	movl	%r15d, %eax
	imull	%r8d, %eax
	shlq	$32, %rax
	movq	%rax, -40(%rsp)                 # 8-byte Spill
	shlq	$32, %r15
	xorl	%eax, %eax
	movq	%rax, -64(%rsp)                 # 8-byte Spill
	movabsq	$4294967296, %rbp               # imm = 0x100000000
	xorl	%eax, %eax
	movq	%rax, -72(%rsp)                 # 8-byte Spill
.LBB1_2:                                # %.preheader29
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_4 Depth 2
                                        #       Child Loop BB1_6 Depth 3
                                        #         Child Loop BB1_8 Depth 4
	cmpl	$0, -80(%rsp)                   # 4-byte Folded Reload
	jle	.LBB1_11
# %bb.3:                                # %.preheader28.lr.ph
                                        #   in Loop: Header=BB1_2 Depth=1
	movq	-72(%rsp), %rax                 # 8-byte Reload
                                        # kill: def $eax killed $eax killed $rax def $rax
	imull	-80(%rsp), %eax                 # 4-byte Folded Reload
	movq	-48(%rsp), %rcx                 # 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movq	-64(%rsp), %rax                 # 8-byte Reload
	movq	%rax, -56(%rsp)                 # 8-byte Spill
	xorl	%r12d, %r12d
.LBB1_4:                                # %.preheader28
                                        #   Parent Loop BB1_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB1_6 Depth 3
                                        #         Child Loop BB1_8 Depth 4
	testl	%r8d, %r8d
	jle	.LBB1_10
# %bb.5:                                # %.preheader.lr.ph
                                        #   in Loop: Header=BB1_4 Depth=2
	movq	-56(%rsp), %r10                 # 8-byte Reload
	movq	-24(%rsp), %rcx                 # 8-byte Reload
	xorl	%eax, %eax
.LBB1_6:                                # %.preheader
                                        #   Parent Loop BB1_2 Depth=1
                                        #     Parent Loop BB1_4 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB1_8 Depth 4
	testl	%edx, %edx
	jle	.LBB1_9
# %bb.7:                                # %.lr.ph
                                        #   in Loop: Header=BB1_6 Depth=3
	movq	%r10, %rdi
	xorl	%ebx, %ebx
.LBB1_8:                                #   Parent Loop BB1_2 Depth=1
                                        #     Parent Loop BB1_4 Depth=2
                                        #       Parent Loop BB1_6 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movss	(%rsi,%r12,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	mulss	(%rcx,%rbx,4), %xmm0
	movq	%rdi, %r13
	sarq	$30, %r13
	movss	%xmm0, (%r9,%r13)
	incq	%rbx
	addq	%rbp, %rdi
	cmpq	%rbx, %r14
	jne	.LBB1_8
.LBB1_9:                                # %._crit_edge
                                        #   in Loop: Header=BB1_6 Depth=3
	incq	%rax
	addq	%r11, %rcx
	addq	%r15, %r10
	cmpq	%r8, %rax
	jne	.LBB1_6
.LBB1_10:                               # %._crit_edge32
                                        #   in Loop: Header=BB1_4 Depth=2
	incq	%r12
	movq	-56(%rsp), %rax                 # 8-byte Reload
	addq	-8(%rsp), %rax                  # 8-byte Folded Reload
	movq	%rax, -56(%rsp)                 # 8-byte Spill
	cmpq	-16(%rsp), %r12                 # 8-byte Folded Reload
	jne	.LBB1_4
.LBB1_11:                               # %._crit_edge34
                                        #   in Loop: Header=BB1_2 Depth=1
	movq	-72(%rsp), %rcx                 # 8-byte Reload
	incq	%rcx
	movq	-64(%rsp), %rax                 # 8-byte Reload
	addq	-40(%rsp), %rax                 # 8-byte Folded Reload
	movq	%rax, -64(%rsp)                 # 8-byte Spill
	movq	%rcx, %rax
	movq	%rcx, -72(%rsp)                 # 8-byte Spill
	cmpq	-32(%rsp), %rcx                 # 8-byte Folded Reload
	jne	.LBB1_2
.LBB1_12:                               # %._crit_edge36
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z15rightKronecker26MatrixS_S_, .Lfunc_end1-_Z15rightKronecker26MatrixS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z12generatorNumPfi             # -- Begin function _Z12generatorNumPfi
	.type	_Z12generatorNumPfi,@function
_Z12generatorNumPfi:                    # @_Z12generatorNumPfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB2_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB2_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%rbx,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB2_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB2_4:                                # %._crit_edge
	retq
.Lfunc_end2:
	.size	_Z12generatorNumPfi, .Lfunc_end2-_Z12generatorNumPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z10printUsagev                 # -- Begin function _Z10printUsagev
	.type	_Z10printUsagev,@function
_Z10printUsagev:                        # @_Z10printUsagev
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movl	$.Lstr.4, %edi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end3:
	.size	_Z10printUsagev, .Lfunc_end3-_Z10printUsagev
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI4_0:
	.quad	0x408f400000000000              # double 1000
.LCPI4_1:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$10000, %edi                    # imm = 0x2710
	callq	malloc
	movq	%rax, %r14
	movl	$4096, %edi                     # imm = 0x1000
	callq	malloc
	movq	%rax, %r15
	movl	$10240000, %edi                 # imm = 0x9C4000
	callq	malloc
	movq	%rax, %r12
	movl	$10240000, %edi                 # imm = 0x9C4000
	callq	malloc
	movq	%rax, %r13
	xorl	%ebx, %ebx
.LBB4_1:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%r14,%rbx,4)
	incq	%rbx
	cmpq	$2500, %rbx                     # imm = 0x9C4
	jne	.LBB4_1
# %bb.2:                                # %.lr.ph.i67.preheader
	xorl	%ebx, %ebx
.LBB4_3:                                # %.lr.ph.i67
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%r15,%rbx,4)
	incq	%rbx
	cmpq	$1024, %rbx                     # imm = 0x400
	jne	.LBB4_3
# %bb.4:                                # %_Z12generatorNumPfi.exit71
	movl	$10240000, %edx                 # imm = 0x9C4000
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$10240000, %edx                 # imm = 0x9C4000
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	callq	clock
	movq	%rax, (%rsp)                    # 8-byte Spill
	movabsq	$214748364850, %rbx             # imm = 0x3200000032
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movabsq	$6871947675200, %r8             # imm = 0x64000000640
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rcx
	movq	%r12, %r9
	callq	_Z15rightKronecker16MatrixS_S_
	callq	clock
	movq	%rax, %rbp
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movq	%r15, %rcx
	movq	%r13, %r9
	callq	_Z15rightKronecker26MatrixS_S_
	callq	clock
	movq	%rax, %r14
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	movss	10239996(%r13), %xmm0           # xmm0 = mem[0],zero,zero,zero
	subss	10239996(%r12), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.7, %edi
	movb	$1, %al
	callq	printf
	movq	%rbp, %rax
	subq	(%rsp), %rax                    # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	mulsd	.LCPI4_0(%rip), %xmm0
	divsd	.LCPI4_1(%rip), %xmm0
	movl	$.L.str.8, %edi
	movb	$1, %al
	callq	printf
	subq	%rbp, %r14
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r14, %xmm0
	mulsd	.LCPI4_0(%rip), %xmm0
	divsd	.LCPI4_1(%rip), %xmm0
	movl	$.L.str.9, %edi
	movb	$1, %al
	callq	printf
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
                                        # -- End function
	.type	.L.str.7,@object                # @.str.7
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.7:
	.asciz	"%f\n"
	.size	.L.str.7, 4

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"method1 cost time %f ms\n"
	.size	.L.str.8, 25

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"method2 cost time %f ms\n"
	.size	.L.str.9, 25

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"The program aims to calculate the product of matrix A and B"
	.size	.Lstr, 60

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"-h matrix A row num"
	.size	.Lstr.1, 20

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"-w matrix A col num"
	.size	.Lstr.2, 20

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"-H matrix B row num"
	.size	.Lstr.3, 20

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"-W matrix B col num"
	.size	.Lstr.4, 20

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"Difference between 2 method:"
	.size	.Lstr.5, 29

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
