


/************************************************************************************
				PEMG-2010 
			    June 21-24, 2010
	
  Source Code :  sharedMemoryRestructuringDataTypes.cu

  Objective   :  This code demonstrates achievable shared memory bandwidth for different 
                 inbuilt data types

  Description :  Example code to demonstrate the different shared memory bandwidths 
                 achieved when 
			 1) accessing a 3d array of floats
			 2) accessing a float3 array
			 3) accessing a 4d array of floats
			 4) accessing a float4 array

 Input        :  None 

 output       :	 The different bandwidths of the shared memory that are achieved in the above 
                 mentioned accesses

 Modified     :  May 2010
                 National PARAM Supercomputing Facility, C-DAC,Pune.

 Author	      :  RarchK		

****************************************************************************************/

#include <stdio.h>
#include <cuda.h>
#include <float.h>

#define NO_OF_PATTERNS 4
#define NTIMES 10

#define BLOCK_SIZE 128
#define TRANSFERED_DATA_SIZE 2000000   //2 MB

#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)>(y)?(x):(y))

void printResults(void);



////////////////////////////////////////////////////////////////////////////////////////////////
//
// intialising an unused 3D float array in shared memory
// access pattern involving accessing the i-th element from all the rows by the i-th thread 
//
/////////////////////////////////////////////////////////////////////////////////////////////////

__global__ void set3DFloatArray( float value )
{
	__shared__ __attribute__((unused)) float array[3][BLOCK_SIZE];
	int idx = threadIdx.x;	
	array[0][idx] = value;
	array[1][idx] = value;
	array[2][idx] = value;
}

/////////////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// intialising an unused float3 array in shared memory
// access pattern involving accessing all the fields of the i-th element of the array by the i-th thread 
//
////////////////////////////////////////////////////////////////////////////////////////////////////////

