#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <unistd.h>
#include <sys/time.h>
#include <cuda_runtime.h>
#include <cuda.h>


/* Problem size. */
#define NX 4096
#define NY 4096

#ifndef M_PI
#define M_PI 3.14159
#endif

void init_array(double *x, double *A)
{
	int i, j;

	for (i = 0; i < NX; i++) {
		x[i] = i * M_PI;
		for (j = 0; j < NY; j++) {
			A[i*NY + j] = ((double) i*(j)) / NX;
		}
	}
}

__global__ void kernel1(int nx, int ny, double *A, double *x, double *tmp)
{
	unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;

	if (i < nx)
	{
		tmp[i] = 0;
		int j;
		for(j=0; j < ny; j++)
		{
			tmp[i] =tmp[i] + A[i*ny+j] * x[j];
		}
	}
}

__global__ void kernel2(int nx, int ny, double *A, double *y, double *tmp)
{
 unsigned	int j = blockIdx.x * blockDim.x + threadIdx.x;

	if (j < ny)
	{
		y[j] = 0;
		int i;
		for(i=0; i < nx; i++)
		{
			y[j] = y[j] + A[i*ny+j] * tmp[i];
		}
	}
}

void trans_norm_vector(double* A, double* x, double* y, double* tmp)
{
 	int i,j;

	for (i= 0; i < NY; i++) {
    	y[i] = 0;
	}

	for (i = 0; i < NX; i++) {
      		tmp[i] = 0;

	      	for (j = 0; j < NY; j++) {
			tmp[i] = tmp[i] + A[i*NY + j] * x[j];
		}

	      	for (j = 0; j < NY; j++) {
			y[j] = y[j] + A[i*NY + j] * tmp[i];
		}
	}
}

int main(int argc, char *argv[])
{
	double		*A;
	double		*x;
	double		*y;
	double		*tmp;
	double    *gpuRef;
	struct timeval	cpu_start, cpu_end;

	// set up device
  int dev = 0;
  cudaDeviceProp deviceProp;
  cudaGetDeviceProperties(&deviceProp, dev);
  printf("Device properties %d: %s\n", dev, deviceProp.name);
  cudaSetDevice(dev);

	// set up data size of matrix
  int nx = NX;
  int ny = NY;
  int nxy = nx * ny;
  size_t nBytes = nxy * sizeof(double);
  printf("Matrix size: nx %d ny %d\n", nx, ny);

	// malloc host memory
	A = (double*)malloc(nBytes*sizeof(double));
	x = (double*)malloc(ny*sizeof(double));
	y = (double*)malloc(ny*sizeof(double));
	tmp = (double*)malloc(nx*sizeof(double));
	gpuRef = (double*)malloc(nx*sizeof(double));





	// initialize data at host side
	init_array(x, A);

	gettimeofday(&cpu_start, NULL);
	trans_norm_vector(A, x, y, tmp);
	gettimeofday(&cpu_end, NULL);
	fprintf(stdout, "CPU trans_norm_vector Runtime :%0.6lfs\n", ((cpu_end.tv_sec - cpu_start.tv_sec) * 1000000.0 + (cpu_end.tv_usec - cpu_start.tv_usec)) / 1000000.0);


	double *gpuA,*gpuX,*gpuY,*gpuTmp;

	// malloc device global memory
	cudaMalloc((void **)&gpuA, sizeof(double)*nBytes);
	cudaMalloc((void **)&gpuX, sizeof(double)*ny);
	cudaMalloc((void **)&gpuY, sizeof(double)*ny);
	cudaMalloc((void **)&gpuTmp, sizeof(double)*nx);

	// transfer data from host to device
	cudaMemcpy(gpuA, A,nBytes*sizeof(double), cudaMemcpyHostToDevice);
	cudaMemcpy(gpuX, x,ny*sizeof(double), cudaMemcpyHostToDevice);
	cudaMemcpy(gpuY, y,ny*sizeof(double), cudaMemcpyHostToDevice);
	cudaMemcpy(gpuTmp,tmp,nx*sizeof(double), cudaMemcpyHostToDevice);

	// invoke kernel at host side
	int dimx = 1024;
	int dimy = 2;
	dim3 block(dimx, dimy);

	//dim3 grid  ((nx + block.x - 1) / block.x, (ny + block.y - 1) / block.y);
	//dim3 grid4 ((nx + block.x - 1) / (block.x * 4), (ny + block.y - 1) /
				//	(block.y * 4));

	dim3 grid1(nx/ block.x, 1);
	dim3 grid2(ny/ block.x, 1);

	gettimeofday(&cpu_start, NULL);
	kernel1<<< grid1, block >>>(nx, ny,gpuA,gpuX,gpuTmp);
	cudaDeviceSynchronize();
	kernel2<<< grid2, block >>>(nx, ny,gpuA,gpuY,gpuTmp);
	cudaDeviceSynchronize();
	gettimeofday(&cpu_end, NULL);
	fprintf(stdout, "GPU trans_norm_vector Runtime :%0.6lfs\n", ((cpu_end.tv_sec - cpu_start.tv_sec) * 1000000.0 + (cpu_end.tv_usec - cpu_start.tv_usec)) / 1000000.0);

	// check kernel error
  cudaGetLastError();
	cudaMemcpy(gpuRef,gpuY, sizeof(double)*nx, cudaMemcpyDeviceToHost);

	// free device global memory
	cudaFree(gpuA);
	cudaFree(gpuX);
	cudaFree(gpuX);
	cudaFree(gpuTmp);

	// free host memory
	free(A);
	free(x);
	free(y);
	free(tmp);

	// reset device
	cudaDeviceReset();

  return (0);
}

	.file	"tmpxft_002420ab_00000000-6_TransNormVector.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2045:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2045:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z10init_arrayPdS_
	.type	_Z10init_arrayPdS_, @function
