
#include <time.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>

#include <iostream>

// Required to include CUDA vector types
#include <cuda_runtime.h>
#include <vector_types.h>

#define REPETITIONS	1000

#define NS_PER_SECOND	1000000000L


#define VECTOR_SIZE	1000*1024
// CUDA kernel. Each thread takes care of one element of c
// From https://www.olcf.ornl.gov/tutorials/cuda-vector-addition
__global__ 
void kernel_vector_sum(float *dst, float *v, int n)
{
    // Get our global thread ID
    int id = blockIdx.x*blockDim.x+threadIdx.x;
 
    // Make sure we do not go out of bounds
    if (id < n)
        dst[id] += v[id];
}


void cpu_vector_sum(float *dst, float *v, int n)
{
  for (int i=0; i<n; i++) 
        dst[n] += v[n];
}


void vectorSumTest()
{
  struct timespec t0, t1; 
  uint64_t dt;
  float *dst_cpu = new float[VECTOR_SIZE];
  float *v_cpu = new float[VECTOR_SIZE];
  std::cout << "CPU Vector Sum test. ";
  dt = 0;
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    cpu_vector_sum(dst_cpu, v_cpu, VECTOR_SIZE);
    clock_gettime(CLOCK_MONOTONIC, &t1); 
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time: " << ((double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;

  float *dst_gpu;
  float *v_gpu;
  int numCudaThreads = 1;
  cudaMalloc(&dst_gpu, VECTOR_SIZE*sizeof(float));
  cudaMalloc(&v_gpu, VECTOR_SIZE*sizeof(float));
  dt = 0;
  int blockSize = 1024;
  int gridSize = (int)ceil((float)numCudaThreads/blockSize);
  std::cout << "GPU Vector Sum test. ";
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    kernel_vector_sum <<< gridSize, blockSize >>> (dst_gpu, v_gpu, VECTOR_SIZE);
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time for "<< numCudaThreads << " threads: " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;
  
  
  numCudaThreads = 64;
  dt = 0;
  blockSize = 1024;
  gridSize = (int)ceil((float)numCudaThreads/blockSize);
  std::cout << "GPU Vector Sum test. ";
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    kernel_vector_sum <<< gridSize, blockSize >>> (dst_gpu, v_gpu, VECTOR_SIZE);
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time for "<< numCudaThreads << " threads: " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;

  numCudaThreads = 128;
  dt = 0;
  blockSize = 1024;
  gridSize = (int)ceil((float)numCudaThreads/blockSize);
  std::cout << "GPU Vector Sum test. ";
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    kernel_vector_sum <<< gridSize, blockSize >>> (dst_gpu, v_gpu, VECTOR_SIZE);
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time for "<< numCudaThreads << " threads: " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;
  
  numCudaThreads = 128;
  dt = 0;
  blockSize = 1024;
  gridSize = (int)ceil((float)numCudaThreads/blockSize);
  std::cout << "GPU Vector Sum test. ";
  const int vsize = VECTOR_SIZE*sizeof(float);
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    cudaMemcpy( dst_gpu, dst_cpu, vsize, cudaMemcpyHostToDevice );
    cudaMemcpy( v_gpu, v_cpu, vsize, cudaMemcpyHostToDevice );   
    kernel_vector_sum <<< gridSize, blockSize >>> (dst_gpu, v_gpu, VECTOR_SIZE);
    cudaMemcpy( dst_cpu, dst_gpu, vsize, cudaMemcpyDeviceToHost );
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time for "<< numCudaThreads << " threads (with memcpy): " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;

  cudaFree(&dst_gpu);
  cudaFree(&v_gpu);
  delete[] v_cpu;
  delete[] dst_cpu;
  
}



#define LOOP_COUNT	10000000


__global__
void gpu_loopTest()
{
  long tmp=0;
  for (int i=0; i<LOOP_COUNT; i++) {
    tmp++;
  }
}

void cpu_loopTest()
{
  long tmp=0;
  for (int i=0; i<LOOP_COUNT; i++) {
    tmp++;
  }
}

// Loop
void loopTest()
{
  struct timespec t0, t1; 
  uint64_t dt;
  std::cout << "CPU Loop test. ";
  dt = 0;
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    cpu_loopTest();
    clock_gettime(CLOCK_MONOTONIC, &t1); 
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time: " << ((double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;

  dt = 0;
  dim3 dimBlock( 1, 1 );
  dim3 dimGrid( 1, 1 );
  std::cout << "GPU Loop test. ";
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    gpu_loopTest <<< dimGrid, dimBlock >>> ();
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time: " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;
}


int main() 
{
  std::cout.imbue( std::locale("") );
  std::cout << "CUDA test" << std::endl;
  std::cout << "Averages for " << REPETITIONS << " repetitions." << std::endl;
  
  loopTest();
  vectorSumTest();

  return 0;
}

	.file	"tmpxft_002c3306_00000000-6_cudatest.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3642:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3642:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4301:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4301:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z14cpu_vector_sumPfS_i
	.type	_Z14cpu_vector_sumPfS_i, @function
_Z14cpu_vector_sumPfS_i:
.LFB3635:
	.cfi_startproc
	endbr64
	movslq	%edx, %rax
	salq	$2, %rax
	addq	%rax, %rdi
	addq	%rax, %rsi
	xorl	%eax, %eax
.L4:
	cmpl	%edx, %eax
	jge	.L7
	movss	(%rdi), %xmm0
	addss	(%rsi), %xmm0
	incl	%eax
	movss	%xmm0, (%rdi)
	jmp	.L4
.L7:
	ret
	.cfi_endproc
