#include<cuda_runtime.h>
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
__global__ void Comp(int**ctable1,int **ctable2,int **cresult,int j_N)
{
	int i=threadIdx.x;
	int j=threadIdx.y;
	for(int z=0;z<j_N;z++)
		cresult[i][j]+=ctable1[i][z]*ctable2[z][j];
}
int** MallocDeviceDoubleArray(int** head,int Array_i,int Array_j);
int** MallocHostDoubleArray(int Array_i,int Array_j);
int main()
{
	int i1_max,j1_max,i2_max,j2_max;
	printf("这是一个矩阵相乘的程序\n");
	printf("请输入矩阵A大小(行列大小)\n");
	scanf("%d %d",&j1_max,&i1_max);	//设置矩阵的大小
	int **table1=MallocHostDoubleArray(i1_max,j1_max);
	printf("请输入矩阵A的数据\n");
	for(int i=0;i<i1_max;i++)
		for(int j=0;j<j1_max;j++)
			scanf("%d",&table1[i][j]);

	printf("请输入矩阵B大小(行列大小)\n");
	scanf("%d %d",&j2_max,&i2_max);	//设置矩阵的大小
	int **table2=MallocHostDoubleArray(i2_max,j2_max);	//为两个矩阵分配host空间
	printf("请输入矩阵B的数据\n");
	for(int i=0;i<i2_max;i++)
		for(int j=0;j<j2_max;j++)
			scanf("%d",&table2[i][j]);

	/*
	for(int i=0;i<i1_max;i++)
	{
	for(int j=0;j<j1_max;j++)
	printf("%d ",table1[i][j]);
	printf("\n");
	}

	for(int i=0;i<i2_max;i++)
	{
	for(int j=0;j<j2_max;j++)
	printf("%d ",table2[i][j]);
	printf("\n");
	}*/


	int **result=MallocHostDoubleArray(i1_max,j2_max);		//分配储存结果的host空间
	int *ctable1_head,*ctable2_head,*cresult_head;
	int **ctable1=MallocDeviceDoubleArray(&ctable1_head,i1_max,j1_max),**ctable2=MallocDeviceDoubleArray(&ctable2_head,i2_max,j2_max),**cresult=MallocDeviceDoubleArray(&cresult_head,i1_max,j2_max);	//为两个矩阵分配显存空间
	cudaMemset(cresult_head,0,sizeof(cresult_head));
	cudaMemcpy(ctable1_head,*table1,sizeof(int)*i1_max*j1_max,cudaMemcpyHostToDevice);
	cudaMemcpy(ctable2_head,*table2,sizeof(int)*i2_max*j2_max,cudaMemcpyHostToDevice);		//为table1，2赋值到显存
	dim3 threadmax;
	threadmax.x=i1_max;
	threadmax.y=j2_max;
	Comp<<<1,threadmax>>>(ctable1,ctable2,cresult,j1_max);
	cudaMemcpy(*result,cresult_head,sizeof(int)*i1_max*j2_max,cudaMemcpyDeviceToHost);
	for(int i=0;i<i1_max;i++)
	{
		for(int j=0;j<j2_max;j++)
			printf("%d ",result[i][j]);
		printf("\n");	
	}
	return 0;
}
/*
*@用二维数组的形式访问一维数组
*@（二维数组访问，一维数组存储）
*@Device端生成动态二维数组，head返回一维数组的地址（以便memcpy使用）
*@返回值为二维数组指针
*/
int** MallocDeviceDoubleArray(int** head,int Array_i,int Array_j)
{
	int** cresult,*temp,**temp3;
	cudaMalloc((void**)&cresult,sizeof(int*)*Array_i);
	cudaMalloc((void**)&temp,sizeof(int)*Array_i*Array_j);
	temp3=(int**)malloc(sizeof(int*)*Array_i);
	for(int i=0;i<Array_i;i++)
		temp3[i]=i*Array_j+temp;
	*head=temp;
	cudaMemcpy(cresult,temp3,sizeof(int*)*Array_i,cudaMemcpyHostToDevice);
	return cresult;
}
int **MallocHostDoubleArray(int Array_i,int Array_j)
{
	int **table,*table2;
	table2=(int*)malloc(sizeof(int)*Array_i*Array_j);
	table=(int**)malloc(sizeof(int*)*Array_i);
	for(int i=0;i<Array_i;i++)
	{
		table[i]=Array_j*i+table2;
	}
	return table;
}

	.file	"tmpxft_0039280a_00000000-6_\347\237\251\351\230\265\347\233\270\344\271\230.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z23MallocDeviceDoubleArrayPPiii
	.type	_Z23MallocDeviceDoubleArrayPPiii, @function