__global__ void setFloat3Array( float value )
{
	__shared__ __attribute__((unused)) float3 array[BLOCK_SIZE];
	int idx = threadIdx.x;	
	array[idx].x = value;
	array[idx].y = value;
	array[idx].z = value;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////




////////////////////////////////////////////////////////////////////////////////////////////////
//
// intialising an unused 4D float array in shared memory
// access pattern involving accessing the i-th element from all the rows by the i-th thread 
//
///////////////////////////////////////////////////////////////////////////////////////////////

__global__ void set4DFloatArray( float value )
{
	__shared__ __attribute__((unused)) float array[4][BLOCK_SIZE];
	int idx = threadIdx.x;	
	array[0][idx] = value;
	array[1][idx] = value;
	array[2][idx] = value;
	array[3][idx] = value;
}

///////////////////////////////////////////////////////////////////////////////////////////////




/////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// intialising an unused float4 array in shared memory
// access pattern involving accessing all the fields of the i-th element of the array by the i-th thread 
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////

__global__ void setFloat4Array( float value )
{
	__shared__ __attribute__((unused)) float4 array[BLOCK_SIZE];
	int idx = threadIdx.x;	
	array[idx].x = value;
	array[idx].y = value;
	array[idx].z = value;
	array[idx].w = value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////




static double  avgtime[NO_OF_PATTERNS] = {0}, maxtime[NO_OF_PATTERNS] = {0}, mintime[NO_OF_PATTERNS];
static float bandWidths[NO_OF_PATTERNS] = {0}; 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// the main routene 
// for timing the different initialising kernels 
// finding the band widths
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main(int argc, char* argv[])
{
	float elapsedTimes[NO_OF_PATTERNS][NTIMES];
	cudaEvent_t start,stop;
	
	double bytes = sizeof(float) * TRANSFERED_DATA_SIZE;
	
	// event creation, which will be used for timing the code
	cudaEventCreate(&start);
	cudaEventCreate(&stop);
	
	//finding the 1D grid size 
	int gridSize = TRANSFERED_DATA_SIZE/BLOCK_SIZE;
	
	if( TRANSFERED_DATA_SIZE % BLOCK_SIZE != 0 ) 
			gridSize += 1;
	
	// running each pattern NTIMES
	for(int k=0; k < NTIMES; k++)
	{
		// timing the kernels corresponding to different access patterns
			
			// PATTERN 1
			cudaEventRecord(start,0);
			set3DFloatArray <<< gridSize,BLOCK_SIZE >>> (2.0f);
			cudaEventRecord(stop,0);
			cudaEventSynchronize(stop);
			cudaEventElapsedTime(&elapsedTimes[0][k],start,stop);

			// PATTERN 2
			cudaEventRecord(start,0);
			setFloat3Array <<< gridSize,BLOCK_SIZE >>> (2.0f);
			cudaEventRecord(stop,0);
			cudaEventSynchronize(stop);
			cudaEventElapsedTime(&elapsedTimes[1][k],start,stop);

			//PATTERN 3
			cudaEventRecord(start,0);
			set4DFloatArray <<< gridSize,BLOCK_SIZE >>> (2.0f);
			cudaEventRecord(stop,0);
			cudaEventSynchronize(stop);
			cudaEventElapsedTime(&elapsedTimes[2][k],start,stop);
		
			//PATTERN 3
			cudaEventRecord(start,0);
			setFloat4Array <<< gridSize,BLOCK_SIZE >>> (2.0f);
			cudaEventRecord(stop,0);
			cudaEventSynchronize(stop);
			cudaEventElapsedTime(&elapsedTimes[3][k],start,stop);


	} // end of the for loop involving NTIMES


	// intializing the mintime array
	for(int i=0; i < NO_OF_PATTERNS;i++)
		mintime[i] = FLT_MAX;


   for (int k=1; k < NTIMES; k++) // skiping the first iteration
	{
	   for (int i=0; i < NO_OF_PATTERNS; i++)
	   {
	       avgtime[i] = avgtime[i] + elapsedTimes[i][k];
	       mintime[i] = MIN(mintime[i],elapsedTimes[i][k]);
	       maxtime[i] = MAX(maxtime[i], elapsedTimes[i][k]);
	   }
	}


	// calculation of the different band widths that are achieved by different access patterns  
	for(int i=0; i < NO_OF_PATTERNS; i++)
	{
		avgtime[i] = avgtime[i]/(double)(NTIMES-1); // finding the average time
		bandWidths[i] = bytes/mintime[i];
	}

   printResults();

	printf("\n\n**** successful termination of the program  ****\n\n");

	cudaEventDestroy(start);
	cudaEventDestroy(stop);

	return 0;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// prints the results containig the minimum, maximum, average times taken by different kernels
// the associated maximum bandwidth of the sharede memory achieved by the different kernals
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void printResults()
{

	printf("Demonstrating differences among the different data types and their accesses in the shared memory\n");
		
   printf("The transfered data size (Bytes): %ld\n",TRANSFERED_DATA_SIZE*sizeof(float));

   printf("\n-------------------------------------------------------------------------------------------------------------------------------\n");
   printf("Pattern \t\t\t Bandwidth (GB/sec) \t Avg time (ms)  \t Min time (ms)  \t Max time (ms)\n");
   printf("-------------------------------------------------------------------------------------------------------------------------------\n");

	// printing the results for different access patterns
	for(int i=0; i < NO_OF_PATTERNS; i++)
	{
		
		switch(i)
		{
			case 0: printf("accessing 3-d float array ");
					  break;

			case 1: printf("accessing 1-d float3 array");
					  break;

			case 2: printf("accessing 4-d float array ");
					  break;
			
			case 3: printf("accessing 1-d float4 array");
					  break;
		}

		printf("\t %.6f \t\t %f \t\t  %f \t\t  %f\n",bandWidths[i]/1000000,avgtime[i],mintime[i],maxtime[i]);
  }
	
   printf("\n ------------------------------------------------------------------------------------------------------------------------------\n");

}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


	.file	"tmpxft_00336d20_00000000-6_sharedMemoryRestructuringDataTypes.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2031:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2031:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Demonstrating differences among the different data types and their accesses in the shared memory\n"
.LC1:
	.string	"The transfered data size (Bytes): %ld\n"
.LC2:
	.string	"\n-------------------------------------------------------------------------------------------------------------------------------\n"
.LC3:
	.string	"Pattern \t\t\t Bandwidth (GB/sec) \t Avg time (ms)  \t Min time (ms)  \t Max time (ms)\n"
.LC4:
	.string	"-------------------------------------------------------------------------------------------------------------------------------\n"
.LC5:
	.string	"accessing 3-d float array "
.LC6:
	.string	"accessing 1-d float3 array"
.LC7:
	.string	"accessing 4-d float array "
.LC8:
	.string	"accessing 1-d float4 array"
.LC10:
	.string	"\t %.6f \t\t %f \t\t  %f \t\t  %f\n"
.LC11:
	.string	"\n ------------------------------------------------------------------------------------------------------------------------------\n"
	.text
	.globl	_Z12printResultsv
	.type	_Z12printResultsv, @function
_Z12printResultsv:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	_ZL7maxtime(%rip), %rbp
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 32
	call	__printf_chk@PLT
	movl	$8000000, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	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
.L7:
	leaq	.LC7(%rip), %rsi
	cmpq	$2, %rbx
	je	.L10
	leaq	.LC8(%rip), %rsi
	cmpq	$3, %rbx
	je	.L10
	leaq	.LC5(%rip), %rsi
	cmpq	$1, %rbx
	jne	.L10
	leaq	.LC6(%rip), %rsi
.L10:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movsd	0(%rbp,%rbx,8), %xmm3
	movl	$2, %edi
	leaq	_ZL10bandWidths(%rip), %rax
	movss	(%rax,%rbx,4), %xmm0
	leaq	_ZL7mintime(%rip), %rax
	leaq	.LC10(%rip), %rsi
	divss	.LC9(%rip), %xmm0
	movsd	(%rax,%rbx,8), %xmm2
	leaq	_ZL7avgtime(%rip), %rax
	cvtss2sd	%xmm0, %xmm0
	movsd	(%rax,%rbx,8), %xmm1
	movb	$4, %al
	incq	%rbx
	call	__printf_chk@PLT
	cmpq	$4, %rbx
	jne	.L7
	popq	%rdx
	.cfi_def_cfa_offset 24
	leaq	.LC11(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 16
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2028:
	.size	_Z12printResultsv, .-_Z12printResultsv
	.globl	_Z34__device_stub__Z15set3DFloatArrayff
	.type	_Z34__device_stub__Z15set3DFloatArrayff, @function
_Z34__device_stub__Z15set3DFloatArrayff:
.LFB2053:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movss	%xmm0, 12(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	leaq	44(%rsp), %rsi
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	32(%rsp), %rdi
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L12
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z15set3DFloatArrayf(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L12:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2053:
	.size	_Z34__device_stub__Z15set3DFloatArrayff, .-_Z34__device_stub__Z15set3DFloatArrayff
	.globl	_Z15set3DFloatArrayf
	.type	_Z15set3DFloatArrayf, @function
_Z15set3DFloatArrayf:
.LFB2054:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z15set3DFloatArrayff
	.cfi_endproc
.LFE2054:
	.size	_Z15set3DFloatArrayf, .-_Z15set3DFloatArrayf
	.globl	_Z33__device_stub__Z14setFloat3Arrayff
	.type	_Z33__device_stub__Z14setFloat3Arrayff, @function
_Z33__device_stub__Z14setFloat3Arrayff:
.LFB2055:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movss	%xmm0, 12(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	leaq	44(%rsp), %rsi
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	32(%rsp), %rdi
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L17
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z14setFloat3Arrayf(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L17:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z33__device_stub__Z14setFloat3Arrayff, .-_Z33__device_stub__Z14setFloat3Arrayff
	.globl	_Z14setFloat3Arrayf
	.type	_Z14setFloat3Arrayf, @function
_Z14setFloat3Arrayf:
.LFB2056:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z14setFloat3Arrayff
	.cfi_endproc
.LFE2056:
	.size	_Z14setFloat3Arrayf, .-_Z14setFloat3Arrayf
	.globl	_Z34__device_stub__Z15set4DFloatArrayff
	.type	_Z34__device_stub__Z15set4DFloatArrayff, @function
_Z34__device_stub__Z15set4DFloatArrayff:
.LFB2057:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movss	%xmm0, 12(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	leaq	44(%rsp), %rsi
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	32(%rsp), %rdi
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L22
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z15set4DFloatArrayf(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L22:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2057:
	.size	_Z34__device_stub__Z15set4DFloatArrayff, .-_Z34__device_stub__Z15set4DFloatArrayff
	.globl	_Z15set4DFloatArrayf
	.type	_Z15set4DFloatArrayf, @function
_Z15set4DFloatArrayf:
.LFB2058:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z15set4DFloatArrayff
	.cfi_endproc
.LFE2058:
	.size	_Z15set4DFloatArrayf, .-_Z15set4DFloatArrayf
	.globl	_Z33__device_stub__Z14setFloat4Arrayff
	.type	_Z33__device_stub__Z14setFloat4Arrayff, @function
_Z33__device_stub__Z14setFloat4Arrayff:
.LFB2059:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movss	%xmm0, 12(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	leaq	44(%rsp), %rsi
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	32(%rsp), %rdi
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L27
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z14setFloat4Arrayf(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L27:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2059:
	.size	_Z33__device_stub__Z14setFloat4Arrayff, .-_Z33__device_stub__Z14setFloat4Arrayff
	.globl	_Z14setFloat4Arrayf
	.type	_Z14setFloat4Arrayf, @function
_Z14setFloat4Arrayf:
.LFB2060:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z14setFloat4Arrayff
	.cfi_endproc
.LFE2060:
	.size	_Z14setFloat4Arrayf, .-_Z14setFloat4Arrayf
	.section	.rodata.str1.1
.LC16:
	.string	"\n\n**** successful termination of the program  ****\n\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movabsq	$4294982921, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	$33554433, %ebx
	salq	$7, %rbx
	subq	$216, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	leaq	40(%rsp), %r12
	leaq	80(%rsp), %r13
	call	cudaEventCreate@PLT
	leaq	8(%rsp), %rdi
	call	cudaEventCreate@PLT
.L37:
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	%rbp, %rdi
	movl	$1, %esi
	movq	%rbx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rbp, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L33
	movss	.LC12(%rip), %xmm0
	call	_Z34__device_stub__Z15set3DFloatArrayff
.L33:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	8(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r12, %rdi
	call	cudaEventElapsedTime@PLT
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	%rbp, %rdi
	movl	$1, %esi
	movq	%rbx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rbp, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L34
	movss	.LC12(%rip), %xmm0
	call	_Z33__device_stub__Z14setFloat3Arrayff
.L34:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	8(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	40(%r12), %rdi
	call	cudaEventElapsedTime@PLT
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	%rbp, %rdi
	movl	$1, %esi
	movq	%rbx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rbp, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L35
	movss	.LC12(%rip), %xmm0
	call	_Z34__device_stub__Z15set4DFloatArrayff
.L35:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	8(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	80(%r12), %rdi
	call	cudaEventElapsedTime@PLT
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	%rbp, %rdi
	movl	$1, %esi
	movq	%rbx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rbp, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L36
	movss	.LC12(%rip), %xmm0
	call	_Z33__device_stub__Z14setFloat4Arrayff
.L36:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	8(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	120(%r12), %rdi
	addq	$4, %r12
	call	cudaEventElapsedTime@PLT
	cmpq	%r13, %r12
	jne	.L37
	movsd	.LC13(%rip), %xmm0
	leaq	44(%rsp), %rcx
	leaq	_ZL7avgtime(%rip), %rdx
	leaq	_ZL7mintime(%rip), %rsi
	leaq	_ZL7maxtime(%rip), %r8
	movsd	%xmm0, _ZL7mintime(%rip)
	movsd	%xmm0, 8+_ZL7mintime(%rip)
	movsd	%xmm0, 16+_ZL7mintime(%rip)
	movsd	%xmm0, 24+_ZL7mintime(%rip)
.L38:
	movq	%rcx, %rdi
	xorl	%eax, %eax
.L43:
	movsd	(%rdx,%rax), %xmm1
	cvtss2sd	(%rdi), %xmm0
	addq	$40, %rdi
	addsd	%xmm0, %xmm1
	movsd	%xmm1, (%rdx,%rax)
	movsd	(%rsi,%rax), %xmm1
	minsd	%xmm0, %xmm1
	movsd	%xmm1, (%rsi,%rax)
	movsd	(%r8,%rax), %xmm1
	maxsd	%xmm0, %xmm1
	movsd	%xmm1, (%r8,%rax)
	addq	$8, %rax
	cmpq	$32, %rax
	jne	.L43
	addq	$4, %rcx
	cmpq	%r13, %rcx
	jne	.L38
	movsd	.LC14(%rip), %xmm2
	xorl	%eax, %eax
	movsd	.LC15(%rip), %xmm1
	leaq	_ZL10bandWidths(%rip), %rcx
.L44:
	movsd	(%rdx,%rax,8), %xmm0
	divsd	%xmm2, %xmm0
	movsd	%xmm0, (%rdx,%rax,8)
	movaps	%xmm1, %xmm0
	divsd	(%rsi,%rax,8), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rcx,%rax,4)
	incq	%rax
	cmpq	$4, %rax
	jne	.L44
	call	_Z12printResultsv
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	8(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	addq	$216, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.LFE2027:
	.size	main, .-main
	.section	.rodata.str1.1
.LC17:
	.string	"_Z14setFloat4Arrayf"
.LC18:
	.string	"_Z15set4DFloatArrayf"
.LC19:
	.string	"_Z14setFloat3Arrayf"
.LC20:
	.string	"_Z15set3DFloatArrayf"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2062:
	.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	.LC17(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z14setFloat4Arrayf(%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	.LC18(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z15set4DFloatArrayf(%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
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC19(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14setFloat3Arrayf(%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
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC20(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z15set3DFloatArrayf(%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
.LFE2062:
	.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
	.local	_ZL10bandWidths
	.comm	_ZL10bandWidths,16,16
	.local	_ZL7mintime
	.comm	_ZL7mintime,32,32
	.local	_ZL7maxtime
	.comm	_ZL7maxtime,32,32
	.local	_ZL7avgtime
	.comm	_ZL7avgtime,32,32
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC9:
	.long	1232348160
	.align 4
.LC12:
	.long	1073741824
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC13:
	.long	-536870912
	.long	1206910975
	.align 8
.LC14:
	.long	0
	.long	1075970048
	.align 8
.LC15:
	.long	0
	.long	1096713344
	.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:




/************************************************************************************
				PEMG-2010 
			    June 21-24, 2010
	
  Source Code :  sharedMemoryRestructuringDataTypes.cu

  Objective   :  This code demonstrates achievable shared memory bandwidth for different 
                 inbuilt data types

  Description :  Example code to demonstrate the different shared memory bandwidths 
                 achieved when 
			 1) accessing a 3d array of floats
			 2) accessing a float3 array
			 3) accessing a 4d array of floats
			 4) accessing a float4 array

 Input        :  None 

 output       :	 The different bandwidths of the shared memory that are achieved in the above 
                 mentioned accesses

 Modified     :  May 2010
                 National PARAM Supercomputing Facility, C-DAC,Pune.

 Author	      :  RarchK		

****************************************************************************************/

#include <stdio.h>
#include <hip/hip_runtime.h>
#include <float.h>

#define NO_OF_PATTERNS 4
#define NTIMES 10

#define BLOCK_SIZE 128
#define TRANSFERED_DATA_SIZE 2000000   //2 MB

#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)>(y)?(x):(y))

void printResults(void);



////////////////////////////////////////////////////////////////////////////////////////////////
//
// intialising an unused 3D float array in shared memory
// access pattern involving accessing the i-th element from all the rows by the i-th thread 
//
/////////////////////////////////////////////////////////////////////////////////////////////////

__global__ void set3DFloatArray( float value )
{
	__shared__ __attribute__((unused)) float array[3][BLOCK_SIZE];
	int idx = threadIdx.x;	
	array[0][idx] = value;
	array[1][idx] = value;
	array[2][idx] = value;
}

/////////////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// intialising an unused float3 array in shared memory
// access pattern involving accessing all the fields of the i-th element of the array by the i-th thread 
//
////////////////////////////////////////////////////////////////////////////////////////////////////////

__global__ void setFloat3Array( float value )
{
	__shared__ __attribute__((unused)) float3 array[BLOCK_SIZE];
	int idx = threadIdx.x;	
	array[idx].x = value;
	array[idx].y = value;
	array[idx].z = value;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////




////////////////////////////////////////////////////////////////////////////////////////////////
//
// intialising an unused 4D float array in shared memory
// access pattern involving accessing the i-th element from all the rows by the i-th thread 
//
///////////////////////////////////////////////////////////////////////////////////////////////

__global__ void set4DFloatArray( float value )
{
	__shared__ __attribute__((unused)) float array[4][BLOCK_SIZE];
	int idx = threadIdx.x;	
	array[0][idx] = value;
	array[1][idx] = value;
	array[2][idx] = value;
	array[3][idx] = value;
}

///////////////////////////////////////////////////////////////////////////////////////////////




/////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// intialising an unused float4 array in shared memory
// access pattern involving accessing all the fields of the i-th element of the array by the i-th thread 
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////

__global__ void setFloat4Array( float value )
{
	__shared__ __attribute__((unused)) float4 array[BLOCK_SIZE];
	int idx = threadIdx.x;	
	array[idx].x = value;
	array[idx].y = value;
	array[idx].z = value;
	array[idx].w = value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////




static double  avgtime[NO_OF_PATTERNS] = {0}, maxtime[NO_OF_PATTERNS] = {0}, mintime[NO_OF_PATTERNS];
static float bandWidths[NO_OF_PATTERNS] = {0}; 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// the main routene 
// for timing the different initialising kernels 
// finding the band widths
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main(int argc, char* argv[])
{
	float elapsedTimes[NO_OF_PATTERNS][NTIMES];
	hipEvent_t start,stop;
	
	double bytes = sizeof(float) * TRANSFERED_DATA_SIZE;
	
	// event creation, which will be used for timing the code
	hipEventCreate(&start);
	hipEventCreate(&stop);
	
	//finding the 1D grid size 
	int gridSize = TRANSFERED_DATA_SIZE/BLOCK_SIZE;
	
	if( TRANSFERED_DATA_SIZE % BLOCK_SIZE != 0 ) 
			gridSize += 1;
	
	// running each pattern NTIMES
	for(int k=0; k < NTIMES; k++)
	{
		// timing the kernels corresponding to different access patterns
			
			// PATTERN 1
			hipEventRecord(start,0);
			set3DFloatArray <<< gridSize,BLOCK_SIZE >>> (2.0f);
			hipEventRecord(stop,0);
			hipEventSynchronize(stop);
			hipEventElapsedTime(&elapsedTimes[0][k],start,stop);

			// PATTERN 2
			hipEventRecord(start,0);
			setFloat3Array <<< gridSize,BLOCK_SIZE >>> (2.0f);
			hipEventRecord(stop,0);
			hipEventSynchronize(stop);
			hipEventElapsedTime(&elapsedTimes[1][k],start,stop);

			//PATTERN 3
			hipEventRecord(start,0);
			set4DFloatArray <<< gridSize,BLOCK_SIZE >>> (2.0f);
			hipEventRecord(stop,0);
			hipEventSynchronize(stop);
			hipEventElapsedTime(&elapsedTimes[2][k],start,stop);
		
			//PATTERN 3
			hipEventRecord(start,0);
			setFloat4Array <<< gridSize,BLOCK_SIZE >>> (2.0f);
			hipEventRecord(stop,0);
			hipEventSynchronize(stop);
			hipEventElapsedTime(&elapsedTimes[3][k],start,stop);


	} // end of the for loop involving NTIMES


	// intializing the mintime array
	for(int i=0; i < NO_OF_PATTERNS;i++)
		mintime[i] = FLT_MAX;


   for (int k=1; k < NTIMES; k++) // skiping the first iteration
	{
	   for (int i=0; i < NO_OF_PATTERNS; i++)
	   {
	       avgtime[i] = avgtime[i] + elapsedTimes[i][k];
	       mintime[i] = MIN(mintime[i],elapsedTimes[i][k]);
	       maxtime[i] = MAX(maxtime[i], elapsedTimes[i][k]);
	   }
	}


	// calculation of the different band widths that are achieved by different access patterns  
	for(int i=0; i < NO_OF_PATTERNS; i++)
	{
		avgtime[i] = avgtime[i]/(double)(NTIMES-1); // finding the average time
		bandWidths[i] = bytes/mintime[i];
	}

   printResults();

	printf("\n\n**** successful termination of the program  ****\n\n");

	hipEventDestroy(start);
	hipEventDestroy(stop);

	return 0;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// prints the results containig the minimum, maximum, average times taken by different kernels
// the associated maximum bandwidth of the sharede memory achieved by the different kernals
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void printResults()
{

	printf("Demonstrating differences among the different data types and their accesses in the shared memory\n");
		
   printf("The transfered data size (Bytes): %ld\n",TRANSFERED_DATA_SIZE*sizeof(float));

   printf("\n-------------------------------------------------------------------------------------------------------------------------------\n");
   printf("Pattern \t\t\t Bandwidth (GB/sec) \t Avg time (ms)  \t Min time (ms)  \t Max time (ms)\n");
   printf("-------------------------------------------------------------------------------------------------------------------------------\n");

	// printing the results for different access patterns
	for(int i=0; i < NO_OF_PATTERNS; i++)
	{
		
		switch(i)
		{
			case 0: printf("accessing 3-d float array ");
					  break;

			case 1: printf("accessing 1-d float3 array");
					  break;

			case 2: printf("accessing 4-d float array ");
					  break;
			
			case 3: printf("accessing 1-d float4 array");
					  break;
		}

		printf("\t %.6f \t\t %f \t\t  %f \t\t  %f\n",bandWidths[i]/1000000,avgtime[i],mintime[i],maxtime[i]);
  }
	
   printf("\n ------------------------------------------------------------------------------------------------------------------------------\n");

}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


	.text
	.file	"sharedMemoryRestructuringDataTypes.hip"
	.globl	_Z30__device_stub__set3DFloatArrayf # -- Begin function _Z30__device_stub__set3DFloatArrayf
	.type	_Z30__device_stub__set3DFloatArrayf,@function
_Z30__device_stub__set3DFloatArrayf:    # @_Z30__device_stub__set3DFloatArrayf
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movss	%xmm0, (%rax)
	leaq	16(%rsp), %rbx
	movq	%rax, (%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z15set3DFloatArrayf, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z30__device_stub__set3DFloatArrayf, .Lfunc_end0-_Z30__device_stub__set3DFloatArrayf
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__setFloat3Arrayf # -- Begin function _Z29__device_stub__setFloat3Arrayf
	.type	_Z29__device_stub__setFloat3Arrayf,@function
_Z29__device_stub__setFloat3Arrayf:     # @_Z29__device_stub__setFloat3Arrayf
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movss	%xmm0, (%rax)
	leaq	16(%rsp), %rbx
	movq	%rax, (%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z14setFloat3Arrayf, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z29__device_stub__setFloat3Arrayf, .Lfunc_end1-_Z29__device_stub__setFloat3Arrayf
	.cfi_endproc
                                        # -- End function
	.globl	_Z30__device_stub__set4DFloatArrayf # -- Begin function _Z30__device_stub__set4DFloatArrayf
	.type	_Z30__device_stub__set4DFloatArrayf,@function
_Z30__device_stub__set4DFloatArrayf:    # @_Z30__device_stub__set4DFloatArrayf
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movss	%xmm0, (%rax)
	leaq	16(%rsp), %rbx
	movq	%rax, (%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z15set4DFloatArrayf, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z30__device_stub__set4DFloatArrayf, .Lfunc_end2-_Z30__device_stub__set4DFloatArrayf
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__setFloat4Arrayf # -- Begin function _Z29__device_stub__setFloat4Arrayf
	.type	_Z29__device_stub__setFloat4Arrayf,@function
_Z29__device_stub__setFloat4Arrayf:     # @_Z29__device_stub__setFloat4Arrayf
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movss	%xmm0, (%rax)
	leaq	16(%rsp), %rbx
	movq	%rax, (%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z14setFloat4Arrayf, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z29__device_stub__setFloat4Arrayf, .Lfunc_end3-_Z29__device_stub__setFloat4Arrayf
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI4_0:
	.long	0x40000000                      # float 2
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI4_1:
	.quad	0x4022000000000000              # double 9
.LCPI4_2:
	.quad	0x415e848000000000              # double 8.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$184, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movabsq	$4294967424, %rbx               # imm = 0x100000080
	leaq	8(%rsp), %rdi
	callq	hipEventCreate
	movq	%rsp, %rdi
	callq	hipEventCreate
	leaq	16(%rsp), %r14
	movl	$10, %r12d
	leaq	15497(%rbx), %r15
.LBB4_1:                                # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	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_3
# %bb.2:                                #   in Loop: Header=BB4_1 Depth=1
	movss	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	callq	_Z30__device_stub__set3DFloatArrayf
.LBB4_3:                                #   in Loop: Header=BB4_1 Depth=1
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%rsp), %rdi
	callq	hipEventSynchronize
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
	movq	%r14, %rdi
	callq	hipEventElapsedTime
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	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_5
# %bb.4:                                #   in Loop: Header=BB4_1 Depth=1
	movss	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	callq	_Z29__device_stub__setFloat3Arrayf
.LBB4_5:                                #   in Loop: Header=BB4_1 Depth=1
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%rsp), %rdi
	callq	hipEventSynchronize
	leaq	40(%r14), %rdi
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
	callq	hipEventElapsedTime
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	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_7
# %bb.6:                                #   in Loop: Header=BB4_1 Depth=1
	movss	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	callq	_Z30__device_stub__set4DFloatArrayf
.LBB4_7:                                #   in Loop: Header=BB4_1 Depth=1
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%rsp), %rdi
	callq	hipEventSynchronize
	leaq	80(%r14), %rdi
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
	callq	hipEventElapsedTime
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	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_9
# %bb.8:                                #   in Loop: Header=BB4_1 Depth=1
	movss	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	callq	_Z29__device_stub__setFloat4Arrayf
.LBB4_9:                                #   in Loop: Header=BB4_1 Depth=1
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%rsp), %rdi
	callq	hipEventSynchronize
	leaq	120(%r14), %rdi
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
	callq	hipEventElapsedTime
	addq	$4, %r14
	decq	%r12
	jne	.LBB4_1
# %bb.10:                               # %.preheader90.preheader
	movq	$-32, %rax
	movabsq	$5183643170566569984, %rcx      # imm = 0x47EFFFFFE0000000
.LBB4_11:                               # %.preheader90
                                        # =>This Inner Loop Header: Depth=1
	movq	%rcx, _ZL7mintime+32(%rax)
	addq	$8, %rax
	jne	.LBB4_11
# %bb.12:                               # %.preheader88.preheader
	movl	$1, %eax
	leaq	20(%rsp), %rcx
.LBB4_13:                               # %.preheader88
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_14 Depth 2
	movq	$-32, %rdx
	movq	%rcx, %rsi
.LBB4_14:                               #   Parent Loop BB4_13 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rsi), %xmm0
	movsd	_ZL7avgtime+32(%rdx), %xmm1     # xmm1 = mem[0],zero
	addsd	%xmm0, %xmm1
	movsd	%xmm1, _ZL7avgtime+32(%rdx)
	movsd	_ZL7mintime+32(%rdx), %xmm1     # xmm1 = mem[0],zero
	minsd	%xmm0, %xmm1
	movsd	%xmm1, _ZL7mintime+32(%rdx)
	movsd	_ZL7maxtime+32(%rdx), %xmm1     # xmm1 = mem[0],zero
	maxsd	%xmm0, %xmm1
	movsd	%xmm1, _ZL7maxtime+32(%rdx)
	addq	$40, %rsi
	addq	$8, %rdx
	jne	.LBB4_14
# %bb.15:                               #   in Loop: Header=BB4_13 Depth=1
	incq	%rax
	addq	$4, %rcx
	cmpq	$10, %rax
	jne	.LBB4_13
# %bb.16:                               # %.preheader.preheader
	movq	$-16, %rax
	movsd	.LCPI4_1(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	.LCPI4_2(%rip), %xmm1           # xmm1 = mem[0],zero
.LBB4_17:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movsd	_ZL7avgtime+32(%rax,%rax), %xmm2 # xmm2 = mem[0],zero
	divsd	%xmm0, %xmm2
	movsd	%xmm2, _ZL7avgtime+32(%rax,%rax)
	movapd	%xmm1, %xmm2
	divsd	_ZL7mintime+32(%rax,%rax), %xmm2
	cvtsd2ss	%xmm2, %xmm2
	movss	%xmm2, _ZL10bandWidths+16(%rax)
	addq	$4, %rax
	jne	.LBB4_17
# %bb.18:
	callq	_Z12printResultsv
	movl	$.Lstr, %edi
	callq	puts@PLT
	movq	8(%rsp), %rdi
	callq	hipEventDestroy
	movq	(%rsp), %rdi
	callq	hipEventDestroy
	xorl	%eax, %eax
	addq	$184, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z12printResultsv
.LCPI5_0:
	.long	0x49742400                      # float 1.0E+6
	.text
	.globl	_Z12printResultsv
	.type	_Z12printResultsv,@function
_Z12printResultsv:                      # @_Z12printResultsv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movl	$.L.str.2, %edi
	movl	$8000000, %esi                  # imm = 0x7A1200
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	xorl	%ebx, %ebx
.LBB5_1:                                # =>This Inner Loop Header: Depth=1
	testl	$-4, %ebx
	jne	.LBB5_3
# %bb.2:                                # %switch.lookup
                                        #   in Loop: Header=BB5_1 Depth=1
	movq	.Lswitch.table._Z12printResultsv(,%rbx,8), %rdi
	xorl	%eax, %eax
	callq	printf
.LBB5_3:                                #   in Loop: Header=BB5_1 Depth=1
	movss	_ZL10bandWidths(,%rbx,4), %xmm0 # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI5_0(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movsd	_ZL7avgtime(,%rbx,8), %xmm1     # xmm1 = mem[0],zero
	movsd	_ZL7mintime(,%rbx,8), %xmm2     # xmm2 = mem[0],zero
	movsd	_ZL7maxtime(,%rbx,8), %xmm3     # xmm3 = mem[0],zero
	movl	$.L.str.10, %edi
	movb	$4, %al
	callq	printf
	incq	%rbx
	cmpq	$4, %rbx
	jne	.LBB5_1
# %bb.4:
	movl	$.Lstr.5, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end5:
	.size	_Z12printResultsv, .Lfunc_end5-_Z12printResultsv
	.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	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z15set3DFloatArrayf, %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	$_Z14setFloat3Arrayf, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z15set4DFloatArrayf, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14setFloat4Arrayf, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %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_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z15set3DFloatArrayf,@object    # @_Z15set3DFloatArrayf
	.section	.rodata,"a",@progbits
	.globl	_Z15set3DFloatArrayf
	.p2align	3, 0x0
_Z15set3DFloatArrayf:
	.quad	_Z30__device_stub__set3DFloatArrayf
	.size	_Z15set3DFloatArrayf, 8

	.type	_Z14setFloat3Arrayf,@object     # @_Z14setFloat3Arrayf
	.globl	_Z14setFloat3Arrayf
	.p2align	3, 0x0
_Z14setFloat3Arrayf:
	.quad	_Z29__device_stub__setFloat3Arrayf
	.size	_Z14setFloat3Arrayf, 8

	.type	_Z15set4DFloatArrayf,@object    # @_Z15set4DFloatArrayf
	.globl	_Z15set4DFloatArrayf
	.p2align	3, 0x0
_Z15set4DFloatArrayf:
	.quad	_Z30__device_stub__set4DFloatArrayf
	.size	_Z15set4DFloatArrayf, 8

	.type	_Z14setFloat4Arrayf,@object     # @_Z14setFloat4Arrayf
	.globl	_Z14setFloat4Arrayf
	.p2align	3, 0x0
_Z14setFloat4Arrayf:
	.quad	_Z29__device_stub__setFloat4Arrayf
	.size	_Z14setFloat4Arrayf, 8

	.type	_ZL7mintime,@object             # @_ZL7mintime
	.local	_ZL7mintime
	.comm	_ZL7mintime,32,16
	.type	_ZL7avgtime,@object             # @_ZL7avgtime
	.local	_ZL7avgtime
	.comm	_ZL7avgtime,32,16
	.type	_ZL7maxtime,@object             # @_ZL7maxtime
	.local	_ZL7maxtime
	.comm	_ZL7maxtime,32,16
	.type	_ZL10bandWidths,@object         # @_ZL10bandWidths
	.local	_ZL10bandWidths
	.comm	_ZL10bandWidths,16,16
	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"The transfered data size (Bytes): %ld\n"
	.size	.L.str.2, 39

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"accessing 3-d float array "
	.size	.L.str.6, 27

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"accessing 1-d float3 array"
	.size	.L.str.7, 27

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"accessing 4-d float array "
	.size	.L.str.8, 27

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"accessing 1-d float4 array"
	.size	.L.str.9, 27

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"\t %.6f \t\t %f \t\t  %f \t\t  %f\n"
	.size	.L.str.10, 28

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z15set3DFloatArrayf"
	.size	.L__unnamed_1, 21

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z14setFloat3Arrayf"
	.size	.L__unnamed_2, 20

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z15set4DFloatArrayf"
	.size	.L__unnamed_3, 21

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z14setFloat4Arrayf"
	.size	.L__unnamed_4, 20

	.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	"\n\n**** successful termination of the program  ****\n"
	.size	.Lstr, 52

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Demonstrating differences among the different data types and their accesses in the shared memory"
	.size	.Lstr.1, 97

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"\n-------------------------------------------------------------------------------------------------------------------------------"
	.size	.Lstr.2, 129

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Pattern \t\t\t Bandwidth (GB/sec) \t Avg time (ms)  \t Min time (ms)  \t Max time (ms)"
	.size	.Lstr.3, 81

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"-------------------------------------------------------------------------------------------------------------------------------"
	.size	.Lstr.4, 128

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"\n ------------------------------------------------------------------------------------------------------------------------------"
	.size	.Lstr.5, 129

	.type	.Lswitch.table._Z12printResultsv,@object # @switch.table._Z12printResultsv
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.Lswitch.table._Z12printResultsv:
	.quad	.L.str.6
	.quad	.L.str.7
	.quad	.L.str.8
	.quad	.L.str.9
	.size	.Lswitch.table._Z12printResultsv, 32

	.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 _Z30__device_stub__set3DFloatArrayf
	.addrsig_sym _Z29__device_stub__setFloat3Arrayf
	.addrsig_sym _Z30__device_stub__set4DFloatArrayf
	.addrsig_sym _Z29__device_stub__setFloat4Arrayf
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z15set3DFloatArrayf
	.addrsig_sym _Z14setFloat3Arrayf
	.addrsig_sym _Z15set4DFloatArrayf
	.addrsig_sym _Z14setFloat4Arrayf
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z15set3DFloatArrayf    ; -- Begin function _Z15set3DFloatArrayf
	.globl	_Z15set3DFloatArrayf
	.p2align	8
	.type	_Z15set3DFloatArrayf,@function
_Z15set3DFloatArrayf:                   ; @_Z15set3DFloatArrayf
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15set3DFloatArrayf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 4
		.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 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.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	_Z15set3DFloatArrayf, .Lfunc_end0-_Z15set3DFloatArrayf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; 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	_Z14setFloat3Arrayf     ; -- Begin function _Z14setFloat3Arrayf
	.globl	_Z14setFloat3Arrayf
	.p2align	8
	.type	_Z14setFloat3Arrayf,@function
_Z14setFloat3Arrayf:                    ; @_Z14setFloat3Arrayf
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14setFloat3Arrayf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 4
		.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 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.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	_Z14setFloat3Arrayf, .Lfunc_end1-_Z14setFloat3Arrayf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; 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	_Z15set4DFloatArrayf    ; -- Begin function _Z15set4DFloatArrayf
	.globl	_Z15set4DFloatArrayf
	.p2align	8
	.type	_Z15set4DFloatArrayf,@function
_Z15set4DFloatArrayf:                   ; @_Z15set4DFloatArrayf
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15set4DFloatArrayf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 4
		.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 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.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_end2:
	.size	_Z15set4DFloatArrayf, .Lfunc_end2-_Z15set4DFloatArrayf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; 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	_Z14setFloat4Arrayf     ; -- Begin function _Z14setFloat4Arrayf
	.globl	_Z14setFloat4Arrayf
	.p2align	8
	.type	_Z14setFloat4Arrayf,@function
_Z14setFloat4Arrayf:                    ; @_Z14setFloat4Arrayf
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14setFloat4Arrayf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 4
		.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 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.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_end3:
	.size	_Z14setFloat4Arrayf, .Lfunc_end3-_Z14setFloat4Arrayf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; 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
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 4
    .kernarg_segment_size: 4
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z15set3DFloatArrayf
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z15set3DFloatArrayf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 4
    .kernarg_segment_size: 4
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14setFloat3Arrayf
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z14setFloat3Arrayf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 4
    .kernarg_segment_size: 4
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z15set4DFloatArrayf
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z15set4DFloatArrayf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 4
    .kernarg_segment_size: 4
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14setFloat4Arrayf
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z14setFloat4Arrayf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