.LFE3635:
	.size	_Z14cpu_vector_sumPfS_i, .-_Z14cpu_vector_sumPfS_i
	.globl	_Z12cpu_loopTestv
	.type	_Z12cpu_loopTestv, @function
_Z12cpu_loopTestv:
.LFB3637:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE3637:
	.size	_Z12cpu_loopTestv, .-_Z12cpu_loopTestv
	.globl	_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i
	.type	_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i, @function
_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i:
.LFB3664:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L9
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z17kernel_vector_sumPfS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	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 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L9:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3664:
	.size	_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i, .-_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i
	.globl	_Z17kernel_vector_sumPfS_i
	.type	_Z17kernel_vector_sumPfS_i, @function
_Z17kernel_vector_sumPfS_i:
.LFB3665:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i
	.cfi_endproc
.LFE3665:
	.size	_Z17kernel_vector_sumPfS_i, .-_Z17kernel_vector_sumPfS_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"CPU Vector Sum test. "
.LC1:
	.string	"Time: "
.LC3:
	.string	" s ("
.LC4:
	.string	" ns)"
.LC5:
	.string	"GPU Vector Sum test. "
.LC6:
	.string	"Time for "
.LC7:
	.string	" threads: "
.LC8:
	.string	" threads (with memcpy): "
	.text
	.globl	_Z13vectorSumTestv
	.type	_Z13vectorSumTestv, @function