_Z23MallocDeviceDoubleArrayPPiii:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movslq	%esi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	0(,%r13,8), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rbp, %rsi
	movslq	%edx, %rbx
	salq	$2, %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	%r13, %rsi
	leaq	16(%rsp), %rdi
	imulq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	16(%rsp), %rcx
	movq	%rax, %rsi
	xorl	%eax, %eax
	movq	%rcx, %rdx
.L3:
	cmpl	%eax, %r12d
	jle	.L8
	movq	%rdx, (%rsi,%rax,8)
	incq	%rax
	addq	%rbx, %rdx
	jmp	.L3
.L8:
	movq	%rcx, (%r14)
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rdx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rax
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z23MallocDeviceDoubleArrayPPiii, .-_Z23MallocDeviceDoubleArrayPPiii
	.globl	_Z21MallocHostDoubleArrayii
	.type	_Z21MallocHostDoubleArrayii, @function
_Z21MallocHostDoubleArrayii:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%edi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	movq	%r13, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movslq	%esi, %rbx
	salq	$2, %rbx
	pushq	%rcx
	.cfi_def_cfa_offset 48
	imulq	%rbx, %rdi
	call	malloc@PLT
	leaq	0(,%r13,8), %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%rbp, %rdx
	xorl	%ecx, %ecx
.L10:
	cmpl	%ecx, %r12d
	jle	.L13
	movq	%rdx, (%rax,%rcx,8)
	incq	%rcx
	addq	%rbx, %rdx
	jmp	.L10
.L13:
	popq	%rdx
	.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	_Z21MallocHostDoubleArrayii, .-_Z21MallocHostDoubleArrayii
	.globl	_Z31__device_stub__Z4CompPPiS0_S0_iPPiS0_S0_i
	.type	_Z31__device_stub__Z4CompPPiS0_S0_iPPiS0_S0_i, @function