_Z10init_arrayPdS_:
.LFB2040:
	.cfi_startproc
	endbr64
	movsd	.LC0(%rip), %xmm2
	movsd	.LC1(%rip), %xmm3
	xorl	%eax, %eax
.L4:
	cvtsi2sdl	%eax, %xmm1
	movq	%rax, %rcx
	xorl	%edx, %edx
	salq	$15, %rcx
	addq	%rsi, %rcx
	movaps	%xmm1, %xmm0
	mulsd	%xmm2, %xmm0
	movsd	%xmm0, (%rdi,%rax,8)
.L3:
	cvtsi2sdl	%edx, %xmm0
	mulsd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm0
	movsd	%xmm0, (%rcx,%rdx,8)
	incq	%rdx
	cmpq	$4096, %rdx
	jne	.L3
	incq	%rax
	cmpq	$4096, %rax
	jne	.L4
	ret
	.cfi_endproc
.LFE2040:
	.size	_Z10init_arrayPdS_, .-_Z10init_arrayPdS_
	.globl	_Z17trans_norm_vectorPdS_S_S_
	.type	_Z17trans_norm_vectorPdS_S_S_, @function
_Z17trans_norm_vectorPdS_S_S_:
.LFB2041:
	.cfi_startproc
	endbr64
	movq	%rsi, %r9
	movq	%rdx, %rsi
	movq	%rdi, %r8
	movq	%rcx, %rdx
	xorl	%eax, %eax
	movl	$8192, %ecx
	movq	%rsi, %rdi
	rep stosl
	movq	%rdx, %rax
	xorl	%edi, %edi
	movq	%r8, %rdx
.L11:
	movq	$0x000000000, (%rax)
	xorl	%ecx, %ecx
.L9:
	movsd	(%rdx,%rcx), %xmm0
	mulsd	(%r9,%rcx), %xmm0
	addq	$8, %rcx
	addsd	(%rax), %xmm0
	movsd	%xmm0, (%rax)
	cmpq	$32768, %rcx
	jne	.L9
	xorl	%ecx, %ecx
.L10:
	movsd	(%rdx,%rcx), %xmm0
	mulsd	(%rax), %xmm0
	addsd	(%rsi,%rcx), %xmm0
	movsd	%xmm0, (%rsi,%rcx)
	addq	$8, %rcx
	cmpq	$32768, %rcx
	jne	.L10
	addl	$4096, %edi
	addq	$8, %rax
	addq	$32768, %rdx
	cmpl	$16777216, %edi
	jne	.L11
	ret
	.cfi_endproc
.LFE2041:
	.size	_Z17trans_norm_vectorPdS_S_S_, .-_Z17trans_norm_vectorPdS_S_S_
	.globl	_Z32__device_stub__Z7kernel1iiPdS_S_iiPdS_S_
	.type	_Z32__device_stub__Z7kernel1iiPdS_S_iiPdS_S_, @function