_Z13vectorSumTestv:
.LFB3636:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$4096000, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$1000, %r14d
	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
	leaq	_ZSt4cout(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %r13
	call	_Znam@PLT
	movl	$4096000, %edi
	movq	%rax, (%rsp)
	call	_Znam@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rbp, %rdi
	movq	%rax, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L15:
	movq	%r13, %rsi
	movl	$1, %edi
	leaq	72(%rsp), %r12
	call	clock_gettime@PLT
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1024000, %edx
	call	_Z14cpu_vector_sumPfS_i
	movq	%r12, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movq	72(%rsp), %rax
	subq	56(%rsp), %rax
	imulq	$1000000000, %rax, %rax
	addq	80(%rsp), %rax
	subq	64(%rsp), %rax
	addq	%rax, %rbx
	decl	%r14d
	jne	.L15
	movq	%rbp, %rdi
	leaq	.LC1(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	testq	%rbx, %rbx
	js	.L16
	cvtsi2sdq	%rbx, %xmm0
	jmp	.L17
.L16:
	movq	%rbx, %rax
	movq	%rbx, %rdx
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
.L17:
	divsd	.LC2(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	movl	$1000, %r14d
	movabsq	$4294968320, %r15
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000, %ecx
	xorl	%edx, %edx
	movq	%rax, %rdi
	movq	%rbx, %rax
	xorl	%ebx, %ebx
	divq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	16(%rsp), %rdi
	movl	$4096000, %esi
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movl	$4096000, %esi
	call	cudaMalloc@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L19:
	movq	%r13, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r15, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movq	%r15, 44(%rsp)
	movl	$1, 52(%rsp)
	movq	%rdi, 32(%rsp)
	movl	$1, 40(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$1024000, %edx
	call	_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i
.L18:
	movq	%r12, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movq	72(%rsp), %rax
	subq	56(%rsp), %rax
	imulq	$1000000000, %rax, %rax
	addq	80(%rsp), %rax
	subq	64(%rsp), %rax
	addq	%rax, %rbx
	decl	%r14d
	jne	.L19
	leaq	.LC6(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	testq	%rbx, %rbx
	js	.L20
	cvtsi2sdq	%rbx, %xmm0
	jmp	.L21
.L20:
	movq	%rbx, %rax
	movq	%rbx, %rdx
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
.L21:
	divsd	.LC2(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	movl	$1000, %r14d
	movabsq	$4294968320, %r15
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000, %ecx
	xorl	%edx, %edx
	movq	%rax, %rdi
	movq	%rbx, %rax
	xorl	%ebx, %ebx
	divq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC5(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L23:
	movq	%r13, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r15, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movq	%r15, 44(%rsp)
	movl	$1, 52(%rsp)
	movq	%rdi, 32(%rsp)
	movl	$1, 40(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L22
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$1024000, %edx
	call	_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i
.L22:
	movq	%r12, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movq	72(%rsp), %rax
	subq	56(%rsp), %rax
	imulq	$1000000000, %rax, %rax
	addq	80(%rsp), %rax
	subq	64(%rsp), %rax
	addq	%rax, %rbx
	decl	%r14d
	jne	.L23
	leaq	.LC6(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$64, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	testq	%rbx, %rbx
	js	.L24
	cvtsi2sdq	%rbx, %xmm0
	jmp	.L25
.L24:
	movq	%rbx, %rax
	movq	%rbx, %rdx
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
.L25:
	divsd	.LC2(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	movl	$1000, %r14d
	movabsq	$4294968320, %r15
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000, %ecx
	xorl	%edx, %edx
	movq	%rax, %rdi
	movq	%rbx, %rax
	xorl	%ebx, %ebx
	divq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC5(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L27:
	movq	%r13, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r15, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movq	%r15, 44(%rsp)
	movl	$1, 52(%rsp)
	movq	%rdi, 32(%rsp)
	movl	$1, 40(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$1024000, %edx
	call	_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i
.L26:
	movq	%r12, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movq	72(%rsp), %rax
	subq	56(%rsp), %rax
	imulq	$1000000000, %rax, %rax
	addq	80(%rsp), %rax
	subq	64(%rsp), %rax
	addq	%rax, %rbx
	decl	%r14d
	jne	.L27
	leaq	.LC6(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$128, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	testq	%rbx, %rbx
	js	.L28
	cvtsi2sdq	%rbx, %xmm0
	jmp	.L29
.L28:
	movq	%rbx, %rax
	movq	%rbx, %rdx
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
.L29:
	divsd	.LC2(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	movl	$1000, %r14d
	movabsq	$4294968320, %r15
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000, %ecx
	xorl	%edx, %edx
	movq	%rax, %rdi
	movq	%rbx, %rax
	xorl	%ebx, %ebx
	divq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC5(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L31:
	movq	%r13, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movq	(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movl	$4096000, %edx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rsi
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	movl	$4096000, %edx
	call	cudaMemcpy@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r15, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movq	%r15, 44(%rsp)
	movl	$1, 52(%rsp)
	movq	%rdi, 32(%rsp)
	movl	$1, 40(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$1024000, %edx
	call	_Z40__device_stub__Z17kernel_vector_sumPfS_iPfS_i
.L30:
	movq	16(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %ecx
	movl	$4096000, %edx
	call	cudaMemcpy@PLT
	movq	%r12, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movq	72(%rsp), %rax
	subq	56(%rsp), %rax
	imulq	$1000000000, %rax, %rax
	addq	80(%rsp), %rax
	subq	64(%rsp), %rax
	addq	%rax, %rbx
	decl	%r14d
	jne	.L31
	leaq	.LC6(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$128, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC8(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	testq	%rbx, %rbx
	js	.L32
	cvtsi2sdq	%rbx, %xmm0
	jmp	.L33
.L32:
	movq	%rbx, %rax
	movq	%rbx, %rdx
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
.L33:
	divsd	.LC2(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000, %ecx
	xorl	%edx, %edx
	movq	%rax, %rdi
	movq	%rbx, %rax
	divq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	16(%rsp), %rdi
	call	cudaFree@PLT
	leaq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	_ZdaPv@PLT
	movq	(%rsp), %rdi
	call	_ZdaPv@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3636:
	.size	_Z13vectorSumTestv, .-_Z13vectorSumTestv
	.globl	_Z31__device_stub__Z12gpu_loopTestvv
	.type	_Z31__device_stub__Z12gpu_loopTestvv, @function
_Z31__device_stub__Z12gpu_loopTestvv:
.LFB3666:
	.cfi_startproc
	endbr64
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	movabsq	$4294967297, %rax
	leaq	8(%rsp), %rcx
	movq	%rsp, %rdx
	leaq	28(%rsp), %rsi
	leaq	16(%rsp), %rdi
	movl	$1, 24(%rsp)
	movl	$1, 36(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 28(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	pushq	8(%rsp)
	.cfi_def_cfa_offset 104
	leaq	_Z12gpu_loopTestv(%rip), %rdi
	pushq	8(%rsp)
	.cfi_def_cfa_offset 112
	movq	44(%rsp), %rcx
	movl	52(%rsp), %r8d
	movq	32(%rsp), %rsi
	movl	40(%rsp), %edx
	leaq	80(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 104
	popq	%rdx
	.cfi_def_cfa_offset 96
.L41:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	addq	$88, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3666:
	.size	_Z31__device_stub__Z12gpu_loopTestvv, .-_Z31__device_stub__Z12gpu_loopTestvv
	.globl	_Z12gpu_loopTestv
	.type	_Z12gpu_loopTestv, @function
_Z12gpu_loopTestv:
.LFB3667:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z12gpu_loopTestvv
	.cfi_endproc
.LFE3667:
	.size	_Z12gpu_loopTestv, .-_Z12gpu_loopTestv
	.section	.rodata.str1.1
.LC9:
	.string	"CPU Loop test. "
.LC10:
	.string	"GPU Loop test. "
	.text
	.globl	_Z8loopTestv
	.type	_Z8loopTestv, @function
_Z8loopTestv:
.LFB3638:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC9(%rip), %rsi
	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
	movl	$1000, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	_ZSt4cout(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	xorl	%ebx, %ebx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %r15
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L47:
	movq	%r15, %rsi
	movl	$1, %edi
	leaq	40(%rsp), %r14
	call	clock_gettime@PLT
	movq	%r14, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movq	40(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax
	addq	48(%rsp), %rax
	subq	32(%rsp), %rax
	addq	%rax, %rbx
	decl	%r12d
	jne	.L47
	leaq	.LC1(%rip), %r13
	movq	%rbp, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	testq	%rbx, %rbx
	js	.L48
	cvtsi2sdq	%rbx, %xmm0
	jmp	.L49
.L48:
	movq	%rbx, %rax
	movq	%rbx, %rdx
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
.L49:
	divsd	.LC2(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	movl	$1000, %r12d
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000, %ecx
	xorl	%edx, %edx
	movq	%rax, %rdi
	movq	%rbx, %rax
	xorl	%ebx, %ebx
	divq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC10(%rip), %rsi
	movq	%rbp, %rdi
	movabsq	$4294967297, %rax
	movq	%rax, (%rsp)
	movl	$1, 8(%rsp)
	movq	%rax, 12(%rsp)
	movl	$1, 20(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L51:
	movq	%r15, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movl	8(%rsp), %ecx
	movq	(%rsp), %rdx
	xorl	%r9d, %r9d
	movq	12(%rsp), %rdi
	movl	20(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L50
	call	_Z31__device_stub__Z12gpu_loopTestvv
.L50:
	movq	%r14, %rsi
	movl	$1, %edi
	call	clock_gettime@PLT
	movq	40(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax
	addq	48(%rsp), %rax
	subq	32(%rsp), %rax
	addq	%rax, %rbx
	decl	%r12d
	jne	.L51
	movq	%rbp, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	testq	%rbx, %rbx
	js	.L52
	cvtsi2sdq	%rbx, %xmm0
	jmp	.L53
.L52:
	movq	%rbx, %rax
	movq	%rbx, %rdx
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
.L53:
	divsd	.LC2(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000, %ecx
	xorl	%edx, %edx
	movq	%rax, %rdi
	movq	%rbx, %rax
	divq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3638:
	.size	_Z8loopTestv, .-_Z8loopTestv
	.section	.rodata.str1.1
.LC11:
	.string	""
.LC12:
	.string	"CUDA test"
.LC13:
	.string	"Averages for "
.LC14:
	.string	" repetitions."
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3639:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3639
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC11(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rbx
	leaq	16(%rsp), %rbp
	movq	%rbx, %rdi
.LEHB0:
	call	_ZNSt6localeC1EPKc@PLT
.LEHE0:
	movq	%rbx, %rdx
	leaq	8+_ZSt4cout(%rip), %rsi
	movq	%rbp, %rdi
.LEHB1:
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE5imbueERKSt6locale@PLT
.LEHE1:
	movq	%rbp, %rdi
	call	_ZNSt6localeD1Ev@PLT
	movq	%rbx, %rdi
	leaq	_ZSt4cout(%rip), %rbx
	call	_ZNSt6localeD1Ev@PLT
	leaq	.LC12(%rip), %rsi
	movq	%rbx, %rdi
.LEHB2:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC13(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC14(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	call	_Z8loopTestv
	call	_Z13vectorSumTestv
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L61
	jmp	.L63
.L62:
	endbr64
	movq	%rax, %rbp
.L59:
	movq	%rbx, %rdi
	call	_ZNSt6localeD1Ev@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L63
	movq	%rbp, %rdi
	call	_Unwind_Resume@PLT
.LEHE2:
.L63:
	call	__stack_chk_fail@PLT
.L61:
	addq	$40, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3639:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3639:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3639-.LLSDACSB3639
.LLSDACSB3639:
	.uleb128 .LEHB0-.LFB3639
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3639
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L62-.LFB3639
	.uleb128 0
	.uleb128 .LEHB2-.LFB3639
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3639:
	.section	.text.startup
	.size	main, .-main
	.section	.rodata.str1.1
.LC15:
	.string	"_Z12gpu_loopTestv"
.LC16:
	.string	"_Z17kernel_vector_sumPfS_i"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3669:
	.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	.LC15(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z12gpu_loopTestv(%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	.LC16(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17kernel_vector_sumPfS_i(%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
.LFE3669:
	.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
.LC2:
	.long	-1577058304
	.long	1114446484
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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 <time.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>

#include <iostream>

// Required to include CUDA vector types
#include <hip/hip_runtime.h>
#include <hip/hip_vector_types.h>

#define REPETITIONS	1000

#define NS_PER_SECOND	1000000000L


#define VECTOR_SIZE	1000*1024
// CUDA kernel. Each thread takes care of one element of c
// From https://www.olcf.ornl.gov/tutorials/cuda-vector-addition
__global__ 
void kernel_vector_sum(float *dst, float *v, int n)
{
    // Get our global thread ID
    int id = blockIdx.x*blockDim.x+threadIdx.x;
 
    // Make sure we do not go out of bounds
    if (id < n)
        dst[id] += v[id];
}


void cpu_vector_sum(float *dst, float *v, int n)
{
  for (int i=0; i<n; i++) 
        dst[n] += v[n];
}


void vectorSumTest()
{
  struct timespec t0, t1; 
  uint64_t dt;
  float *dst_cpu = new float[VECTOR_SIZE];
  float *v_cpu = new float[VECTOR_SIZE];
  std::cout << "CPU Vector Sum test. ";
  dt = 0;
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    cpu_vector_sum(dst_cpu, v_cpu, VECTOR_SIZE);
    clock_gettime(CLOCK_MONOTONIC, &t1); 
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time: " << ((double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;

  float *dst_gpu;
  float *v_gpu;
  int numCudaThreads = 1;
  hipMalloc(&dst_gpu, VECTOR_SIZE*sizeof(float));
  hipMalloc(&v_gpu, VECTOR_SIZE*sizeof(float));
  dt = 0;
  int blockSize = 1024;
  int gridSize = (int)ceil((float)numCudaThreads/blockSize);
  std::cout << "GPU Vector Sum test. ";
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    kernel_vector_sum <<< gridSize, blockSize >>> (dst_gpu, v_gpu, VECTOR_SIZE);
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time for "<< numCudaThreads << " threads: " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;
  
  
  numCudaThreads = 64;
  dt = 0;
  blockSize = 1024;
  gridSize = (int)ceil((float)numCudaThreads/blockSize);
  std::cout << "GPU Vector Sum test. ";
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    kernel_vector_sum <<< gridSize, blockSize >>> (dst_gpu, v_gpu, VECTOR_SIZE);
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time for "<< numCudaThreads << " threads: " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;

  numCudaThreads = 128;
  dt = 0;
  blockSize = 1024;
  gridSize = (int)ceil((float)numCudaThreads/blockSize);
  std::cout << "GPU Vector Sum test. ";
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    kernel_vector_sum <<< gridSize, blockSize >>> (dst_gpu, v_gpu, VECTOR_SIZE);
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time for "<< numCudaThreads << " threads: " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;
  
  numCudaThreads = 128;
  dt = 0;
  blockSize = 1024;
  gridSize = (int)ceil((float)numCudaThreads/blockSize);
  std::cout << "GPU Vector Sum test. ";
  const int vsize = VECTOR_SIZE*sizeof(float);
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    hipMemcpy( dst_gpu, dst_cpu, vsize, hipMemcpyHostToDevice );
    hipMemcpy( v_gpu, v_cpu, vsize, hipMemcpyHostToDevice );   
    kernel_vector_sum <<< gridSize, blockSize >>> (dst_gpu, v_gpu, VECTOR_SIZE);
    hipMemcpy( dst_cpu, dst_gpu, vsize, hipMemcpyDeviceToHost );
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time for "<< numCudaThreads << " threads (with memcpy): " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;

  hipFree(&dst_gpu);
  hipFree(&v_gpu);
  delete[] v_cpu;
  delete[] dst_cpu;
  
}



#define LOOP_COUNT	10000000


__global__
void gpu_loopTest()
{
  long tmp=0;
  for (int i=0; i<LOOP_COUNT; i++) {
    tmp++;
  }
}

void cpu_loopTest()
{
  long tmp=0;
  for (int i=0; i<LOOP_COUNT; i++) {
    tmp++;
  }
}

// Loop
void loopTest()
{
  struct timespec t0, t1; 
  uint64_t dt;
  std::cout << "CPU Loop test. ";
  dt = 0;
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    cpu_loopTest();
    clock_gettime(CLOCK_MONOTONIC, &t1); 
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time: " << ((double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;

  dt = 0;
  dim3 dimBlock( 1, 1 );
  dim3 dimGrid( 1, 1 );
  std::cout << "GPU Loop test. ";
  for (int r=0; r<REPETITIONS; r++) 
  {
    clock_gettime(CLOCK_MONOTONIC, &t0); 
    gpu_loopTest <<< dimGrid, dimBlock >>> ();
    clock_gettime(CLOCK_MONOTONIC, &t1);     
    dt += NS_PER_SECOND * (t1.tv_sec - t0.tv_sec) + t1.tv_nsec - t0.tv_nsec;
  }
  std::cout << "Time: " << ( (double)dt/(double)(REPETITIONS*NS_PER_SECOND)) << " s (" << (dt/REPETITIONS) << " ns)" << std::endl;
}


int main() 
{
  std::cout.imbue( std::locale("") );
  std::cout << "CUDA test" << std::endl;
  std::cout << "Averages for " << REPETITIONS << " repetitions." << std::endl;
  
  loopTest();
  vectorSumTest();

  return 0;
}

	.text
	.file	"cudatest.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z32__device_stub__kernel_vector_sumPfS_i # -- Begin function _Z32__device_stub__kernel_vector_sumPfS_i
	.type	_Z32__device_stub__kernel_vector_sumPfS_i,@function
_Z32__device_stub__kernel_vector_sumPfS_i: # @_Z32__device_stub__kernel_vector_sumPfS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z17kernel_vector_sumPfS_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z32__device_stub__kernel_vector_sumPfS_i, .Lfunc_end0-_Z32__device_stub__kernel_vector_sumPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z14cpu_vector_sumPfS_i         # -- Begin function _Z14cpu_vector_sumPfS_i
	.type	_Z14cpu_vector_sumPfS_i,@function
_Z14cpu_vector_sumPfS_i:                # @_Z14cpu_vector_sumPfS_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB1_3
# %bb.1:                                # %.lr.ph
	movl	%edx, %eax
	movss	(%rdi,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
.LBB1_2:                                # =>This Inner Loop Header: Depth=1
	addss	(%rsi,%rax,4), %xmm0
	movss	%xmm0, (%rdi,%rax,4)
	decl	%edx
	jne	.LBB1_2
.LBB1_3:                                # %._crit_edge
	retq
.Lfunc_end1:
	.size	_Z14cpu_vector_sumPfS_i, .Lfunc_end1-_Z14cpu_vector_sumPfS_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z13vectorSumTestv
.LCPI2_0:
	.long	1127219200                      # 0x43300000
	.long	1160773632                      # 0x45300000
	.long	0                               # 0x0
	.long	0                               # 0x0
.LCPI2_1:
	.quad	0x4330000000000000              # double 4503599627370496
	.quad	0x4530000000000000              # double 1.9342813113834067E+25
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI2_2:
	.quad	0x426d1a94a2000000              # double 1.0E+12
	.text
	.globl	_Z13vectorSumTestv
	.type	_Z13vectorSumTestv,@function
_Z13vectorSumTestv:                     # @_Z13vectorSumTestv
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$4096000, %edi                  # imm = 0x3E8000
	callq	_Znam
	movq	%rax, %rbx
	movl	$4096000, %edi                  # imm = 0x3E8000
	callq	_Znam
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$1000, %ebp                     # imm = 0x3E8
	xorl	%r14d, %r14d
	leaq	24(%rsp), %r15
	leaq	8(%rsp), %r12
.LBB2_1:                                # %_Z14cpu_vector_sumPfS_i.exit
                                        # =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movq	%r15, %rsi
	callq	clock_gettime
	movl	$2143289344, 4096000(%rbx)      # imm = 0x7FC00000
	movl	$1, %edi
	movq	%r12, %rsi
	callq	clock_gettime
	movq	8(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax         # imm = 0x3B9ACA00
	addq	16(%rsp), %r14
	addq	%rax, %r14
	subq	32(%rsp), %r14
	decl	%ebp
	jne	.LBB2_1
# %bb.2:
	movabsq	$4294967297, %rbp               # imm = 0x100000001
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r14, %xmm1
	punpckldq	.LCPI2_0(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
	subpd	.LCPI2_1(%rip), %xmm1
	movapd	%xmm1, %xmm0
	unpckhpd	%xmm1, %xmm0                    # xmm0 = xmm0[1],xmm1[1]
	addsd	%xmm1, %xmm0
	divsd	.LCPI2_2(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r12
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	shrq	$3, %r14
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	movq	%r14, %rax
	mulq	%rcx
	shrq	$4, %rdx
	movq	%r12, %rdi
	movq	%rdx, %rsi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rsp, %rdi
	movl	$4096000, %esi                  # imm = 0x3E8000
	callq	hipMalloc
	leaq	40(%rsp), %rdi
	movl	$4096000, %esi                  # imm = 0x3E8000
	callq	hipMalloc
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$1000, %r15d                    # imm = 0x3E8
	xorl	%r13d, %r13d
	leaq	24(%rsp), %r14
	leaq	1023(%rbp), %r12
	leaq	8(%rsp), %rbp
.LBB2_3:                                # =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movq	%r14, %rsi
	callq	clock_gettime
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_5
# %bb.4:                                #   in Loop: Header=BB2_3 Depth=1
	movq	(%rsp), %rdi
	movq	40(%rsp), %rsi
	movl	$1024000, %edx                  # imm = 0xFA000
	callq	_Z32__device_stub__kernel_vector_sumPfS_i
.LBB2_5:                                #   in Loop: Header=BB2_3 Depth=1
	movl	$1, %edi
	movq	%rbp, %rsi
	callq	clock_gettime
	movq	8(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax         # imm = 0x3B9ACA00
	addq	16(%rsp), %r13
	addq	%rax, %r13
	subq	32(%rsp), %r13
	decl	%r15d
	jne	.LBB2_3
# %bb.6:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$1, %esi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.6, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r13, %xmm1
	punpckldq	.LCPI2_0(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
	subpd	.LCPI2_1(%rip), %xmm1
	movapd	%xmm1, %xmm0
	unpckhpd	%xmm1, %xmm0                    # xmm0 = xmm0[1],xmm1[1]
	addsd	%xmm1, %xmm0
	divsd	.LCPI2_2(%rip), %xmm0
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	shrq	$3, %r13
	movq	%r13, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	shrq	$4, %rdx
	movq	%r14, %rdi
	movq	%rdx, %rsi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$1000, %r15d                    # imm = 0x3E8
	xorl	%r13d, %r13d
	leaq	24(%rsp), %r14
	leaq	8(%rsp), %rbp
.LBB2_7:                                # =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movq	%r14, %rsi
	callq	clock_gettime
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_9
# %bb.8:                                #   in Loop: Header=BB2_7 Depth=1
	movq	(%rsp), %rdi
	movq	40(%rsp), %rsi
	movl	$1024000, %edx                  # imm = 0xFA000
	callq	_Z32__device_stub__kernel_vector_sumPfS_i
.LBB2_9:                                #   in Loop: Header=BB2_7 Depth=1
	movl	$1, %edi
	movq	%rbp, %rsi
	callq	clock_gettime
	movq	8(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax         # imm = 0x3B9ACA00
	addq	16(%rsp), %r13
	addq	%rax, %r13
	subq	32(%rsp), %r13
	decl	%r15d
	jne	.LBB2_7
# %bb.10:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$64, %esi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.6, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r13, %xmm1
	punpckldq	.LCPI2_0(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
	subpd	.LCPI2_1(%rip), %xmm1
	movapd	%xmm1, %xmm0
	unpckhpd	%xmm1, %xmm0                    # xmm0 = xmm0[1],xmm1[1]
	addsd	%xmm1, %xmm0
	divsd	.LCPI2_2(%rip), %xmm0
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	shrq	$3, %r13
	movq	%r13, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	shrq	$4, %rdx
	movq	%r14, %rdi
	movq	%rdx, %rsi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$1000, %r15d                    # imm = 0x3E8
	xorl	%r13d, %r13d
	leaq	24(%rsp), %r14
	leaq	8(%rsp), %rbp
.LBB2_11:                               # =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movq	%r14, %rsi
	callq	clock_gettime
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_13
# %bb.12:                               #   in Loop: Header=BB2_11 Depth=1
	movq	(%rsp), %rdi
	movq	40(%rsp), %rsi
	movl	$1024000, %edx                  # imm = 0xFA000
	callq	_Z32__device_stub__kernel_vector_sumPfS_i
.LBB2_13:                               #   in Loop: Header=BB2_11 Depth=1
	movl	$1, %edi
	movq	%rbp, %rsi
	callq	clock_gettime
	movq	8(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax         # imm = 0x3B9ACA00
	addq	16(%rsp), %r13
	addq	%rax, %r13
	subq	32(%rsp), %r13
	decl	%r15d
	jne	.LBB2_11
# %bb.14:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$128, %esi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.6, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r13, %xmm1
	punpckldq	.LCPI2_0(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
	subpd	.LCPI2_1(%rip), %xmm1
	movapd	%xmm1, %xmm0
	unpckhpd	%xmm1, %xmm0                    # xmm0 = xmm0[1],xmm1[1]
	addsd	%xmm1, %xmm0
	divsd	.LCPI2_2(%rip), %xmm0
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	shrq	$3, %r13
	movq	%r13, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	shrq	$4, %rdx
	movq	%r14, %rdi
	movq	%rdx, %rsi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$1000, %r15d                    # imm = 0x3E8
	xorl	%r13d, %r13d
	leaq	24(%rsp), %rbp
	leaq	8(%rsp), %r14
.LBB2_15:                               # =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movq	%rbp, %rsi
	callq	clock_gettime
	movq	(%rsp), %rdi
	movl	$4096000, %edx                  # imm = 0x3E8000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	40(%rsp), %rdi
	movl	$4096000, %edx                  # imm = 0x3E8000
	movq	48(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_17
# %bb.16:                               #   in Loop: Header=BB2_15 Depth=1
	movq	(%rsp), %rdi
	movq	40(%rsp), %rsi
	movl	$1024000, %edx                  # imm = 0xFA000
	callq	_Z32__device_stub__kernel_vector_sumPfS_i
.LBB2_17:                               #   in Loop: Header=BB2_15 Depth=1
	movq	(%rsp), %rsi
	movl	$4096000, %edx                  # imm = 0x3E8000
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$1, %edi
	movq	%r14, %rsi
	callq	clock_gettime
	movq	8(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax         # imm = 0x3B9ACA00
	addq	16(%rsp), %r13
	addq	%rax, %r13
	subq	32(%rsp), %r13
	decl	%r15d
	jne	.LBB2_15
# %bb.18:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$128, %esi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.7, %esi
	movl	$24, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r13, %xmm1
	punpckldq	.LCPI2_0(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
	subpd	.LCPI2_1(%rip), %xmm1
	movapd	%xmm1, %xmm0
	unpckhpd	%xmm1, %xmm0                    # xmm0 = xmm0[1],xmm1[1]
	addsd	%xmm1, %xmm0
	divsd	.LCPI2_2(%rip), %xmm0
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	shrq	$3, %r13
	movq	%r13, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	shrq	$4, %rdx
	movq	%r14, %rdi
	movq	%rdx, %rsi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rsp, %rdi
	callq	hipFree
	leaq	40(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi                  # 8-byte Reload
	callq	_ZdaPv
	movq	%rbx, %rdi
	callq	_ZdaPv
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z13vectorSumTestv, .Lfunc_end2-_Z13vectorSumTestv
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__gpu_loopTestv # -- Begin function _Z27__device_stub__gpu_loopTestv
	.type	_Z27__device_stub__gpu_loopTestv,@function
_Z27__device_stub__gpu_loopTestv:       # @_Z27__device_stub__gpu_loopTestv
	.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	$56, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rbx
	leaq	24(%rsp), %r14
	leaq	16(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%r12, %rcx
	callq	__hipPopCallConfiguration
	movq	(%rbx), %rsi
	movl	8(%rbx), %edx
	movq	(%r14), %rcx
	movl	8(%r14), %r8d
	movq	%rsp, %r9
	movl	$_Z12gpu_loopTestv, %edi
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	pushq	(%r15)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$72, %rsp
	.cfi_adjust_cfa_offset -72
	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_end3:
	.size	_Z27__device_stub__gpu_loopTestv, .Lfunc_end3-_Z27__device_stub__gpu_loopTestv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12cpu_loopTestv               # -- Begin function _Z12cpu_loopTestv
	.type	_Z12cpu_loopTestv,@function
_Z12cpu_loopTestv:                      # @_Z12cpu_loopTestv
	.cfi_startproc
# %bb.0:
	retq
.Lfunc_end4:
	.size	_Z12cpu_loopTestv, .Lfunc_end4-_Z12cpu_loopTestv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z8loopTestv
.LCPI5_0:
	.long	1127219200                      # 0x43300000
	.long	1160773632                      # 0x45300000
	.long	0                               # 0x0
	.long	0                               # 0x0
.LCPI5_1:
	.quad	0x4330000000000000              # double 4503599627370496
	.quad	0x4530000000000000              # double 1.9342813113834067E+25
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI5_2:
	.quad	0x426d1a94a2000000              # double 1.0E+12
	.text
	.globl	_Z8loopTestv
	.type	_Z8loopTestv,@function
_Z8loopTestv:                           # @_Z8loopTestv
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$1000, %ebp                     # imm = 0x3E8
	xorl	%r14d, %r14d
	leaq	24(%rsp), %rbx
	leaq	8(%rsp), %r15
.LBB5_1:                                # =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movq	%rbx, %rsi
	callq	clock_gettime
	movl	$1, %edi
	movq	%r15, %rsi
	callq	clock_gettime
	movq	8(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax         # imm = 0x3B9ACA00
	addq	16(%rsp), %r14
	addq	%rax, %r14
	subq	32(%rsp), %r14
	decl	%ebp
	jne	.LBB5_1
# %bb.2:
	movabsq	$4294967297, %rbx               # imm = 0x100000001
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r14, %xmm1
	punpckldq	.LCPI5_0(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
	subpd	.LCPI5_1(%rip), %xmm1
	movapd	%xmm1, %xmm0
	unpckhpd	%xmm1, %xmm0                    # xmm0 = xmm0[1],xmm1[1]
	addsd	%xmm1, %xmm0
	divsd	.LCPI5_2(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	shrq	$3, %r14
	movabsq	$2361183241434822607, %r13      # imm = 0x20C49BA5E353F7CF
	movq	%r14, %rax
	mulq	%r13
	shrq	$4, %rdx
	movq	%r15, %rdi
	movq	%rdx, %rsi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$1000, %ebp                     # imm = 0x3E8
	xorl	%r14d, %r14d
	leaq	24(%rsp), %r15
	leaq	8(%rsp), %r12
.LBB5_3:                                # =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movq	%r15, %rsi
	callq	clock_gettime
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_5
# %bb.4:                                #   in Loop: Header=BB5_3 Depth=1
	callq	_Z27__device_stub__gpu_loopTestv
.LBB5_5:                                #   in Loop: Header=BB5_3 Depth=1
	movl	$1, %edi
	movq	%r12, %rsi
	callq	clock_gettime
	movq	8(%rsp), %rax
	subq	24(%rsp), %rax
	imulq	$1000000000, %rax, %rax         # imm = 0x3B9ACA00
	addq	16(%rsp), %r14
	addq	%rax, %r14
	subq	32(%rsp), %r14
	decl	%ebp
	jne	.LBB5_3
# %bb.6:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r14, %xmm1
	punpckldq	.LCPI5_0(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
	subpd	.LCPI5_1(%rip), %xmm1
	movapd	%xmm1, %xmm0
	unpckhpd	%xmm1, %xmm0                    # xmm0 = xmm0[1],xmm1[1]
	addsd	%xmm1, %xmm0
	divsd	.LCPI5_2(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	shrq	$3, %r14
	movq	%r14, %rax
	mulq	%r13
	shrq	$4, %rdx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.3, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z8loopTestv, .Lfunc_end5-_Z8loopTestv
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %r15d
	movq	-24(%rax), %rbx
	addq	%r15, %rbx
	movq	%rsp, %r14
	movl	$.L.str.10, %esi
	movq	%r14, %rdi
	callq	_ZNSt6localeC1EPKc
.Ltmp0:
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5imbueERKSt6locale
.Ltmp1:
# %bb.1:
	leaq	8(%rsp), %rdi
	callq	_ZNSt6localeD1Ev
	movq	%rsp, %rdi
	callq	_ZNSt6localeD1Ev
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$1000, %esi                     # imm = 0x3E8
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movl	$.L.str.13, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	callq	_Z8loopTestv
	callq	_Z13vectorSumTestv
	xorl	%eax, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB6_2:
	.cfi_def_cfa_offset 48
.Ltmp2:
	movq	%rax, %rbx
	movq	%rsp, %rdi
	callq	_ZNSt6localeD1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table6:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp1-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Lfunc_end6-.Ltmp1             #   Call between .Ltmp1 and .Lfunc_end6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.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	.LBB7_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB7_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17kernel_vector_sumPfS_i, %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	$_Z12gpu_loopTestv, %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_end7:
	.size	__hip_module_ctor, .Lfunc_end7-__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	.LBB8_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
.LBB8_2:
	retq
.Lfunc_end8:
	.size	__hip_module_dtor, .Lfunc_end8-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z17kernel_vector_sumPfS_i,@object # @_Z17kernel_vector_sumPfS_i
	.section	.rodata,"a",@progbits
	.globl	_Z17kernel_vector_sumPfS_i
	.p2align	3, 0x0
_Z17kernel_vector_sumPfS_i:
	.quad	_Z32__device_stub__kernel_vector_sumPfS_i
	.size	_Z17kernel_vector_sumPfS_i, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"CPU Vector Sum test. "
	.size	.L.str, 22

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Time: "
	.size	.L.str.1, 7

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	" s ("
	.size	.L.str.2, 5

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	" ns)"
	.size	.L.str.3, 5

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"GPU Vector Sum test. "
	.size	.L.str.4, 22

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Time for "
	.size	.L.str.5, 10

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	" threads: "
	.size	.L.str.6, 11

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	" threads (with memcpy): "
	.size	.L.str.7, 25

	.type	_Z12gpu_loopTestv,@object       # @_Z12gpu_loopTestv
	.section	.rodata,"a",@progbits
	.globl	_Z12gpu_loopTestv
	.p2align	3, 0x0
_Z12gpu_loopTestv:
	.quad	_Z27__device_stub__gpu_loopTestv
	.size	_Z12gpu_loopTestv, 8

	.type	.L.str.8,@object                # @.str.8
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.8:
	.asciz	"CPU Loop test. "
	.size	.L.str.8, 16

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"GPU Loop test. "
	.size	.L.str.9, 16

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.zero	1
	.size	.L.str.10, 1

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"CUDA test"
	.size	.L.str.11, 10

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Averages for "
	.size	.L.str.12, 14

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	" repetitions."
	.size	.L.str.13, 14

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z17kernel_vector_sumPfS_i"
	.size	.L__unnamed_1, 27

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z12gpu_loopTestv"
	.size	.L__unnamed_2, 18

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

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.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 _Z32__device_stub__kernel_vector_sumPfS_i
	.addrsig_sym _Z27__device_stub__gpu_loopTestv
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z17kernel_vector_sumPfS_i
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z12gpu_loopTestv
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z17kernel_vector_sumPfS_i ; -- Begin function _Z17kernel_vector_sumPfS_i
	.globl	_Z17kernel_vector_sumPfS_i
	.p2align	8
	.type	_Z17kernel_vector_sumPfS_i,@function
_Z17kernel_vector_sumPfS_i:             ; @_Z17kernel_vector_sumPfS_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x10
	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_i32_e64 s3, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s2, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s3, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_load_b32 v2, v[2:3], off
	global_load_b32 v3, v[0:1], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v2, v2, v3
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17kernel_vector_sumPfS_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.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 4
		.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	_Z17kernel_vector_sumPfS_i, .Lfunc_end0-_Z17kernel_vector_sumPfS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 160
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; 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	_Z12gpu_loopTestv       ; -- Begin function _Z12gpu_loopTestv
	.globl	_Z12gpu_loopTestv
	.p2align	8
	.type	_Z12gpu_loopTestv,@function
_Z12gpu_loopTestv:                      ; @_Z12gpu_loopTestv
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12gpu_loopTestv
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 0
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 0
		.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	_Z12gpu_loopTestv, .Lfunc_end1-_Z12gpu_loopTestv
                                        ; -- 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:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17kernel_vector_sumPfS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17kernel_vector_sumPfS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:           []
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 4
    .kernarg_segment_size: 0
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z12gpu_loopTestv
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z12gpu_loopTestv.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