_Z31__device_stub__Z4CompPPiS0_S0_iPPiS0_S0_i:
.LFB2054:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L14
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z4CompPPiS0_S0_i(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L14:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z31__device_stub__Z4CompPPiS0_S0_iPPiS0_S0_i, .-_Z31__device_stub__Z4CompPPiS0_S0_iPPiS0_S0_i
	.globl	_Z4CompPPiS0_S0_i
	.type	_Z4CompPPiS0_S0_i, @function
_Z4CompPPiS0_S0_i:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z4CompPPiS0_S0_iPPiS0_S0_i
	.cfi_endproc
.LFE2055:
	.size	_Z4CompPPiS0_S0_i, .-_Z4CompPPiS0_S0_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\350\277\231\346\230\257\344\270\200\344\270\252\347\237\251\351\230\265\347\233\270\344\271\230\347\232\204\347\250\213\345\272\217\n"
.LC1:
	.string	"\350\257\267\350\276\223\345\205\245\347\237\251\351\230\265A\345\244\247\345\260\217(\350\241\214\345\210\227\345\244\247\345\260\217)\n"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"\350\257\267\350\276\223\345\205\245\347\237\251\351\230\265A\347\232\204\346\225\260\346\215\256\n"
.LC4:
	.string	"%d"
.LC5:
	.string	"\350\257\267\350\276\223\345\205\245\347\237\251\351\230\265B\345\244\247\345\260\217(\350\241\214\345\210\227\345\244\247\345\260\217)\n"
.LC6:
	.string	"\350\257\267\350\276\223\345\205\245\347\237\251\351\230\265B\347\232\204\346\225\260\346\215\256\n"
.LC7:
	.string	"%d "
.LC8:
	.string	"\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC4(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC2(%rip), %r13
	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
	xorl	%ebx, %ebx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	24(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc23_scanf@PLT
	movl	28(%rsp), %esi
	movl	24(%rsp), %edi
	call	_Z21MallocHostDoubleArrayii
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %r12
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L20:
	cmpl	%ebx, 24(%rsp)
	jle	.L35
	xorl	%ebp, %ebp
.L22:
	cmpl	%ebp, 28(%rsp)
	jle	.L36
	movq	(%r12,%rbx,8), %rax
	movq	%r14, %rdi
	leaq	(%rax,%rbp,4), %rsi
	xorl	%eax, %eax
	incq	%rbp
	call	__isoc23_scanf@PLT
	jmp	.L22
.L36:
	incq	%rbx
	jmp	.L20
.L35:
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
	leaq	32(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	leaq	36(%rsp), %rsi
	leaq	.LC4(%rip), %r14
	call	__isoc23_scanf@PLT
	movl	36(%rsp), %esi
	movl	32(%rsp), %edi
	call	_Z21MallocHostDoubleArrayii
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %rbp
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L23:
	cmpl	%ebx, 32(%rsp)
	jle	.L37
	xorl	%r13d, %r13d
.L25:
	cmpl	%r13d, 36(%rsp)
	jle	.L38
	movq	0(%rbp,%rbx,8), %rax
	movq	%r14, %rdi
	leaq	(%rax,%r13,4), %rsi
	xorl	%eax, %eax
	incq	%r13
	call	__isoc23_scanf@PLT
	jmp	.L25
.L38:
	incq	%rbx
	jmp	.L23
.L37:
	movl	24(%rsp), %r13d
	movl	36(%rsp), %esi
	movl	%r13d, %edi
	call	_Z21MallocHostDoubleArrayii
	movl	28(%rsp), %edx
	movl	%r13d, %esi
	leaq	40(%rsp), %rdi
	movq	%rax, %rbx
	call	_Z23MallocDeviceDoubleArrayPPiii
	movl	36(%rsp), %edx
	movl	32(%rsp), %esi
	leaq	48(%rsp), %rdi
	movq	%rax, %r13
	call	_Z23MallocDeviceDoubleArrayPPiii
	movl	36(%rsp), %edx
	movl	24(%rsp), %esi
	leaq	56(%rsp), %rdi
	movq	%rax, %r14
	call	_Z23MallocDeviceDoubleArrayPPiii
	xorl	%esi, %esi
	movl	$8, %edx
	movq	%rax, %r15
	movq	56(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	cudaMemset@PLT
	movslq	24(%rsp), %rdx
	movslq	28(%rsp), %rax
	movl	$1, %ecx
	movq	(%r12), %rsi
	movq	40(%rsp), %rdi
	imulq	%rax, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	32(%rsp), %rdx
	movslq	36(%rsp), %rax
	movl	$1, %ecx
	movq	0(%rbp), %rsi
	movq	48(%rsp), %rdi
	imulq	%rax, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	24(%rsp), %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movl	$1, 72(%rsp)
	movl	%eax, 64(%rsp)
	movl	36(%rsp), %eax
	movq	%rdi, 76(%rsp)
	movl	%eax, 68(%rsp)
	movq	64(%rsp), %rdx
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	movl	28(%rsp), %ecx
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	_Z31__device_stub__Z4CompPPiS0_S0_iPPiS0_S0_i
.L26:
	movslq	24(%rsp), %rdx
	movq	(%rbx), %rdi
	movl	$2, %ecx
	xorl	%ebp, %ebp
	movslq	36(%rsp), %rax
	movq	8(%rsp), %rsi
	leaq	.LC7(%rip), %r13
	imulq	%rax, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
.L27:
	cmpl	%ebp, 24(%rsp)
	jle	.L39
	xorl	%r12d, %r12d
.L29:
	cmpl	%r12d, 36(%rsp)
	jle	.L40
	movq	(%rbx,%rbp,8), %rax
	movq	%r13, %rsi
	movl	$2, %edi
	movl	(%rax,%r12,4), %edx
	xorl	%eax, %eax
	incq	%r12
	call	__printf_chk@PLT
	jmp	.L29
.L40:
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbp
	call	__printf_chk@PLT
	jmp	.L27
.L39:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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	main, .-main
	.section	.rodata.str1.1
.LC9:
	.string	"_Z4CompPPiS0_S0_i"
	.section	.text.startup
	.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
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC9(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z4CompPPiS0_S0_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	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
	.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<time.h>
#include<stdlib.h>
__global__ void Comp(int**ctable1,int **ctable2,int **cresult,int j_N)
{
	int i=threadIdx.x;
	int j=threadIdx.y;
	for(int z=0;z<j_N;z++)
		cresult[i][j]+=ctable1[i][z]*ctable2[z][j];
}
int** MallocDeviceDoubleArray(int** head,int Array_i,int Array_j);
int** MallocHostDoubleArray(int Array_i,int Array_j);
int main()
{
	int i1_max,j1_max,i2_max,j2_max;
	printf("这是一个矩阵相乘的程序\n");
	printf("请输入矩阵A大小(行列大小)\n");
	scanf("%d %d",&j1_max,&i1_max);	//设置矩阵的大小
	int **table1=MallocHostDoubleArray(i1_max,j1_max);
	printf("请输入矩阵A的数据\n");
	for(int i=0;i<i1_max;i++)
		for(int j=0;j<j1_max;j++)
			scanf("%d",&table1[i][j]);

	printf("请输入矩阵B大小(行列大小)\n");
	scanf("%d %d",&j2_max,&i2_max);	//设置矩阵的大小
	int **table2=MallocHostDoubleArray(i2_max,j2_max);	//为两个矩阵分配host空间
	printf("请输入矩阵B的数据\n");
	for(int i=0;i<i2_max;i++)
		for(int j=0;j<j2_max;j++)
			scanf("%d",&table2[i][j]);

	/*
	for(int i=0;i<i1_max;i++)
	{
	for(int j=0;j<j1_max;j++)
	printf("%d ",table1[i][j]);
	printf("\n");
	}

	for(int i=0;i<i2_max;i++)
	{
	for(int j=0;j<j2_max;j++)
	printf("%d ",table2[i][j]);
	printf("\n");
	}*/


	int **result=MallocHostDoubleArray(i1_max,j2_max);		//分配储存结果的host空间
	int *ctable1_head,*ctable2_head,*cresult_head;
	int **ctable1=MallocDeviceDoubleArray(&ctable1_head,i1_max,j1_max),**ctable2=MallocDeviceDoubleArray(&ctable2_head,i2_max,j2_max),**cresult=MallocDeviceDoubleArray(&cresult_head,i1_max,j2_max);	//为两个矩阵分配显存空间
	hipMemset(cresult_head,0,sizeof(cresult_head));
	hipMemcpy(ctable1_head,*table1,sizeof(int)*i1_max*j1_max,hipMemcpyHostToDevice);
	hipMemcpy(ctable2_head,*table2,sizeof(int)*i2_max*j2_max,hipMemcpyHostToDevice);		//为table1，2赋值到显存
	dim3 threadmax;
	threadmax.x=i1_max;
	threadmax.y=j2_max;
	Comp<<<1,threadmax>>>(ctable1,ctable2,cresult,j1_max);
	hipMemcpy(*result,cresult_head,sizeof(int)*i1_max*j2_max,hipMemcpyDeviceToHost);
	for(int i=0;i<i1_max;i++)
	{
		for(int j=0;j<j2_max;j++)
			printf("%d ",result[i][j]);
		printf("\n");	
	}
	return 0;
}
/*
*@用二维数组的形式访问一维数组
*@（二维数组访问，一维数组存储）
*@Device端生成动态二维数组，head返回一维数组的地址（以便memcpy使用）
*@返回值为二维数组指针
*/
int** MallocDeviceDoubleArray(int** head,int Array_i,int Array_j)
{
	int** cresult,*temp,**temp3;
	hipMalloc((void**)&cresult,sizeof(int*)*Array_i);
	hipMalloc((void**)&temp,sizeof(int)*Array_i*Array_j);
	temp3=(int**)malloc(sizeof(int*)*Array_i);
	for(int i=0;i<Array_i;i++)
		temp3[i]=i*Array_j+temp;
	*head=temp;
	hipMemcpy(cresult,temp3,sizeof(int*)*Array_i,hipMemcpyHostToDevice);
	return cresult;
}
int **MallocHostDoubleArray(int Array_i,int Array_j)
{
	int **table,*table2;
	table2=(int*)malloc(sizeof(int)*Array_i*Array_j);
	table=(int**)malloc(sizeof(int*)*Array_i);
	for(int i=0;i<Array_i;i++)
	{
		table[i]=Array_j*i+table2;
	}
	return table;
}

	.text
	.file	"\347\237\251\351\230\265\347\233\270\344\271\230.hip"
	.globl	_Z19__device_stub__CompPPiS0_S0_i # -- Begin function _Z19__device_stub__CompPPiS0_S0_i
	.type	_Z19__device_stub__CompPPiS0_S0_i,@function
_Z19__device_stub__CompPPiS0_S0_i:      # @_Z19__device_stub__CompPPiS0_S0_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z4CompPPiS0_S0_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end0:
	.size	_Z19__device_stub__CompPPiS0_S0_i, .Lfunc_end0-_Z19__device_stub__CompPPiS0_S0_i
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function 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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	.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	$.Lstr, %edi
	callq	puts@PLT
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	leaq	16(%rsp), %rbx
	leaq	8(%rsp), %r14
	movl	$.L.str.2, %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	(%r14), %edi
	movl	(%rbx), %esi
	callq	_Z21MallocHostDoubleArrayii
	movq	%rax, %rbx
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	(%r14), %ecx
	testl	%ecx, %ecx
	jle	.LBB1_7
# %bb.1:                                # %.preheader48.preheader
	movl	16(%rsp), %eax
	xorl	%r15d, %r15d
.LBB1_2:                                # %.preheader48
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_4 Depth 2
	testl	%eax, %eax
	jle	.LBB1_6
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB1_2 Depth=1
	movq	(%rbx,%r15,8), %r14
	xorl	%r12d, %r12d
.LBB1_4:                                #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$.L.str.4, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	incq	%r12
	movslq	16(%rsp), %rax
	addq	$4, %r14
	cmpq	%rax, %r12
	jl	.LBB1_4
# %bb.5:                                # %._crit_edge.loopexit
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	8(%rsp), %ecx
.LBB1_6:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	incq	%r15
	movslq	%ecx, %rdx
	cmpq	%rdx, %r15
	jl	.LBB1_2
.LBB1_7:                                # %._crit_edge51
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	leaq	12(%rsp), %r14
	leaq	20(%rsp), %r12
	movl	$.L.str.2, %edi
	movq	%r14, %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	(%r12), %edi
	movl	(%r14), %esi
	callq	_Z21MallocHostDoubleArrayii
	movq	%rax, %r15
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movl	(%r12), %eax
	movl	(%r14), %esi
	testl	%eax, %eax
	jle	.LBB1_14
# %bb.8:                                # %.preheader47.preheader
	xorl	%r12d, %r12d
.LBB1_9:                                # %.preheader47
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_11 Depth 2
	testl	%esi, %esi
	jle	.LBB1_13
# %bb.10:                               # %.lr.ph53
                                        #   in Loop: Header=BB1_9 Depth=1
	movq	(%r15,%r12,8), %r14
	xorl	%r13d, %r13d
.LBB1_11:                               #   Parent Loop BB1_9 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$.L.str.4, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	incq	%r13
	movslq	12(%rsp), %rsi
	addq	$4, %r14
	cmpq	%rsi, %r13
	jl	.LBB1_11
# %bb.12:                               # %._crit_edge54.loopexit
                                        #   in Loop: Header=BB1_9 Depth=1
	movl	20(%rsp), %eax
.LBB1_13:                               # %._crit_edge54
                                        #   in Loop: Header=BB1_9 Depth=1
	incq	%r12
	movslq	%eax, %rcx
	cmpq	%rcx, %r12
	jl	.LBB1_9
.LBB1_14:                               # %._crit_edge56
	movl	8(%rsp), %edi
                                        # kill: def $esi killed $esi killed $rsi
	callq	_Z21MallocHostDoubleArrayii
	movq	%rax, %r14
	movl	8(%rsp), %esi
	movl	16(%rsp), %edx
	leaq	64(%rsp), %r12
	movq	%r12, %rdi
	callq	_Z23MallocDeviceDoubleArrayPPiii
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movl	20(%rsp), %esi
	movl	12(%rsp), %edx
	leaq	56(%rsp), %rbp
	movq	%rbp, %rdi
	callq	_Z23MallocDeviceDoubleArrayPPiii
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movl	8(%rsp), %esi
	movl	12(%rsp), %edx
	leaq	48(%rsp), %r13
	movq	%r13, %rdi
	callq	_Z23MallocDeviceDoubleArrayPPiii
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	(%r13), %r13
	movl	$8, %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	hipMemset
	movq	(%r12), %rdi
	movq	(%rbx), %rsi
	movslq	8(%rsp), %rax
	movslq	16(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rbp), %rdi
	movq	(%r15), %rsi
	movslq	20(%rsp), %rax
	movslq	12(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	8(%rsp), %eax
	movl	12(%rsp), %edx
	shlq	$32, %rdx
	orq	%rax, %rdx
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_16
# %bb.15:
	movl	16(%rsp), %ecx
	movq	40(%rsp), %rdi                  # 8-byte Reload
	movq	32(%rsp), %rsi                  # 8-byte Reload
	movq	24(%rsp), %rdx                  # 8-byte Reload
	callq	_Z19__device_stub__CompPPiS0_S0_i
.LBB1_16:
	movq	(%r14), %rdi
	movslq	8(%rsp), %rax
	movslq	12(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movq	%r13, %rsi
	movl	$2, %ecx
	callq	hipMemcpy
	cmpl	$0, 8(%rsp)
	jle	.LBB1_22
# %bb.17:                               # %.preheader.preheader
	xorl	%ebx, %ebx
.LBB1_18:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_20 Depth 2
	cmpl	$0, 12(%rsp)
	jle	.LBB1_21
# %bb.19:                               # %.lr.ph58
                                        #   in Loop: Header=BB1_18 Depth=1
	movq	(%r14,%rbx,8), %r15
	xorl	%r12d, %r12d
.LBB1_20:                               #   Parent Loop BB1_18 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r15,%r12,4), %esi
	movl	$.L.str.7, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r12
	movslq	12(%rsp), %rax
	cmpq	%rax, %r12
	jl	.LBB1_20
.LBB1_21:                               # %._crit_edge59
                                        #   in Loop: Header=BB1_18 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%rbx
	movslq	8(%rsp), %rax
	cmpq	%rax, %rbx
	jl	.LBB1_18
.LBB1_22:                               # %._crit_edge61
	xorl	%eax, %eax
	addq	$72, %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_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.globl	_Z21MallocHostDoubleArrayii     # -- Begin function _Z21MallocHostDoubleArrayii
	.type	_Z21MallocHostDoubleArrayii,@function
_Z21MallocHostDoubleArrayii:            # @_Z21MallocHostDoubleArrayii
	.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	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edi, %ebp
	movslq	%edi, %r15
	movslq	%esi, %r14
	movq	%r15, %rdi
	imulq	%r14, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, %rbx
	leaq	(,%r15,8), %rdi
	callq	malloc
	testl	%r15d, %r15d
	jle	.LBB2_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%ebp, %ecx
	shlq	$2, %r14
	xorl	%edx, %edx
.LBB2_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%rbx, (%rax,%rdx,8)
	incq	%rdx
	addq	%r14, %rbx
	cmpq	%rdx, %rcx
	jne	.LBB2_2
.LBB2_3:                                # %._crit_edge
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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_end2:
	.size	_Z21MallocHostDoubleArrayii, .Lfunc_end2-_Z21MallocHostDoubleArrayii
	.cfi_endproc
                                        # -- End function
	.globl	_Z23MallocDeviceDoubleArrayPPiii # -- Begin function _Z23MallocDeviceDoubleArrayPPiii
	.type	_Z23MallocDeviceDoubleArrayPPiii,@function
_Z23MallocDeviceDoubleArrayPPiii:       # @_Z23MallocDeviceDoubleArrayPPiii
	.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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.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	%edx, %r15d
	movl	%esi, %ebp
	movq	%rdi, %r14
	movslq	%esi, %r13
	leaq	(,%r13,8), %rbx
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	movslq	%r15d, %r12
	movq	%r13, %rsi
	imulq	%r12, %rsi
	shlq	$2, %rsi
	leaq	16(%rsp), %r15
	movq	%r15, %rdi
	callq	hipMalloc
	movq	%rbx, %rdi
	callq	malloc
	movq	(%r15), %rcx
	testl	%r13d, %r13d
	jle	.LBB3_3
# %bb.1:                                # %.lr.ph
	movl	%ebp, %edx
	shlq	$2, %r12
	xorl	%esi, %esi
	movq	%rcx, %rdi
.LBB3_2:                                # =>This Inner Loop Header: Depth=1
	movq	%rdi, (%rax,%rsi,8)
	incq	%rsi
	addq	%r12, %rdi
	cmpq	%rsi, %rdx
	jne	.LBB3_2
.LBB3_3:                                # %._crit_edge
	movq	%rcx, (%r14)
	movq	8(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rax
	addq	$24, %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_end3:
	.size	_Z23MallocDeviceDoubleArrayPPiii, .Lfunc_end3-_Z23MallocDeviceDoubleArrayPPiii
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z4CompPPiS0_S0_i, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB5_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z4CompPPiS0_S0_i,@object       # @_Z4CompPPiS0_S0_i
	.section	.rodata,"a",@progbits
	.globl	_Z4CompPPiS0_S0_i
	.p2align	3, 0x0
_Z4CompPPiS0_S0_i:
	.quad	_Z19__device_stub__CompPPiS0_S0_i
	.size	_Z4CompPPiS0_S0_i, 8

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"%d %d"
	.size	.L.str.2, 6

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%d"
	.size	.L.str.4, 3

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"%d "
	.size	.L.str.7, 4

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z4CompPPiS0_S0_i"
	.size	.L__unnamed_1, 18

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.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	"\350\277\231\346\230\257\344\270\200\344\270\252\347\237\251\351\230\265\347\233\270\344\271\230\347\232\204\347\250\213\345\272\217"
	.size	.Lstr, 34

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"\350\257\267\350\276\223\345\205\245\347\237\251\351\230\265A\345\244\247\345\260\217(\350\241\214\345\210\227\345\244\247\345\260\217)"
	.size	.Lstr.1, 37

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"\350\257\267\350\276\223\345\205\245\347\237\251\351\230\265A\347\232\204\346\225\260\346\215\256"
	.size	.Lstr.2, 26

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"\350\257\267\350\276\223\345\205\245\347\237\251\351\230\265B\345\244\247\345\260\217(\350\241\214\345\210\227\345\244\247\345\260\217)"
	.size	.Lstr.3, 37

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"\350\257\267\350\276\223\345\205\245\347\237\251\351\230\265B\347\232\204\346\225\260\346\215\256"
	.size	.Lstr.4, 26

	.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 _Z19__device_stub__CompPPiS0_S0_i
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z4CompPPiS0_S0_i
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z4CompPPiS0_S0_i       ; -- Begin function _Z4CompPPiS0_S0_i
	.globl	_Z4CompPPiS0_S0_i
	.p2align	8
	.type	_Z4CompPPiS0_S0_i,@function
_Z4CompPPiS0_S0_i:                      ; @_Z4CompPPiS0_S0_i
; %bb.0:
	s_load_b32 s4, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s4, 1
	s_cbranch_scc1 .LBB0_3
; %bb.1:                                ; %.lr.ph
	s_load_b64 s[2:3], s[0:1], 0x10
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v5, v0, 10, 10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b32_e32 v3, 3, v1
	v_lshlrev_b32_e32 v0, 2, v5
	v_lshlrev_b32_e32 v5, 2, v5
	s_waitcnt lgkmcnt(0)
	global_load_b64 v[1:2], v3, s[2:3]
	s_load_b128 s[0:3], s[0:1], 0x0
	s_waitcnt vmcnt(0)
	v_add_co_u32 v0, vcc_lo, v1, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v2, vcc_lo
	s_waitcnt lgkmcnt(0)
	global_load_b64 v[2:3], v3, s[0:1]
	global_load_b32 v4, v[0:1], off
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	s_load_b64 s[0:1], s[2:3], 0x0
	s_add_i32 s4, s4, -1
	s_add_u32 s2, s2, 8
	s_addc_u32 s3, s3, 0
	s_cmp_eq_u32 s4, 0
	s_waitcnt vmcnt(1)
	global_load_b32 v8, v[2:3], off
	s_waitcnt lgkmcnt(0)
	global_load_b32 v9, v5, s[0:1]
	v_add_co_u32 v2, vcc_lo, v2, 4
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[6:7], null, v9, v8, v[4:5]
	s_delay_alu instid0(VALU_DEP_1)
	v_mov_b32_e32 v4, v6
	global_store_b32 v[0:1], v6, off
	s_cbranch_scc0 .LBB0_2
.LBB0_3:                                ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4CompPPiS0_S0_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 28
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 10
		.amdhsa_next_free_sgpr 5
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z4CompPPiS0_S0_i, .Lfunc_end0-_Z4CompPPiS0_S0_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 220
; NumSgprs: 7
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 7
; NumVGPRsForWavesPerEU: 10
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.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_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 28
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z4CompPPiS0_S0_i
    .private_segment_fixed_size: 0
    .sgpr_count:     7
    .sgpr_spill_count: 0
    .symbol:         _Z4CompPPiS0_S0_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     10
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