_Z32__device_stub__Z7kernel1iiPdS_S_iiPdS_S_:
.LFB2067:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 28(%rsp)
	leaq	48(%rsp), %rdi
	movl	%esi, 24(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 16(%rsp)
	leaq	32(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L15
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z7kernel1iiPdS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L15:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2067:
	.size	_Z32__device_stub__Z7kernel1iiPdS_S_iiPdS_S_, .-_Z32__device_stub__Z7kernel1iiPdS_S_iiPdS_S_
	.globl	_Z7kernel1iiPdS_S_
	.type	_Z7kernel1iiPdS_S_, @function
_Z7kernel1iiPdS_S_:
.LFB2068:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z7kernel1iiPdS_S_iiPdS_S_
	.cfi_endproc
.LFE2068:
	.size	_Z7kernel1iiPdS_S_, .-_Z7kernel1iiPdS_S_
	.globl	_Z32__device_stub__Z7kernel2iiPdS_S_iiPdS_S_
	.type	_Z32__device_stub__Z7kernel2iiPdS_S_iiPdS_S_, @function
_Z32__device_stub__Z7kernel2iiPdS_S_iiPdS_S_:
.LFB2069:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 28(%rsp)
	leaq	48(%rsp), %rdi
	movl	%esi, 24(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 16(%rsp)
	leaq	32(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L20
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z7kernel2iiPdS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L20:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2069:
	.size	_Z32__device_stub__Z7kernel2iiPdS_S_iiPdS_S_, .-_Z32__device_stub__Z7kernel2iiPdS_S_iiPdS_S_
	.globl	_Z7kernel2iiPdS_S_
	.type	_Z7kernel2iiPdS_S_, @function
_Z7kernel2iiPdS_S_:
.LFB2070:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z7kernel2iiPdS_S_iiPdS_S_
	.cfi_endproc
.LFE2070:
	.size	_Z7kernel2iiPdS_S_, .-_Z7kernel2iiPdS_S_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"Device properties %d: %s\n"
.LC4:
	.string	"Matrix size: nx %d ny %d\n"
.LC6:
	.string	"CPU trans_norm_vector Runtime :%0.6lfs\n"
.LC7:
	.string	"GPU trans_norm_vector Runtime :%0.6lfs\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2042:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%esi, %esi
	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	$1176, %rsp
	.cfi_def_cfa_offset 1232
	movq	%fs:40, %rax
	movq	%rax, 1160(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %r15
	leaq	112(%rsp), %r14
	leaq	128(%rsp), %rbx
	movq	%rbx, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movq	%rbx, %rcx
	xorl	%edx, %edx
	movl	$2, %edi
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%edi, %edi
	call	cudaSetDevice@PLT
	movl	$4096, %ecx
	movl	$4096, %edx
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	$1073741824, %edi
	call	malloc@PLT
	movl	$32768, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movl	$32768, %edi
	movq	%rax, %rbx
	call	malloc@PLT
	movl	$32768, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movl	$32768, %edi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movq	%rax, %r13
	call	_Z10init_arrayPdS_
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	gettimeofday@PLT
	movq	8(%rsp), %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	_Z17trans_norm_vectorPdS_S_S_
	xorl	%esi, %esi
	movq	%r14, %rdi
	call	gettimeofday@PLT
	movq	112(%rsp), %rax
	subq	96(%rsp), %rax
	leaq	.LC6(%rip), %rdx
	cvtsi2sdq	%rax, %xmm0
	movq	120(%rsp), %rax
	subq	104(%rsp), %rax
	movl	$2, %esi
	mulsd	.LC5(%rip), %xmm0
	cvtsi2sdq	%rax, %xmm1
	movb	$1, %al
	movq	stdout(%rip), %rdi
	addsd	%xmm1, %xmm0
	divsd	.LC5(%rip), %xmm0
	call	__fprintf_chk@PLT
	leaq	24(%rsp), %rdi
	movl	$1073741824, %esi
	call	cudaMalloc@PLT
	leaq	32(%rsp), %rdi
	movl	$32768, %esi
	call	cudaMalloc@PLT
	leaq	40(%rsp), %rdi
	movl	$32768, %esi
	call	cudaMalloc@PLT
	leaq	48(%rsp), %rdi
	movl	$32768, %esi
	call	cudaMalloc@PLT
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$1073741824, %edx
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	movl	$32768, %edx
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movq	%r12, %rsi
	movl	$32768, %edx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rsi
	movq	48(%rsp), %rdi
	movl	$1, %ecx
	movl	$32768, %edx
	call	cudaMemcpy@PLT
	movl	$1073741825, %eax
	xorl	%esi, %esi
	movq	%r15, %rdi
	salq	$2, %rax
	movl	$1, 80(%rsp)
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	gettimeofday@PLT
	movl	$8388609, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	72(%rsp), %rdi
	movl	80(%rsp), %esi
	salq	$10, %rdx
	movl	$1, %ecx
	movq	%rdx, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	movq	48(%rsp), %r8
	movq	32(%rsp), %rcx
	movl	$4096, %esi
	movl	$4096, %edi
	movq	24(%rsp), %rdx
	call	_Z32__device_stub__Z7kernel1iiPdS_S_iiPdS_S_
.L26:
	call	cudaDeviceSynchronize@PLT
	movl	68(%rsp), %ecx
	movl	92(%rsp), %esi
	xorl	%r9d, %r9d
	movq	60(%rsp), %rdx
	movq	84(%rsp), %rdi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L27
	movq	48(%rsp), %r8
	movq	40(%rsp), %rcx
	movl	$4096, %esi
	movl	$4096, %edi
	movq	24(%rsp), %rdx
	call	_Z32__device_stub__Z7kernel2iiPdS_S_iiPdS_S_
.L27:
	call	cudaDeviceSynchronize@PLT
	xorl	%esi, %esi
	movq	%r14, %rdi
	call	gettimeofday@PLT
	movq	112(%rsp), %rax
	subq	96(%rsp), %rax
	leaq	.LC7(%rip), %rdx
	cvtsi2sdq	%rax, %xmm0
	movq	120(%rsp), %rax
	subq	104(%rsp), %rax
	movl	$2, %esi
	mulsd	.LC5(%rip), %xmm0
	cvtsi2sdq	%rax, %xmm1
	movb	$1, %al
	movq	stdout(%rip), %rdi
	addsd	%xmm1, %xmm0
	divsd	.LC5(%rip), %xmm0
	call	__fprintf_chk@PLT
	call	cudaGetLastError@PLT
	movq	40(%rsp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdi
	movl	$32768, %edx
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	call	free@PLT
	call	cudaDeviceReset@PLT
	movq	1160(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$1176, %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
.LFE2042:
	.size	main, .-main
	.section	.rodata.str1.1
.LC8:
	.string	"_Z7kernel2iiPdS_S_"
.LC9:
	.string	"_Z7kernel1iiPdS_S_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2072:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -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	.LC8(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z7kernel2iiPdS_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC9(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z7kernel1iiPdS_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	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	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2072:
	.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
.LC0:
	.long	1413754136
	.long	1074340347
	.align 8
.LC1:
	.long	0
	.long	1060110336
	.align 8
.LC5:
	.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 <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <unistd.h>
#include <sys/time.h>
#include <hip/hip_runtime.h>



/* Problem size. */
#define NX 4096
#define NY 4096

#ifndef M_PI
#define M_PI 3.14159
#endif

void init_array(double *x, double *A)
{
	int i, j;

	for (i = 0; i < NX; i++) {
		x[i] = i * M_PI;
		for (j = 0; j < NY; j++) {
			A[i*NY + j] = ((double) i*(j)) / NX;
		}
	}
}

__global__ void kernel1(int nx, int ny, double *A, double *x, double *tmp)
{
	unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;

	if (i < nx)
	{
		tmp[i] = 0;
		int j;
		for(j=0; j < ny; j++)
		{
			tmp[i] =tmp[i] + A[i*ny+j] * x[j];
		}
	}
}

__global__ void kernel2(int nx, int ny, double *A, double *y, double *tmp)
{
 unsigned	int j = blockIdx.x * blockDim.x + threadIdx.x;

	if (j < ny)
	{
		y[j] = 0;
		int i;
		for(i=0; i < nx; i++)
		{
			y[j] = y[j] + A[i*ny+j] * tmp[i];
		}
	}
}

void trans_norm_vector(double* A, double* x, double* y, double* tmp)
{
 	int i,j;

	for (i= 0; i < NY; i++) {
    	y[i] = 0;
	}

	for (i = 0; i < NX; i++) {
      		tmp[i] = 0;

	      	for (j = 0; j < NY; j++) {
			tmp[i] = tmp[i] + A[i*NY + j] * x[j];
		}

	      	for (j = 0; j < NY; j++) {
			y[j] = y[j] + A[i*NY + j] * tmp[i];
		}
	}
}

int main(int argc, char *argv[])
{
	double		*A;
	double		*x;
	double		*y;
	double		*tmp;
	double    *gpuRef;
	struct timeval	cpu_start, cpu_end;

	// set up device
  int dev = 0;
  hipDeviceProp_t deviceProp;
  hipGetDeviceProperties(&deviceProp, dev);
  printf("Device properties %d: %s\n", dev, deviceProp.name);
  hipSetDevice(dev);

	// set up data size of matrix
  int nx = NX;
  int ny = NY;
  int nxy = nx * ny;
  size_t nBytes = nxy * sizeof(double);
  printf("Matrix size: nx %d ny %d\n", nx, ny);

	// malloc host memory
	A = (double*)malloc(nBytes*sizeof(double));
	x = (double*)malloc(ny*sizeof(double));
	y = (double*)malloc(ny*sizeof(double));
	tmp = (double*)malloc(nx*sizeof(double));
	gpuRef = (double*)malloc(nx*sizeof(double));





	// initialize data at host side
	init_array(x, A);

	gettimeofday(&cpu_start, NULL);
	trans_norm_vector(A, x, y, tmp);
	gettimeofday(&cpu_end, NULL);
	fprintf(stdout, "CPU trans_norm_vector Runtime :%0.6lfs\n", ((cpu_end.tv_sec - cpu_start.tv_sec) * 1000000.0 + (cpu_end.tv_usec - cpu_start.tv_usec)) / 1000000.0);


	double *gpuA,*gpuX,*gpuY,*gpuTmp;

	// malloc device global memory
	hipMalloc((void **)&gpuA, sizeof(double)*nBytes);
	hipMalloc((void **)&gpuX, sizeof(double)*ny);
	hipMalloc((void **)&gpuY, sizeof(double)*ny);
	hipMalloc((void **)&gpuTmp, sizeof(double)*nx);

	// transfer data from host to device
	hipMemcpy(gpuA, A,nBytes*sizeof(double), hipMemcpyHostToDevice);
	hipMemcpy(gpuX, x,ny*sizeof(double), hipMemcpyHostToDevice);
	hipMemcpy(gpuY, y,ny*sizeof(double), hipMemcpyHostToDevice);
	hipMemcpy(gpuTmp,tmp,nx*sizeof(double), hipMemcpyHostToDevice);

	// invoke kernel at host side
	int dimx = 1024;
	int dimy = 2;
	dim3 block(dimx, dimy);

	//dim3 grid  ((nx + block.x - 1) / block.x, (ny + block.y - 1) / block.y);
	//dim3 grid4 ((nx + block.x - 1) / (block.x * 4), (ny + block.y - 1) /
				//	(block.y * 4));

	dim3 grid1(nx/ block.x, 1);
	dim3 grid2(ny/ block.x, 1);

	gettimeofday(&cpu_start, NULL);
	kernel1<<< grid1, block >>>(nx, ny,gpuA,gpuX,gpuTmp);
	hipDeviceSynchronize();
	kernel2<<< grid2, block >>>(nx, ny,gpuA,gpuY,gpuTmp);
	hipDeviceSynchronize();
	gettimeofday(&cpu_end, NULL);
	fprintf(stdout, "GPU trans_norm_vector Runtime :%0.6lfs\n", ((cpu_end.tv_sec - cpu_start.tv_sec) * 1000000.0 + (cpu_end.tv_usec - cpu_start.tv_usec)) / 1000000.0);

	// check kernel error
  hipGetLastError();
	hipMemcpy(gpuRef,gpuY, sizeof(double)*nx, hipMemcpyDeviceToHost);

	// free device global memory
	hipFree(gpuA);
	hipFree(gpuX);
	hipFree(gpuX);
	hipFree(gpuTmp);

	// free host memory
	free(A);
	free(x);
	free(y);
	free(tmp);

	// reset device
	hipDeviceReset();

  return (0);
}

	.text
	.file	"TransNormVector.hip"
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10init_arrayPdS_
.LCPI0_0:
	.quad	0x400921fb54442d18              # double 3.1415926535897931
.LCPI0_1:
	.quad	0x3f30000000000000              # double 2.44140625E-4
	.text
	.globl	_Z10init_arrayPdS_
	.type	_Z10init_arrayPdS_,@function
_Z10init_arrayPdS_:                     # @_Z10init_arrayPdS_
	.cfi_startproc
# %bb.0:
	xorl	%eax, %eax
	movsd	.LCPI0_0(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	.LCPI0_1(%rip), %xmm1           # xmm1 = mem[0],zero
.LBB0_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_2 Depth 2
	xorps	%xmm2, %xmm2
	cvtsi2sd	%eax, %xmm2
	movapd	%xmm2, %xmm3
	mulsd	%xmm0, %xmm3
	movsd	%xmm3, (%rdi,%rax,8)
	xorl	%ecx, %ecx
.LBB0_2:                                #   Parent Loop BB0_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm3, %xmm3
	cvtsi2sd	%ecx, %xmm3
	mulsd	%xmm2, %xmm3
	mulsd	%xmm1, %xmm3
	movsd	%xmm3, (%rsi,%rcx,8)
	incq	%rcx
	cmpq	$4096, %rcx                     # imm = 0x1000
	jne	.LBB0_2
# %bb.3:                                #   in Loop: Header=BB0_1 Depth=1
	incq	%rax
	addq	$32768, %rsi                    # imm = 0x8000
	cmpq	$4096, %rax                     # imm = 0x1000
	jne	.LBB0_1
# %bb.4:
	retq
.Lfunc_end0:
	.size	_Z10init_arrayPdS_, .Lfunc_end0-_Z10init_arrayPdS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__kernel1iiPdS_S_ # -- Begin function _Z22__device_stub__kernel1iiPdS_S_
	.type	_Z22__device_stub__kernel1iiPdS_S_,@function
_Z22__device_stub__kernel1iiPdS_S_:     # @_Z22__device_stub__kernel1iiPdS_S_
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	4(%rsp), %rax
	movl	%edi, (%rax)
	movq	%rsp, %rdi
	movl	%esi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%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	$_Z7kernel1iiPdS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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_end1:
	.size	_Z22__device_stub__kernel1iiPdS_S_, .Lfunc_end1-_Z22__device_stub__kernel1iiPdS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__kernel2iiPdS_S_ # -- Begin function _Z22__device_stub__kernel2iiPdS_S_
	.type	_Z22__device_stub__kernel2iiPdS_S_,@function
_Z22__device_stub__kernel2iiPdS_S_:     # @_Z22__device_stub__kernel2iiPdS_S_
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	4(%rsp), %rax
	movl	%edi, (%rax)
	movq	%rsp, %rdi
	movl	%esi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%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	$_Z7kernel2iiPdS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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_end2:
	.size	_Z22__device_stub__kernel2iiPdS_S_, .Lfunc_end2-_Z22__device_stub__kernel2iiPdS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z17trans_norm_vectorPdS_S_S_   # -- Begin function _Z17trans_norm_vectorPdS_S_S_
	.type	_Z17trans_norm_vectorPdS_S_S_,@function
_Z17trans_norm_vectorPdS_S_S_:          # @_Z17trans_norm_vectorPdS_S_S_
	.cfi_startproc
# %bb.0:                                # %.preheader31.preheader
	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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	xorl	%r13d, %r13d
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB3_1:                                # %.preheader31
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_2 Depth 2
                                        #     Child Loop BB3_4 Depth 2
	movq	$0, (%rbx,%r13,8)
	xorpd	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB3_2:                                #   Parent Loop BB3_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%r12,%rax,8), %xmm1            # xmm1 = mem[0],zero
	mulsd	(%r15,%rax,8), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx,%r13,8)
	incq	%rax
	cmpq	$4096, %rax                     # imm = 0x1000
	jne	.LBB3_2
# %bb.3:                                # %.preheader
                                        #   in Loop: Header=BB3_1 Depth=1
	xorl	%eax, %eax
.LBB3_4:                                #   Parent Loop BB3_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%r12,%rax,8), %xmm0            # xmm0 = mem[0],zero
	mulsd	(%rbx,%r13,8), %xmm0
	addsd	(%r14,%rax,8), %xmm0
	movsd	%xmm0, (%r14,%rax,8)
	incq	%rax
	cmpq	$4096, %rax                     # imm = 0x1000
	jne	.LBB3_4
# %bb.5:                                #   in Loop: Header=BB3_1 Depth=1
	incq	%r13
	addq	$32768, %r12                    # imm = 0x8000
	cmpq	$4096, %r13                     # imm = 0x1000
	jne	.LBB3_1
# %bb.6:
	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_end3:
	.size	_Z17trans_norm_vectorPdS_S_S_, .Lfunc_end3-_Z17trans_norm_vectorPdS_S_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI4_0:
	.quad	0x400921fb54442d18              # double 3.1415926535897931
.LCPI4_1:
	.quad	0x3f30000000000000              # double 2.44140625E-4
.LCPI4_2:
	.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
	subq	$1560, %rsp                     # imm = 0x618
	.cfi_def_cfa_offset 1616
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	88(%rsp), %rbx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	hipGetDevicePropertiesR0600
	movl	$.L.str, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	printf
	xorl	%edi, %edi
	callq	hipSetDevice
	movl	$.L.str.1, %edi
	movl	$4096, %esi                     # imm = 0x1000
	movl	$4096, %edx                     # imm = 0x1000
	xorl	%eax, %eax
	callq	printf
	movl	$1073741824, %edi               # imm = 0x40000000
	callq	malloc
	movq	%rax, %rbx
	movl	$32768, %edi                    # imm = 0x8000
	callq	malloc
	movq	%rax, %r14
	movl	$32768, %edi                    # imm = 0x8000
	callq	malloc
	movq	%rax, %r12
	movl	$32768, %edi                    # imm = 0x8000
	callq	malloc
	movq	%rax, %r13
	movl	$32768, %edi                    # imm = 0x8000
	callq	malloc
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movsd	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	.LCPI4_1(%rip), %xmm1           # xmm1 = mem[0],zero
	movq	%rbx, 40(%rsp)                  # 8-byte Spill
.LBB4_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_2 Depth 2
	xorps	%xmm2, %xmm2
	cvtsi2sd	%r15d, %xmm2
	movapd	%xmm2, %xmm3
	mulsd	%xmm0, %xmm3
	movsd	%xmm3, (%r14,%r15,8)
	xorl	%ecx, %ecx
.LBB4_2:                                #   Parent Loop BB4_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm3, %xmm3
	cvtsi2sd	%ecx, %xmm3
	mulsd	%xmm2, %xmm3
	mulsd	%xmm1, %xmm3
	movsd	%xmm3, (%rbx,%rcx,8)
	incq	%rcx
	cmpq	$4096, %rcx                     # imm = 0x1000
	jne	.LBB4_2
# %bb.3:                                #   in Loop: Header=BB4_1 Depth=1
	incq	%r15
	addq	$32768, %rbx                    # imm = 0x8000
	cmpq	$4096, %r15                     # imm = 0x1000
	jne	.LBB4_1
# %bb.4:                                # %_Z10init_arrayPdS_.exit
	leaq	56(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	40(%rsp), %rbp                  # 8-byte Reload
	movq	%rbp, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	_Z17trans_norm_vectorPdS_S_S_
	leaq	72(%rsp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	stdout(%rip), %rdi
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	subq	(%rbx), %rax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rax, %xmm1
	movsd	.LCPI4_2(%rip), %xmm2           # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm1
	subq	8(%rbx), %rcx
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rcx, %xmm0
	addsd	%xmm1, %xmm0
	divsd	%xmm2, %xmm0
	movl	$.L.str.2, %esi
	movb	$1, %al
	callq	fprintf
	leaq	32(%rsp), %rbx
	movl	$1073741824, %esi               # imm = 0x40000000
	movq	%rbx, %rdi
	callq	hipMalloc
	leaq	24(%rsp), %r15
	movl	$32768, %esi                    # imm = 0x8000
	movq	%r15, %rdi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movl	$32768, %esi                    # imm = 0x8000
	callq	hipMalloc
	leaq	8(%rsp), %rdi
	movl	$32768, %esi                    # imm = 0x8000
	callq	hipMalloc
	movq	(%rbx), %rdi
	movabsq	$8589935616, %rbx               # imm = 0x200000400
	movl	$1073741824, %edx               # imm = 0x40000000
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r15), %rdi
	movabsq	$4294967300, %r15               # imm = 0x100000004
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	16(%rsp), %rax
	movq	(%rax), %rdi
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	8(%rsp), %rax
	movq	(%rax), %rdi
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r13, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	56(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_6
# %bb.5:
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rcx
	movq	8(%rsp), %r8
	movl	$4096, %edi                     # imm = 0x1000
	movl	$4096, %esi                     # imm = 0x1000
	callq	_Z22__device_stub__kernel1iiPdS_S_
.LBB4_6:
	callq	hipDeviceSynchronize
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_8
# %bb.7:
	movq	32(%rsp), %rdx
	movq	16(%rsp), %rcx
	movq	8(%rsp), %r8
	movl	$4096, %edi                     # imm = 0x1000
	movl	$4096, %esi                     # imm = 0x1000
	callq	_Z22__device_stub__kernel2iiPdS_S_
.LBB4_8:
	callq	hipDeviceSynchronize
	leaq	72(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	stdout(%rip), %rdi
	movq	(%rbx), %rax
	subq	56(%rsp), %rax
	cvtsi2sd	%rax, %xmm1
	movq	8(%rbx), %rax
	movsd	.LCPI4_2(%rip), %xmm2           # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm1
	subq	64(%rsp), %rax
	cvtsi2sd	%rax, %xmm0
	addsd	%xmm1, %xmm0
	divsd	%xmm2, %xmm0
	movl	$.L.str.3, %esi
	movb	$1, %al
	callq	fprintf
	callq	hipGetLastError
	movq	16(%rsp), %rsi
	movl	$32768, %edx                    # imm = 0x8000
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	%r12, %rdi
	callq	free
	movq	%r13, %rdi
	callq	free
	callq	hipDeviceReset
	xorl	%eax, %eax
	addq	$1560, %rsp                     # imm = 0x618
	.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
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7kernel1iiPdS_S_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7kernel2iiPdS_S_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__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	.LBB6_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
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z7kernel1iiPdS_S_,@object      # @_Z7kernel1iiPdS_S_
	.section	.rodata,"a",@progbits
	.globl	_Z7kernel1iiPdS_S_
	.p2align	3, 0x0
_Z7kernel1iiPdS_S_:
	.quad	_Z22__device_stub__kernel1iiPdS_S_
	.size	_Z7kernel1iiPdS_S_, 8

	.type	_Z7kernel2iiPdS_S_,@object      # @_Z7kernel2iiPdS_S_
	.globl	_Z7kernel2iiPdS_S_
	.p2align	3, 0x0
_Z7kernel2iiPdS_S_:
	.quad	_Z22__device_stub__kernel2iiPdS_S_
	.size	_Z7kernel2iiPdS_S_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Device properties %d: %s\n"
	.size	.L.str, 26

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Matrix size: nx %d ny %d\n"
	.size	.L.str.1, 26

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"CPU trans_norm_vector Runtime :%0.6lfs\n"
	.size	.L.str.2, 40

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"GPU trans_norm_vector Runtime :%0.6lfs\n"
	.size	.L.str.3, 40

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z7kernel1iiPdS_S_"
	.size	.L__unnamed_1, 19

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z7kernel2iiPdS_S_"
	.size	.L__unnamed_2, 19

	.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

	.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 _Z22__device_stub__kernel1iiPdS_S_
	.addrsig_sym _Z22__device_stub__kernel2iiPdS_S_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z7kernel1iiPdS_S_
	.addrsig_sym _Z7kernel2iiPdS_S_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z7kernel1iiPdS_S_      ; -- Begin function _Z7kernel1iiPdS_S_
	.globl	_Z7kernel1iiPdS_S_
	.p2align	8
	.type	_Z7kernel1iiPdS_S_,@function
_Z7kernel1iiPdS_S_:                     ; @_Z7kernel1iiPdS_S_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b64 s[4:5], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_u32_e64 s4, v1
	s_cbranch_execz .LBB0_4
; %bb.1:
	s_load_b64 s[2:3], s[0:1], 0x18
	v_mov_b32_e32 v2, 0
	s_cmp_lt_i32 s5, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[3:4], 3, v[1:2]
	v_mov_b32_e32 v5, v2
	v_mov_b32_e32 v6, v2
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s2, v3
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v4, vcc_lo, s3, v4, vcc_lo
	global_store_b64 v[3:4], v[5:6], off
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph
	s_load_b128 s[0:3], s[0:1], 0x8
	v_mul_lo_u32 v1, v1, s5
	v_mov_b32_e32 v5, 0
	v_mov_b32_e32 v6, 0
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[7:8], 3, v[1:2]
	s_add_i32 s5, s5, -1
	v_add_nc_u32_e32 v1, 1, v1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, vcc_lo, s0, v7
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v8, vcc_lo, s1, v8, vcc_lo
	global_load_b64 v[9:10], v2, s[2:3]
	global_load_b64 v[7:8], v[7:8], off
	s_add_u32 s2, s2, 8
	s_addc_u32 s3, s3, 0
	s_cmp_lg_u32 s5, 0
	s_waitcnt vmcnt(0)
	v_fma_f64 v[5:6], v[7:8], v[9:10], v[5:6]
	global_store_b64 v[3:4], v[5:6], off
	s_cbranch_scc1 .LBB0_3
.LBB0_4:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7kernel1iiPdS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 0
		.amdhsa_next_free_vgpr 11
		.amdhsa_next_free_sgpr 16
		.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	_Z7kernel1iiPdS_S_, .Lfunc_end0-_Z7kernel1iiPdS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 256
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; 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: 0
	.text
	.protected	_Z7kernel2iiPdS_S_      ; -- Begin function _Z7kernel2iiPdS_S_
	.globl	_Z7kernel2iiPdS_S_
	.p2align	8
	.type	_Z7kernel2iiPdS_S_,@function
_Z7kernel2iiPdS_S_:                     ; @_Z7kernel2iiPdS_S_
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x2c
	s_load_b64 s[2:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	s_mov_b32 s4, exec_lo
	v_cmpx_gt_u32_e64 s3, v1
	s_cbranch_execz .LBB1_4
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x8
	v_mov_b32_e32 v2, 0
	s_cmp_lt_i32 s2, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[3:4], 3, v[1:2]
	v_mov_b32_e32 v5, v2
	v_mov_b32_e32 v6, v2
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s6, v3
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v4, vcc_lo
	global_store_b64 v[3:4], v[5:6], off
	s_cbranch_scc1 .LBB1_4
; %bb.2:                                ; %.lr.ph.preheader
	s_load_b64 s[0:1], s[0:1], 0x18
	v_mov_b32_e32 v5, 0
	v_mov_b32_e32 v6, 0
.LBB1_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_lshlrev_b64 v[7:8], 3, v[1:2]
	s_add_i32 s2, s2, -1
	v_add_nc_u32_e32 v1, s3, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, s4, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s5, v8, vcc_lo
	s_waitcnt lgkmcnt(0)
	global_load_b64 v[9:10], v2, s[0:1]
	global_load_b64 v[7:8], v[7:8], off
	s_add_u32 s0, s0, 8
	s_addc_u32 s1, s1, 0
	s_cmp_lg_u32 s2, 0
	s_waitcnt vmcnt(0)
	v_fma_f64 v[5:6], v[7:8], v[9:10], v[5:6]
	global_store_b64 v[3:4], v[5:6], off
	s_cbranch_scc1 .LBB1_3
.LBB1_4:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7kernel2iiPdS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 0
		.amdhsa_next_free_vgpr 11
		.amdhsa_next_free_sgpr 16
		.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_end1:
	.size	_Z7kernel2iiPdS_S_, .Lfunc_end1-_Z7kernel2iiPdS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 244
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; 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: 0
	.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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7kernel1iiPdS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7kernel1iiPdS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7kernel2iiPdS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7kernel2iiPdS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
