
#include <cstdio>
#include <cstdlib>

#define DTYPE unsigned long long
#define ull unsigned long long

/*** CUDA API error checking  ***/
#define cudaErrChk(ans) { cudaAssert((ans), __FILE__, __LINE__); }
inline void cudaAssert(cudaError_t code, const char *file, int line, bool abort=true)
{
   if (code != cudaSuccess) 
   {
      fprintf(stderr,"CUDA assert: %s %s %d\n", cudaGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}


/****************************************************************
  *** Kernel mode : 4
  *** Blocked shared half unrolled reduction
  ****************************************************************/

/*** Kernel program ***/
template <size_t blockSize>
__global__ void reduction_blocked_shared_half_unrolled (DTYPE* d_data, DTYPE* d_out, ull remain) {
    ull tidx = threadIdx.x;
    ull idx = blockIdx.x * (2*blockSize) + threadIdx.x;
    extern __shared__ DTYPE smem[];

    if (idx < remain) {
        if (idx+blockSize<remain)
            smem[tidx] = d_data[idx]+d_data[idx+blockSize];
        else
            smem[tidx] = d_data[idx];
    }
    __syncthreads();

    #pragma unroll
    for (ull s=blockSize>>1; s>0; s>>=1) {
        if (tidx<s && idx+s<remain) {
            smem[tidx]+=smem[tidx+s];
        }
        __syncthreads();
    }


    if (tidx == 0) {
        d_out[blockIdx.x] = smem[tidx];
    }
}



/*** Host program ***/
void run_kernel_blocked_shared_half_unrolled (DTYPE* d_data, const ull num_data) {

    DTYPE* d_out;
    cudaErrChk (cudaMalloc ((void**)&d_out, sizeof(DTYPE)*num_data));
    ull remain=num_data, next=0;

    dim3 threads (128);
    const size_t size_smem = sizeof (DTYPE) * threads.x;
    while (remain > 1) {
        if (remain%threads.x==0)
            next = remain/(2*threads.x);
        else
            next = remain/(2*threads.x)+1;


        dim3 blocks ((remain+(2*threads.x)-1)/(2*threads.x));
        reduction_blocked_shared_half_unrolled<128><<<blocks, threads, size_smem>>> (d_data, d_out, remain);
        cudaErrChk (cudaMemcpy (d_data, d_out, next*sizeof(DTYPE), cudaMemcpyDeviceToDevice));
        cudaErrChk (cudaDeviceSynchronize ())
        cudaErrChk (cudaGetLastError() );
        
        remain = next;
    } 

    cudaErrChk (cudaFree (d_out));
 
}






/****************************************************************
  *** Kernel mode : 3
  *** Blocked shared half reduction
  ****************************************************************/

/*** Kernel program ***/
__global__ void reduction_blocked_shared_half (DTYPE* d_data, DTYPE* d_out, ull remain) {
    ull tidx = threadIdx.x;
    ull idx = blockIdx.x * (2*blockDim.x) + threadIdx.x;
    extern __shared__ DTYPE smem[];

    if (idx < remain) {
        if (idx+blockDim.x<remain)
            smem[tidx] = d_data[idx]+d_data[idx+blockDim.x];
        else
            smem[tidx] = d_data[idx];
    }
    __syncthreads();

    for (ull s=blockDim.x>>1; s>0; s>>=1) {
        if (tidx<s && idx+s<remain) {
            smem[tidx]+=smem[tidx+s];
        }
        __syncthreads();
    }
    
    if (tidx == 0) {
        d_out[blockIdx.x] = smem[tidx];
    }
}



/*** Host program ***/
void run_kernel_blocked_shared_half (DTYPE* d_data, const ull num_data) {

    DTYPE* d_out;
    cudaErrChk (cudaMalloc ((void**)&d_out, sizeof(DTYPE)*num_data));
    ull remain=num_data, next=0;

    dim3 threads (128);
    const size_t size_smem = sizeof (DTYPE) * threads.x;
    while (remain > 1) {
        if (remain%threads.x==0)
            next = remain/(2*threads.x);
        else
            next = remain/(2*threads.x)+1;


        dim3 blocks ((remain+(2*threads.x)-1)/(2*threads.x));
        reduction_blocked_shared_half<<<blocks, threads, size_smem>>> (d_data, d_out, remain);
        cudaErrChk (cudaMemcpy (d_data, d_out, next*sizeof(DTYPE), cudaMemcpyDeviceToDevice));
        cudaErrChk (cudaDeviceSynchronize ())
        cudaErrChk (cudaGetLastError() );
        
        remain = next;
    } 

    cudaErrChk (cudaFree (d_out));
 
}






/****************************************************************
  *** Kernel mode : 2
  *** Blocked shared reduction
  ****************************************************************/

/*** Kernel program ***/
__global__ void reduction_blocked_shared (DTYPE* d_data, DTYPE* d_out, ull remain) {
    ull tidx = threadIdx.x;
    ull idx = blockIdx.x * blockDim.x + threadIdx.x;
    extern __shared__ DTYPE smem[];

    if (idx < remain) {
        smem[tidx] = d_data[idx];
    }
    __syncthreads();

    for (ull s=blockDim.x>>1; s>0; s>>=1) {
        if (tidx<s && idx+s<remain) {
            smem[tidx]+=smem[tidx+s];
        }
        __syncthreads();
    }
    
    if (tidx == 0) {
        d_out[blockIdx.x] = smem[tidx];
    }
}



/*** Host program ***/
void run_kernel_blocked_shared (DTYPE* d_data, const ull num_data) {

    DTYPE* d_out;
    cudaErrChk (cudaMalloc ((void**)&d_out, sizeof(DTYPE)*num_data));
    ull remain=num_data, next=0;

    dim3 threads (128);
    const size_t size_smem = sizeof (DTYPE) * threads.x;
    while (remain > 1) {
        if (remain%threads.x==0)
            next = remain/threads.x;
        else
            next = remain/threads.x+1;


        dim3 blocks ((remain+threads.x-1)/threads.x);
        reduction_blocked_shared<<<blocks, threads, size_smem>>> (d_data, d_out, remain);
        cudaErrChk (cudaMemcpy (d_data, d_out, next*sizeof(DTYPE), cudaMemcpyDeviceToDevice));
        cudaErrChk (cudaDeviceSynchronize ())
        cudaErrChk (cudaGetLastError() );
        
        remain = next;
    } 

    cudaErrChk (cudaFree (d_out));
 
}




/****************************************************************
  *** Kernel mode : 1
  *** Blocked reduction
  ****************************************************************/

/*** Kernel program ***/
__global__ void reduction_blocked (DTYPE* d_data, DTYPE* d_out, ull remain) {
    ull tidx = threadIdx.x;
    ull idx = blockIdx.x * blockDim.x + threadIdx.x;

    for (ull s=blockDim.x>>1; s>0; s>>=1) {
        if (tidx<s && idx+s < remain) {
            d_data[idx]+=d_data[idx+s];
        }
        __syncthreads();
    }
    
    if (tidx == 0) {
        d_out[blockIdx.x] = d_data[idx];
    }
}


/*** Host program ***/
void run_kernel_blocked (DTYPE* d_data, const ull num_data) {

    DTYPE* d_out;
    cudaErrChk (cudaMalloc ((void**)&d_out, sizeof(DTYPE)*num_data));
    ull remain=num_data, next=0;

    dim3 threads (128);
    while (remain > 1) {
        if (remain%threads.x==0)
            next = remain/threads.x;
        else
            next = remain/threads.x+1;


        dim3 blocks ((remain+threads.x-1)/threads.x);
        reduction_blocked<<<blocks, threads>>> (d_data, d_out, remain);
        cudaErrChk (cudaMemcpy (d_data, d_out, next*sizeof(DTYPE), cudaMemcpyDeviceToDevice));
        cudaErrChk (cudaDeviceSynchronize ())
        cudaErrChk (cudaGetLastError() );
        
        remain = next;
    } 

    cudaErrChk (cudaFree (d_out));
 
}




/****************************************************************
  *** Kernel mode : 0
  *** Basic reduction
  ****************************************************************/

/*** Kernel program ***/
__global__ void reduction (DTYPE* d_data, ull remain, ull next) {
    ull idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (idx + next < remain) {
        d_data[idx] += d_data[idx+next];
    }
}


/*** Host program ***/
void run_kernel_basic (DTYPE* d_data, const ull num_data) {

    ull remain=num_data, next=0;
    dim3 threads (128);

    while (remain > 1) {
        if (remain%2==0)
            next = remain/2;
        else
            next = remain/2 +1;

        dim3 blocks ((next+threads.x-1)/threads.x);
        reduction<<<blocks, threads>>> (d_data, remain, next);
        cudaErrChk (cudaDeviceSynchronize ())
        cudaErrChk (cudaGetLastError() );
        remain = next;
    }
}





/****************************************************************
  *** Host program
  ****************************************************************/

DTYPE initial_data (DTYPE* data, const ull num_data) {
    DTYPE sum = 0;
    for (ull i=0; i<num_data; i++) {
        data[i] = rand()%5;
        sum += data[i];
    }
    return sum;
}

int select_mode(const int argc, const char** argv) {

    int mode = 0;
    if (argc > 1)
        mode = atoi(argv[1]);

    switch (mode) {
        case 0:
            printf("Kernel mode : 0.Basic reduction\n");
            break;
        case 1:
            printf("Kernel mode : 1.Blocked reduction\n");
            break;
        case 2:
            printf("Kernel mode : 2.Blocked shared reduction\n");
            break;
        case 3:
            printf("Kernel mode : 3.Blocked shared half reduction\n");
            break;
        case 4:
            printf("Kernel mode : 4.Blocked shared half unrolled reduction\n");
            break;


        default:
            printf("Selected not implemented mode...\n");
            exit(1);
            break;
    }
    return mode;
}


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

    /*** Program Configuration ***/
    const ull num_data = 4*1e+8;
    const int loop_exe = 4;
    const size_t size_data = sizeof (ull) * num_data;

    printf("\n\n=======================================================================\n");
    printf("== Parallel DTYPE reduction\n");
    printf("=======================================================================\n");
    const int mode_kernel = select_mode(argc, argv);
    printf("Number of DTYPE : %llu\n", num_data);
    printf("    size of mem : %.2f GB\n", size_data*1e-9);


    /*** Initialize variables ***/
    DTYPE* data = (DTYPE*) malloc (size_data);
    const DTYPE sum = initial_data (data, num_data);
    float gops = 1e-9*num_data*loop_exe;
    cudaEvent_t start, stop;
    float msec_total=0.0f, msec=0.0f;
    cudaErrChk (cudaEventCreate(&start));
    cudaErrChk (cudaEventCreate(&stop));


    /*** Set CUDA Memory ***/
    DTYPE* d_data;
    cudaErrChk (cudaMalloc ((void**)&d_data, size_data));
    cudaErrChk (cudaMemcpy (d_data, data, size_data, cudaMemcpyHostToDevice));
    cudaErrChk (cudaDeviceSynchronize ());


    /*** Run kernel ***/
    for (int loop=0; loop<loop_exe; loop++) {
        cudaErrChk (cudaMemcpy (d_data, data, size_data, cudaMemcpyHostToDevice));
        cudaErrChk (cudaEventRecord(start, NULL));
        switch (mode_kernel) {
            case 0:
                run_kernel_basic (d_data, num_data);
                break;
            case 1:
                run_kernel_blocked (d_data, num_data);
                break;
            case 2:
                run_kernel_blocked_shared (d_data, num_data);
                break;
            case 3:
                run_kernel_blocked_shared_half (d_data, num_data);
                break;
            case 4:
                run_kernel_blocked_shared_half_unrolled (d_data, num_data);
                break;
            default:
                printf("Not implemented\n");
                exit(1);
                break;
        }
        cudaErrChk (cudaEventRecord(stop, NULL));
        cudaErrChk (cudaEventSynchronize(stop));
        cudaErrChk (cudaEventElapsedTime(&msec, start, stop));
        msec_total += msec;
    }

    /*** Check result ***/
    DTYPE result;
    cudaErrChk (cudaMemcpy (&result, d_data, sizeof (DTYPE), cudaMemcpyDeviceToHost));

    printf("    Total number of add inst. : %.2f Gops\n", gops);
    printf("    Elaped time: %.4f msec\n", msec_total);
    printf("    GFLOPS : %.4f gflops [Avg. of %d time(s)]\n", gops/(msec_total*1e-3), loop_exe); 


    printf("Check result ...\n");
    if (sum != result) {
        printf("    [Err] GT(%llu) != Pred(%llu)\n", sum, result);
    } else {
        printf("    [Pass] GT(%llu) == Pred(%llu)\n", sum, result);
    }
    printf("=======================================================================\n\n");

    /*** Finalize program ***/
    cudaErrChk (cudaFree (d_data));    
    free (data);

    return 0;
}

	.file	"tmpxft_0031555b_00000000-6_reduction.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2040:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2040:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_ZL71__device_stub__Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_yPyS_y, @function
_ZL71__device_stub__Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_yPyS_y:
.LFB2062:
	.cfi_startproc
	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
	movq	%rdx, 8(%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	8(%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	.L2
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y(%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
.L2:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2062:
	.size	_ZL71__device_stub__Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_yPyS_y, .-_ZL71__device_stub__Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_yPyS_y
	.section	.text._Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,"axG",@progbits,_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,comdat
	.weak	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.type	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y, @function
_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y:
.LFB2119:
	.cfi_startproc
	endbr64
	jmp	_ZL71__device_stub__Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_yPyS_y
	.cfi_endproc
.LFE2119:
	.size	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y, .-_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.section	.rodata._Z10cudaAssert9cudaErrorPKcib.str1.1,"aMS",@progbits,1
.LC0:
	.string	"CUDA assert: %s %s %d\n"
	.section	.text._Z10cudaAssert9cudaErrorPKcib,"axG",@progbits,_Z10cudaAssert9cudaErrorPKcib,comdat
	.weak	_Z10cudaAssert9cudaErrorPKcib
	.type	_Z10cudaAssert9cudaErrorPKcib, @function
_Z10cudaAssert9cudaErrorPKcib:
.LFB2027:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L14
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edx, 12(%rsp)
	movq	%rsi, (%rsp)
	call	cudaGetErrorString@PLT
	movl	12(%rsp), %r9d
	movq	(%rsp), %r8
	leaq	.LC0(%rip), %rdx
	movq	stderr(%rip), %rdi
	movq	%rax, %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	testb	%bpl, %bpl
	je	.L8
	movl	%ebx, %edi
	call	exit@PLT
.L8:
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z10cudaAssert9cudaErrorPKcib, .-_Z10cudaAssert9cudaErrorPKcib
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/jhson989/cuda_study/main/basic/reduction/reduction.cu"
	.text
	.globl	_Z39run_kernel_blocked_shared_half_unrolledPyy
	.type	_Z39run_kernel_blocked_shared_half_unrolledPyy, @function
_Z39run_kernel_blocked_shared_half_unrolledPyy:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movabsq	$4294967297, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rsi, %rbx
	salq	$3, %rsi
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$60, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	%r14, 20(%rsp)
.L18:
	cmpq	$1, %rbx
	jbe	.L26
	movq	%rbx, %rax
	movq	%rbx, %r13
	movq	%r14, 32(%rsp)
	movl	24(%rsp), %ecx
	andl	$127, %eax
	shrq	$8, %r13
	movl	36(%rsp), %esi
	movl	$128, 16(%rsp)
	cmpq	$1, %rax
	leaq	255(%rbx), %rax
	movq	16(%rsp), %rdx
	movl	$1024, %r8d
	sbbq	$-1, %r13
	shrq	$8, %rax
	xorl	%r9d, %r9d
	movl	%eax, 28(%rsp)
	movq	28(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L20
	movq	8(%rsp), %rsi
	movq	%rbx, %rdx
	movq	%r12, %rdi
	call	_ZL71__device_stub__Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_yPyS_y
.L20:
	movq	8(%rsp), %rsi
	movl	$3, %ecx
	movq	%r12, %rdi
	movq	%r13, %rbx
	leaq	0(,%r13,8), %rdx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$74, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaDeviceSynchronize@PLT
	movl	$1, %ecx
	movl	$75, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaGetLastError@PLT
	movl	$1, %ecx
	movl	$76, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	jmp	.L18
.L26:
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movl	$1, %ecx
	movl	$81, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z39run_kernel_blocked_shared_half_unrolledPyy, .-_Z39run_kernel_blocked_shared_half_unrolledPyy
	.globl	_Z12initial_dataPyy
	.type	_Z12initial_dataPyy, @function
_Z12initial_dataPyy:
.LFB2035:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	$5, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
.L28:
	cmpq	%r12, %rbx
	je	.L31
	call	rand@PLT
	cltd
	idivl	%r13d
	movslq	%edx, %rdx
	movq	%rdx, (%r14,%rbx,8)
	addq	%rdx, %rbp
	incq	%rbx
	jmp	.L28
.L31:
	popq	%rbx
	.cfi_def_cfa_offset 40
	movq	%rbp, %rax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2035:
	.size	_Z12initial_dataPyy, .-_Z12initial_dataPyy
	.section	.rodata.str1.1
.LC2:
	.string	"Kernel mode : 0.Basic reduction\n"
.LC3:
	.string	"Kernel mode : 1.Blocked reduction\n"
.LC4:
	.string	"Kernel mode : 2.Blocked shared reduction\n"
.LC5:
	.string	"Kernel mode : 3.Blocked shared half reduction\n"
.LC6:
	.string	"Kernel mode : 4.Blocked shared half unrolled reduction\n"
.LC7:
	.string	"Selected not implemented mode...\n"
	.text
	.globl	_Z11select_modeiPPKc
	.type	_Z11select_modeiPPKc, @function
_Z11select_modeiPPKc:
.LFB2036:
	.cfi_startproc
	endbr64
	decl	%edi
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	jle	.L33
	movq	8(%rsi), %rdi
	call	atoi@PLT
	movl	%eax, %ebx
	cmpl	$4, %eax
	ja	.L34
	leaq	.L36(%rip), %rdx
	movl	%eax, %eax
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L36:
	.long	.L33-.L36
	.long	.L39-.L36
	.long	.L38-.L36
	.long	.L37-.L36
	.long	.L35-.L36
	.text
.L33:
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
	jmp	.L32
.L39:
	leaq	.LC3(%rip), %rsi
	jmp	.L42
.L38:
	leaq	.LC4(%rip), %rsi
	jmp	.L42
.L37:
	leaq	.LC5(%rip), %rsi
	jmp	.L42
.L35:
	leaq	.LC6(%rip), %rsi
.L42:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L32
.L34:
	movl	$2, %edi
	leaq	.LC7(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L32:
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z11select_modeiPPKc, .-_Z11select_modeiPPKc
	.globl	_Z52__device_stub__Z29reduction_blocked_shared_halfPyS_yPyS_y
	.type	_Z52__device_stub__Z29reduction_blocked_shared_halfPyS_yPyS_y, @function
_Z52__device_stub__Z29reduction_blocked_shared_halfPyS_yPyS_y:
.LFB2064:
	.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
	movq	%rdx, 8(%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	8(%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	.L43
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z29reduction_blocked_shared_halfPyS_y(%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
.L43:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2064:
	.size	_Z52__device_stub__Z29reduction_blocked_shared_halfPyS_yPyS_y, .-_Z52__device_stub__Z29reduction_blocked_shared_halfPyS_yPyS_y
	.globl	_Z29reduction_blocked_shared_halfPyS_y
	.type	_Z29reduction_blocked_shared_halfPyS_y, @function
_Z29reduction_blocked_shared_halfPyS_y:
.LFB2065:
	.cfi_startproc
	endbr64
	jmp	_Z52__device_stub__Z29reduction_blocked_shared_halfPyS_yPyS_y
	.cfi_endproc
.LFE2065:
	.size	_Z29reduction_blocked_shared_halfPyS_y, .-_Z29reduction_blocked_shared_halfPyS_y
	.globl	_Z30run_kernel_blocked_shared_halfPyy
	.type	_Z30run_kernel_blocked_shared_halfPyy, @function
_Z30run_kernel_blocked_shared_halfPyy:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movabsq	$4294967297, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rsi, %rbx
	salq	$3, %rsi
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$127, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	%r14, 20(%rsp)
.L49:
	cmpq	$1, %rbx
	jbe	.L57
	movq	%rbx, %rax
	movq	%rbx, %r13
	movq	%r14, 32(%rsp)
	movl	24(%rsp), %ecx
	andl	$127, %eax
	shrq	$8, %r13
	movl	36(%rsp), %esi
	movl	$128, 16(%rsp)
	cmpq	$1, %rax
	leaq	255(%rbx), %rax
	movq	16(%rsp), %rdx
	movl	$1024, %r8d
	sbbq	$-1, %r13
	shrq	$8, %rax
	xorl	%r9d, %r9d
	movl	%eax, 28(%rsp)
	movq	28(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L51
	movq	8(%rsp), %rsi
	movq	%rbx, %rdx
	movq	%r12, %rdi
	call	_Z52__device_stub__Z29reduction_blocked_shared_halfPyS_yPyS_y
.L51:
	movq	8(%rsp), %rsi
	movl	$3, %ecx
	movq	%r12, %rdi
	movq	%r13, %rbx
	leaq	0(,%r13,8), %rdx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$141, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaDeviceSynchronize@PLT
	movl	$1, %ecx
	movl	$142, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaGetLastError@PLT
	movl	$1, %ecx
	movl	$143, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	jmp	.L49
.L57:
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movl	$1, %ecx
	movl	$148, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L53
	call	__stack_chk_fail@PLT
.L53:
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z30run_kernel_blocked_shared_halfPyy, .-_Z30run_kernel_blocked_shared_halfPyy
	.globl	_Z47__device_stub__Z24reduction_blocked_sharedPyS_yPyS_y
	.type	_Z47__device_stub__Z24reduction_blocked_sharedPyS_yPyS_y, @function
_Z47__device_stub__Z24reduction_blocked_sharedPyS_yPyS_y:
.LFB2066:
	.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
	movq	%rdx, 8(%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	8(%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	.L58
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z24reduction_blocked_sharedPyS_y(%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
.L58:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L60
	call	__stack_chk_fail@PLT
.L60:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2066:
	.size	_Z47__device_stub__Z24reduction_blocked_sharedPyS_yPyS_y, .-_Z47__device_stub__Z24reduction_blocked_sharedPyS_yPyS_y
	.globl	_Z24reduction_blocked_sharedPyS_y
	.type	_Z24reduction_blocked_sharedPyS_y, @function
_Z24reduction_blocked_sharedPyS_y:
.LFB2067:
	.cfi_startproc
	endbr64
	jmp	_Z47__device_stub__Z24reduction_blocked_sharedPyS_yPyS_y
	.cfi_endproc
.LFE2067:
	.size	_Z24reduction_blocked_sharedPyS_y, .-_Z24reduction_blocked_sharedPyS_y
	.globl	_Z25run_kernel_blocked_sharedPyy
	.type	_Z25run_kernel_blocked_sharedPyy, @function
_Z25run_kernel_blocked_sharedPyy:
.LFB2032:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movabsq	$4294967297, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rsi, %rbx
	salq	$3, %rsi
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$191, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	%r14, 20(%rsp)
.L64:
	cmpq	$1, %rbx
	jbe	.L72
	movq	%rbx, %rax
	movq	%rbx, %r13
	movq	%r14, 32(%rsp)
	movl	24(%rsp), %ecx
	andl	$127, %eax
	shrq	$7, %r13
	movl	36(%rsp), %esi
	movl	$128, 16(%rsp)
	cmpq	$1, %rax
	leaq	127(%rbx), %rax
	movq	16(%rsp), %rdx
	movl	$1024, %r8d
	sbbq	$-1, %r13
	shrq	$7, %rax
	xorl	%r9d, %r9d
	movl	%eax, 28(%rsp)
	movq	28(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L66
	movq	8(%rsp), %rsi
	movq	%rbx, %rdx
	movq	%r12, %rdi
	call	_Z47__device_stub__Z24reduction_blocked_sharedPyS_yPyS_y
.L66:
	movq	8(%rsp), %rsi
	movl	$3, %ecx
	movq	%r12, %rdi
	movq	%r13, %rbx
	leaq	0(,%r13,8), %rdx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$205, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaDeviceSynchronize@PLT
	movl	$1, %ecx
	movl	$206, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaGetLastError@PLT
	movl	$1, %ecx
	movl	$207, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	jmp	.L64
.L72:
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movl	$1, %ecx
	movl	$212, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z25run_kernel_blocked_sharedPyy, .-_Z25run_kernel_blocked_sharedPyy
	.globl	_Z40__device_stub__Z17reduction_blockedPyS_yPyS_y
	.type	_Z40__device_stub__Z17reduction_blockedPyS_yPyS_y, @function
_Z40__device_stub__Z17reduction_blockedPyS_yPyS_y:
.LFB2068:
	.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
	movq	%rdx, 8(%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	8(%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	.L73
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z17reduction_blockedPyS_y(%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
.L73:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L75
	call	__stack_chk_fail@PLT
.L75:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2068:
	.size	_Z40__device_stub__Z17reduction_blockedPyS_yPyS_y, .-_Z40__device_stub__Z17reduction_blockedPyS_yPyS_y
	.globl	_Z17reduction_blockedPyS_y
	.type	_Z17reduction_blockedPyS_y, @function
_Z17reduction_blockedPyS_y:
.LFB2069:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z17reduction_blockedPyS_yPyS_y
	.cfi_endproc
.LFE2069:
	.size	_Z17reduction_blockedPyS_y, .-_Z17reduction_blockedPyS_y
	.globl	_Z18run_kernel_blockedPyy
	.type	_Z18run_kernel_blockedPyy, @function
_Z18run_kernel_blockedPyy:
.LFB2033:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movabsq	$4294967297, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rsi, %rbx
	salq	$3, %rsi
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$246, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	%r14, 20(%rsp)
.L79:
	cmpq	$1, %rbx
	jbe	.L87
	movq	%rbx, %rax
	movq	%rbx, %r13
	movq	%r14, 32(%rsp)
	movl	24(%rsp), %ecx
	andl	$127, %eax
	shrq	$7, %r13
	movl	$128, 16(%rsp)
	movl	36(%rsp), %esi
	cmpq	$1, %rax
	leaq	127(%rbx), %rax
	movq	16(%rsp), %rdx
	sbbq	$-1, %r13
	shrq	$7, %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%eax, 28(%rsp)
	movq	28(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L81
	movq	8(%rsp), %rsi
	movq	%rbx, %rdx
	movq	%r12, %rdi
	call	_Z40__device_stub__Z17reduction_blockedPyS_yPyS_y
.L81:
	movq	8(%rsp), %rsi
	movl	$3, %ecx
	movq	%r12, %rdi
	movq	%r13, %rbx
	leaq	0(,%r13,8), %rdx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$259, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaDeviceSynchronize@PLT
	movl	$1, %ecx
	movl	$260, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaGetLastError@PLT
	movl	$1, %ecx
	movl	$261, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	jmp	.L79
.L87:
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movl	$1, %ecx
	movl	$266, %edx
	movq	%rbp, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L83
	call	__stack_chk_fail@PLT
.L83:
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2033:
	.size	_Z18run_kernel_blockedPyy, .-_Z18run_kernel_blockedPyy
	.globl	_Z30__device_stub__Z9reductionPyyyPyyy
	.type	_Z30__device_stub__Z9reductionPyyyPyyy, @function
_Z30__device_stub__Z9reductionPyyyPyyy:
.LFB2070:
	.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
	movq	%rdx, 8(%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	8(%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	.L88
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z9reductionPyyy(%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
.L88:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L90
	call	__stack_chk_fail@PLT
.L90:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2070:
	.size	_Z30__device_stub__Z9reductionPyyyPyyy, .-_Z30__device_stub__Z9reductionPyyyPyyy
	.globl	_Z9reductionPyyy
	.type	_Z9reductionPyyy, @function
_Z9reductionPyyy:
.LFB2071:
	.cfi_startproc
	endbr64
	jmp	_Z30__device_stub__Z9reductionPyyyPyyy
	.cfi_endproc
.LFE2071:
	.size	_Z9reductionPyyy, .-_Z9reductionPyyy
	.globl	_Z16run_kernel_basicPyy
	.type	_Z16run_kernel_basicPyy, @function
_Z16run_kernel_basicPyy:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movabsq	$4294967297, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rsi, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%r13, 12(%rsp)
.L94:
	cmpq	$1, %rbx
	jbe	.L101
	movq	%rbx, %rax
	movq	%rbx, %rbp
	movq	%r13, 24(%rsp)
	movl	16(%rsp), %ecx
	andl	$1, %eax
	shrq	%rbp
	movl	$128, 8(%rsp)
	movl	28(%rsp), %esi
	cmpq	$1, %rax
	movq	8(%rsp), %rdx
	sbbq	$-1, %rbp
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	127(%rbp), %rax
	shrq	$7, %rax
	movl	%eax, 20(%rsp)
	movq	20(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L96
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	_Z30__device_stub__Z9reductionPyyyPyyy
.L96:
	call	cudaDeviceSynchronize@PLT
	movl	$1, %ecx
	movl	$302, %edx
	leaq	.LC1(%rip), %rbx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaGetLastError@PLT
	movq	%rbx, %rsi
	movl	$1, %ecx
	movq	%rbp, %rbx
	movl	%eax, %edi
	movl	$303, %edx
	call	_Z10cudaAssert9cudaErrorPKcib
	jmp	.L94
.L101:
	addq	$40, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2034:
	.size	_Z16run_kernel_basicPyy, .-_Z16run_kernel_basicPyy
	.section	.rodata.str1.1
.LC9:
	.string	"\n\n=======================================================================\n"
.LC10:
	.string	"== Parallel DTYPE reduction\n"
.LC11:
	.string	"=======================================================================\n"
.LC12:
	.string	"Number of DTYPE : %llu\n"
.LC14:
	.string	"    size of mem : %.2f GB\n"
.LC15:
	.string	"Not implemented\n"
.LC17:
	.string	"    Total number of add inst. : %.2f Gops\n"
.LC18:
	.string	"    Elaped time: %.4f msec\n"
.LC20:
	.string	"    GFLOPS : %.4f gflops [Avg. of %d time(s)]\n"
.LC21:
	.string	"Check result ...\n"
.LC22:
	.string	"    [Err] GT(%llu) != Pred(%llu)\n"
.LC23:
	.string	"    [Pass] GT(%llu) == Pred(%llu)\n"
.LC24:
	.string	"=======================================================================\n\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2037:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$4, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	$3200000000, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	leaq	.LC9(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	movl	$2, %edi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movl	%ebx, %edi
	leaq	.LC1(%rip), %rbx
	call	_Z11select_modeiPPKc
	movl	$400000000, %edx
	movl	$2, %edi
	leaq	.LC12(%rip), %rsi
	movl	%eax, %r12d
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movsd	.LC13(%rip), %xmm0
	leaq	.LC14(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%r13, %rdi
	call	malloc@PLT
	movl	$400000000, %esi
	movq	%rax, %rdi
	movq	%rax, %r15
	call	_Z12initial_dataPyy
	leaq	24(%rsp), %rdi
	movl	$0x00000000, 20(%rsp)
	movq	%rax, %rbp
	call	cudaEventCreate@PLT
	movl	$1, %ecx
	movl	$379, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	leaq	32(%rsp), %rdi
	call	cudaEventCreate@PLT
	movl	$1, %ecx
	movl	$380, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	leaq	40(%rsp), %rdi
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$385, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	40(%rsp), %rdi
	movq	%r13, %rdx
	movq	%r15, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$386, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	call	cudaDeviceSynchronize@PLT
	movl	$1, %ecx
	movl	$387, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movl	$0x00000000, 8(%rsp)
.L111:
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rdx
	movq	%r15, %rsi
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$392, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	24(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$1, %ecx
	movl	$393, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	cmpl	$4, %r12d
	ja	.L103
	leaq	.L105(%rip), %rdx
	movl	%r12d, %eax
	movq	40(%rsp), %rdi
	movl	$400000000, %esi
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L105:
	.long	.L109-.L105
	.long	.L108-.L105
	.long	.L107-.L105
	.long	.L106-.L105
	.long	.L104-.L105
	.section	.text.startup
.L109:
	call	_Z16run_kernel_basicPyy
	jmp	.L110
.L108:
	call	_Z18run_kernel_blockedPyy
	jmp	.L110
.L107:
	call	_Z25run_kernel_blocked_sharedPyy
	jmp	.L110
.L106:
	call	_Z30run_kernel_blocked_shared_halfPyy
	jmp	.L110
.L104:
	call	_Z39run_kernel_blocked_shared_half_unrolledPyy
	jmp	.L110
.L103:
	movl	$2, %edi
	leaq	.LC15(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L110:
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$1, %ecx
	movl	$415, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	32(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movl	$1, %ecx
	movl	$416, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	leaq	20(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	movl	$1, %ecx
	movl	$417, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movss	8(%rsp), %xmm2
	addss	20(%rsp), %xmm2
	movss	%xmm2, 8(%rsp)
	decl	%r14d
	jne	.L111
	movq	40(%rsp), %rsi
	leaq	48(%rsp), %rdi
	movl	$2, %ecx
	movl	$8, %edx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$423, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movsd	.LC16(%rip), %xmm0
	leaq	.LC17(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	8(%rsp), %xmm0
	movsd	%xmm0, 8(%rsp)
	call	__printf_chk@PLT
	movsd	8(%rsp), %xmm0
	movb	$1, %al
	movsd	.LC16(%rip), %xmm1
	mulsd	.LC19(%rip), %xmm0
	movl	$4, %edx
	movl	$2, %edi
	leaq	.LC20(%rip), %rsi
	divsd	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	call	__printf_chk@PLT
	leaq	.LC21(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	48(%rsp), %rcx
	movq	%rbp, %rdx
	leaq	.LC22(%rip), %rsi
	cmpq	%rbp, %rcx
	jne	.L117
	movq	%rbp, %rcx
	leaq	.LC23(%rip), %rsi
.L117:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC24(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movl	$1, %ecx
	movl	$439, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10cudaAssert9cudaErrorPKcib
	movq	%r15, %rdi
	call	free@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L114
	call	__stack_chk_fail@PLT
.L114:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2037:
	.size	main, .-main
	.section	.rodata.str1.1
.LC25:
	.string	"_Z9reductionPyyy"
.LC26:
	.string	"_Z17reduction_blockedPyS_y"
.LC27:
	.string	"_Z24reduction_blocked_sharedPyS_y"
.LC28:
	.string	"_Z29reduction_blocked_shared_halfPyS_y"
.LC29:
	.string	"_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2073:
	.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	.LC25(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z9reductionPyyy(%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	.LC26(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17reduction_blockedPyS_y(%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	.LC27(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z24reduction_blocked_sharedPyS_y(%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	.LC28(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z29reduction_blocked_shared_halfPyS_y(%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	.LC29(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y(%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
.LFE2073:
	.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
.LC13:
	.long	-1717986918
	.long	1074370969
	.align 8
.LC16:
	.long	-1610612736
	.long	1073322393
	.align 8
.LC19:
	.long	-755914244
	.long	1062232653
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:



#include <hip/hip_runtime.h>
#include <cstdio>
#include <cstdlib>

#define DTYPE unsigned long long
#define ull unsigned long long

/*** CUDA API error checking  ***/
#define cudaErrChk(ans) { cudaAssert((ans), __FILE__, __LINE__); }
inline void cudaAssert(hipError_t code, const char *file, int line, bool abort=true)
{
   if (code != hipSuccess) 
   {
      fprintf(stderr,"CUDA assert: %s %s %d\n", hipGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}


/****************************************************************
  *** Kernel mode : 4
  *** Blocked shared half unrolled reduction
  ****************************************************************/

/*** Kernel program ***/
template <size_t blockSize>
__global__ void reduction_blocked_shared_half_unrolled (DTYPE* d_data, DTYPE* d_out, ull remain) {
    ull tidx = threadIdx.x;
    ull idx = blockIdx.x * (2*blockSize) + threadIdx.x;
    extern __shared__ DTYPE smem[];

    if (idx < remain) {
        if (idx+blockSize<remain)
            smem[tidx] = d_data[idx]+d_data[idx+blockSize];
        else
            smem[tidx] = d_data[idx];
    }
    __syncthreads();

    #pragma unroll
    for (ull s=blockSize>>1; s>0; s>>=1) {
        if (tidx<s && idx+s<remain) {
            smem[tidx]+=smem[tidx+s];
        }
        __syncthreads();
    }


    if (tidx == 0) {
        d_out[blockIdx.x] = smem[tidx];
    }
}



/*** Host program ***/
void run_kernel_blocked_shared_half_unrolled (DTYPE* d_data, const ull num_data) {

    DTYPE* d_out;
    cudaErrChk (hipMalloc ((void**)&d_out, sizeof(DTYPE)*num_data));
    ull remain=num_data, next=0;

    dim3 threads (128);
    const size_t size_smem = sizeof (DTYPE) * threads.x;
    while (remain > 1) {
        if (remain%threads.x==0)
            next = remain/(2*threads.x);
        else
            next = remain/(2*threads.x)+1;


        dim3 blocks ((remain+(2*threads.x)-1)/(2*threads.x));
        reduction_blocked_shared_half_unrolled<128><<<blocks, threads, size_smem>>> (d_data, d_out, remain);
        cudaErrChk (hipMemcpy (d_data, d_out, next*sizeof(DTYPE), hipMemcpyDeviceToDevice));
        cudaErrChk (hipDeviceSynchronize ())
        cudaErrChk (hipGetLastError() );
        
        remain = next;
    } 

    cudaErrChk (hipFree (d_out));
 
}






/****************************************************************
  *** Kernel mode : 3
  *** Blocked shared half reduction
  ****************************************************************/

/*** Kernel program ***/
__global__ void reduction_blocked_shared_half (DTYPE* d_data, DTYPE* d_out, ull remain) {
    ull tidx = threadIdx.x;
    ull idx = blockIdx.x * (2*blockDim.x) + threadIdx.x;
    extern __shared__ DTYPE smem[];

    if (idx < remain) {
        if (idx+blockDim.x<remain)
            smem[tidx] = d_data[idx]+d_data[idx+blockDim.x];
        else
            smem[tidx] = d_data[idx];
    }
    __syncthreads();

    for (ull s=blockDim.x>>1; s>0; s>>=1) {
        if (tidx<s && idx+s<remain) {
            smem[tidx]+=smem[tidx+s];
        }
        __syncthreads();
    }
    
    if (tidx == 0) {
        d_out[blockIdx.x] = smem[tidx];
    }
}



/*** Host program ***/
void run_kernel_blocked_shared_half (DTYPE* d_data, const ull num_data) {

    DTYPE* d_out;
    cudaErrChk (hipMalloc ((void**)&d_out, sizeof(DTYPE)*num_data));
    ull remain=num_data, next=0;

    dim3 threads (128);
    const size_t size_smem = sizeof (DTYPE) * threads.x;
    while (remain > 1) {
        if (remain%threads.x==0)
            next = remain/(2*threads.x);
        else
            next = remain/(2*threads.x)+1;


        dim3 blocks ((remain+(2*threads.x)-1)/(2*threads.x));
        reduction_blocked_shared_half<<<blocks, threads, size_smem>>> (d_data, d_out, remain);
        cudaErrChk (hipMemcpy (d_data, d_out, next*sizeof(DTYPE), hipMemcpyDeviceToDevice));
        cudaErrChk (hipDeviceSynchronize ())
        cudaErrChk (hipGetLastError() );
        
        remain = next;
    } 

    cudaErrChk (hipFree (d_out));
 
}






/****************************************************************
  *** Kernel mode : 2
  *** Blocked shared reduction
  ****************************************************************/

/*** Kernel program ***/
__global__ void reduction_blocked_shared (DTYPE* d_data, DTYPE* d_out, ull remain) {
    ull tidx = threadIdx.x;
    ull idx = blockIdx.x * blockDim.x + threadIdx.x;
    extern __shared__ DTYPE smem[];

    if (idx < remain) {
        smem[tidx] = d_data[idx];
    }
    __syncthreads();

    for (ull s=blockDim.x>>1; s>0; s>>=1) {
        if (tidx<s && idx+s<remain) {
            smem[tidx]+=smem[tidx+s];
        }
        __syncthreads();
    }
    
    if (tidx == 0) {
        d_out[blockIdx.x] = smem[tidx];
    }
}



/*** Host program ***/
void run_kernel_blocked_shared (DTYPE* d_data, const ull num_data) {

    DTYPE* d_out;
    cudaErrChk (hipMalloc ((void**)&d_out, sizeof(DTYPE)*num_data));
    ull remain=num_data, next=0;

    dim3 threads (128);
    const size_t size_smem = sizeof (DTYPE) * threads.x;
    while (remain > 1) {
        if (remain%threads.x==0)
            next = remain/threads.x;
        else
            next = remain/threads.x+1;


        dim3 blocks ((remain+threads.x-1)/threads.x);
        reduction_blocked_shared<<<blocks, threads, size_smem>>> (d_data, d_out, remain);
        cudaErrChk (hipMemcpy (d_data, d_out, next*sizeof(DTYPE), hipMemcpyDeviceToDevice));
        cudaErrChk (hipDeviceSynchronize ())
        cudaErrChk (hipGetLastError() );
        
        remain = next;
    } 

    cudaErrChk (hipFree (d_out));
 
}




/****************************************************************
  *** Kernel mode : 1
  *** Blocked reduction
  ****************************************************************/

/*** Kernel program ***/
__global__ void reduction_blocked (DTYPE* d_data, DTYPE* d_out, ull remain) {
    ull tidx = threadIdx.x;
    ull idx = blockIdx.x * blockDim.x + threadIdx.x;

    for (ull s=blockDim.x>>1; s>0; s>>=1) {
        if (tidx<s && idx+s < remain) {
            d_data[idx]+=d_data[idx+s];
        }
        __syncthreads();
    }
    
    if (tidx == 0) {
        d_out[blockIdx.x] = d_data[idx];
    }
}


/*** Host program ***/
void run_kernel_blocked (DTYPE* d_data, const ull num_data) {

    DTYPE* d_out;
    cudaErrChk (hipMalloc ((void**)&d_out, sizeof(DTYPE)*num_data));
    ull remain=num_data, next=0;

    dim3 threads (128);
    while (remain > 1) {
        if (remain%threads.x==0)
            next = remain/threads.x;
        else
            next = remain/threads.x+1;


        dim3 blocks ((remain+threads.x-1)/threads.x);
        reduction_blocked<<<blocks, threads>>> (d_data, d_out, remain);
        cudaErrChk (hipMemcpy (d_data, d_out, next*sizeof(DTYPE), hipMemcpyDeviceToDevice));
        cudaErrChk (hipDeviceSynchronize ())
        cudaErrChk (hipGetLastError() );
        
        remain = next;
    } 

    cudaErrChk (hipFree (d_out));
 
}




/****************************************************************
  *** Kernel mode : 0
  *** Basic reduction
  ****************************************************************/

/*** Kernel program ***/
__global__ void reduction (DTYPE* d_data, ull remain, ull next) {
    ull idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (idx + next < remain) {
        d_data[idx] += d_data[idx+next];
    }
}


/*** Host program ***/
void run_kernel_basic (DTYPE* d_data, const ull num_data) {

    ull remain=num_data, next=0;
    dim3 threads (128);

    while (remain > 1) {
        if (remain%2==0)
            next = remain/2;
        else
            next = remain/2 +1;

        dim3 blocks ((next+threads.x-1)/threads.x);
        reduction<<<blocks, threads>>> (d_data, remain, next);
        cudaErrChk (hipDeviceSynchronize ())
        cudaErrChk (hipGetLastError() );
        remain = next;
    }
}





/****************************************************************
  *** Host program
  ****************************************************************/

DTYPE initial_data (DTYPE* data, const ull num_data) {
    DTYPE sum = 0;
    for (ull i=0; i<num_data; i++) {
        data[i] = rand()%5;
        sum += data[i];
    }
    return sum;
}

int select_mode(const int argc, const char** argv) {

    int mode = 0;
    if (argc > 1)
        mode = atoi(argv[1]);

    switch (mode) {
        case 0:
            printf("Kernel mode : 0.Basic reduction\n");
            break;
        case 1:
            printf("Kernel mode : 1.Blocked reduction\n");
            break;
        case 2:
            printf("Kernel mode : 2.Blocked shared reduction\n");
            break;
        case 3:
            printf("Kernel mode : 3.Blocked shared half reduction\n");
            break;
        case 4:
            printf("Kernel mode : 4.Blocked shared half unrolled reduction\n");
            break;


        default:
            printf("Selected not implemented mode...\n");
            exit(1);
            break;
    }
    return mode;
}


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

    /*** Program Configuration ***/
    const ull num_data = 4*1e+8;
    const int loop_exe = 4;
    const size_t size_data = sizeof (ull) * num_data;

    printf("\n\n=======================================================================\n");
    printf("== Parallel DTYPE reduction\n");
    printf("=======================================================================\n");
    const int mode_kernel = select_mode(argc, argv);
    printf("Number of DTYPE : %llu\n", num_data);
    printf("    size of mem : %.2f GB\n", size_data*1e-9);


    /*** Initialize variables ***/
    DTYPE* data = (DTYPE*) malloc (size_data);
    const DTYPE sum = initial_data (data, num_data);
    float gops = 1e-9*num_data*loop_exe;
    hipEvent_t start, stop;
    float msec_total=0.0f, msec=0.0f;
    cudaErrChk (hipEventCreate(&start));
    cudaErrChk (hipEventCreate(&stop));


    /*** Set CUDA Memory ***/
    DTYPE* d_data;
    cudaErrChk (hipMalloc ((void**)&d_data, size_data));
    cudaErrChk (hipMemcpy (d_data, data, size_data, hipMemcpyHostToDevice));
    cudaErrChk (hipDeviceSynchronize ());


    /*** Run kernel ***/
    for (int loop=0; loop<loop_exe; loop++) {
        cudaErrChk (hipMemcpy (d_data, data, size_data, hipMemcpyHostToDevice));
        cudaErrChk (hipEventRecord(start, NULL));
        switch (mode_kernel) {
            case 0:
                run_kernel_basic (d_data, num_data);
                break;
            case 1:
                run_kernel_blocked (d_data, num_data);
                break;
            case 2:
                run_kernel_blocked_shared (d_data, num_data);
                break;
            case 3:
                run_kernel_blocked_shared_half (d_data, num_data);
                break;
            case 4:
                run_kernel_blocked_shared_half_unrolled (d_data, num_data);
                break;
            default:
                printf("Not implemented\n");
                exit(1);
                break;
        }
        cudaErrChk (hipEventRecord(stop, NULL));
        cudaErrChk (hipEventSynchronize(stop));
        cudaErrChk (hipEventElapsedTime(&msec, start, stop));
        msec_total += msec;
    }

    /*** Check result ***/
    DTYPE result;
    cudaErrChk (hipMemcpy (&result, d_data, sizeof (DTYPE), hipMemcpyDeviceToHost));

    printf("    Total number of add inst. : %.2f Gops\n", gops);
    printf("    Elaped time: %.4f msec\n", msec_total);
    printf("    GFLOPS : %.4f gflops [Avg. of %d time(s)]\n", gops/(msec_total*1e-3), loop_exe); 


    printf("Check result ...\n");
    if (sum != result) {
        printf("    [Err] GT(%llu) != Pred(%llu)\n", sum, result);
    } else {
        printf("    [Pass] GT(%llu) == Pred(%llu)\n", sum, result);
    }
    printf("=======================================================================\n\n");

    /*** Finalize program ***/
    cudaErrChk (hipFree (d_data));    
    free (data);

    return 0;
}

	.text
	.file	"reduction.hip"
	.globl	_Z39run_kernel_blocked_shared_half_unrolledPyy # -- Begin function _Z39run_kernel_blocked_shared_half_unrolledPyy
	.type	_Z39run_kernel_blocked_shared_half_unrolledPyy,@function
_Z39run_kernel_blocked_shared_half_unrolledPyy: # @_Z39run_kernel_blocked_shared_half_unrolledPyy
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	(,%rsi,8), %rsi
	movq	%rsp, %rdi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB0_7
# %bb.1:                                # %_Z10cudaAssert10hipError_tPKcib.exit.preheader
	movabsq	$4294967296, %r12               # imm = 0x100000000
	leaq	128(%r12), %r14
.LBB0_2:                                # %_Z10cudaAssert10hipError_tPKcib.exit
                                        # =>This Inner Loop Header: Depth=1
	cmpq	$2, %r15
	jb	.LBB0_13
# %bb.3:                                #   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %eax
	andl	$127, %eax
	movq	%r15, %r13
	shrq	$8, %r13
	cmpq	$1, %rax
	sbbq	$-1, %r13
	leaq	255(%r15), %rax
	shrq	$8, %rax
	movl	%eax, %edi
	orq	%r12, %rdi
	movl	$1024, %r8d                     # imm = 0x400
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB0_5
# %bb.4:                                #   in Loop: Header=BB0_2 Depth=1
	movq	(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
.LBB0_5:                                #   in Loop: Header=BB0_2 Depth=1
	movq	(%rsp), %rsi
	leaq	(,%r13,8), %rdx
	movq	%rbx, %rdi
	movl	$3, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB0_6
# %bb.9:                                # %_Z10cudaAssert10hipError_tPKcib.exit20
                                        #   in Loop: Header=BB0_2 Depth=1
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB0_10
# %bb.11:                               # %_Z10cudaAssert10hipError_tPKcib.exit22
                                        #   in Loop: Header=BB0_2 Depth=1
	callq	hipGetLastError
	movq	%r13, %r15
	testl	%eax, %eax
	je	.LBB0_2
# %bb.12:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$78, %r8d
	jmp	.LBB0_8
.LBB0_13:
	movq	(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB0_15
# %bb.14:                               # %_Z10cudaAssert10hipError_tPKcib.exit26
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB0_6:
	.cfi_def_cfa_offset 64
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$76, %r8d
	jmp	.LBB0_8
.LBB0_10:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$77, %r8d
.LBB0_8:
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebp, %edi
	callq	exit
.LBB0_7:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$62, %r8d
	jmp	.LBB0_8
.LBB0_15:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$83, %r8d
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebx, %edi
	callq	exit
.Lfunc_end0:
	.size	_Z39run_kernel_blocked_shared_half_unrolledPyy, .Lfunc_end0-_Z39run_kernel_blocked_shared_half_unrolledPyy
	.cfi_endproc
                                        # -- End function
	.section	.text._Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,"axG",@progbits,_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,comdat
	.weak	_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y # -- Begin function _Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.type	_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,@function
_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y: # @_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.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	24(%rsp), %rsi
	movq	%rdx, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y, %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_end1:
	.size	_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y, .Lfunc_end1-_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.cfi_endproc
                                        # -- End function
	.text
	.globl	_Z44__device_stub__reduction_blocked_shared_halfPyS_y # -- Begin function _Z44__device_stub__reduction_blocked_shared_halfPyS_y
	.type	_Z44__device_stub__reduction_blocked_shared_halfPyS_y,@function
_Z44__device_stub__reduction_blocked_shared_halfPyS_y: # @_Z44__device_stub__reduction_blocked_shared_halfPyS_y
	.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	24(%rsp), %rsi
	movq	%rdx, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z29reduction_blocked_shared_halfPyS_y, %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_end2:
	.size	_Z44__device_stub__reduction_blocked_shared_halfPyS_y, .Lfunc_end2-_Z44__device_stub__reduction_blocked_shared_halfPyS_y
	.cfi_endproc
                                        # -- End function
	.globl	_Z30run_kernel_blocked_shared_halfPyy # -- Begin function _Z30run_kernel_blocked_shared_halfPyy
	.type	_Z30run_kernel_blocked_shared_halfPyy,@function
_Z30run_kernel_blocked_shared_halfPyy:  # @_Z30run_kernel_blocked_shared_halfPyy
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	(,%rsi,8), %rsi
	movq	%rsp, %rdi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB3_7
# %bb.1:                                # %_Z10cudaAssert10hipError_tPKcib.exit.preheader
	movabsq	$4294967296, %r12               # imm = 0x100000000
	leaq	128(%r12), %r14
.LBB3_2:                                # %_Z10cudaAssert10hipError_tPKcib.exit
                                        # =>This Inner Loop Header: Depth=1
	cmpq	$2, %r15
	jb	.LBB3_13
# %bb.3:                                #   in Loop: Header=BB3_2 Depth=1
	movl	%r15d, %eax
	andl	$127, %eax
	movq	%r15, %r13
	shrq	$8, %r13
	cmpq	$1, %rax
	sbbq	$-1, %r13
	leaq	255(%r15), %rax
	shrq	$8, %rax
	movl	%eax, %edi
	orq	%r12, %rdi
	movl	$1024, %r8d                     # imm = 0x400
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_5
# %bb.4:                                #   in Loop: Header=BB3_2 Depth=1
	movq	(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_Z44__device_stub__reduction_blocked_shared_halfPyS_y
.LBB3_5:                                #   in Loop: Header=BB3_2 Depth=1
	movq	(%rsp), %rsi
	leaq	(,%r13,8), %rdx
	movq	%rbx, %rdi
	movl	$3, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB3_6
# %bb.9:                                # %_Z10cudaAssert10hipError_tPKcib.exit20
                                        #   in Loop: Header=BB3_2 Depth=1
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB3_10
# %bb.11:                               # %_Z10cudaAssert10hipError_tPKcib.exit22
                                        #   in Loop: Header=BB3_2 Depth=1
	callq	hipGetLastError
	movq	%r13, %r15
	testl	%eax, %eax
	je	.LBB3_2
# %bb.12:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$145, %r8d
	jmp	.LBB3_8
.LBB3_13:
	movq	(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB3_15
# %bb.14:                               # %_Z10cudaAssert10hipError_tPKcib.exit26
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB3_6:
	.cfi_def_cfa_offset 64
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$143, %r8d
	jmp	.LBB3_8
.LBB3_10:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$144, %r8d
.LBB3_8:
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebp, %edi
	callq	exit
.LBB3_7:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$129, %r8d
	jmp	.LBB3_8
.LBB3_15:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$150, %r8d
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebx, %edi
	callq	exit
.Lfunc_end3:
	.size	_Z30run_kernel_blocked_shared_halfPyy, .Lfunc_end3-_Z30run_kernel_blocked_shared_halfPyy
	.cfi_endproc
                                        # -- End function
	.globl	_Z39__device_stub__reduction_blocked_sharedPyS_y # -- Begin function _Z39__device_stub__reduction_blocked_sharedPyS_y
	.type	_Z39__device_stub__reduction_blocked_sharedPyS_y,@function
_Z39__device_stub__reduction_blocked_sharedPyS_y: # @_Z39__device_stub__reduction_blocked_sharedPyS_y
	.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	24(%rsp), %rsi
	movq	%rdx, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z24reduction_blocked_sharedPyS_y, %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_end4:
	.size	_Z39__device_stub__reduction_blocked_sharedPyS_y, .Lfunc_end4-_Z39__device_stub__reduction_blocked_sharedPyS_y
	.cfi_endproc
                                        # -- End function
	.globl	_Z25run_kernel_blocked_sharedPyy # -- Begin function _Z25run_kernel_blocked_sharedPyy
	.type	_Z25run_kernel_blocked_sharedPyy,@function
_Z25run_kernel_blocked_sharedPyy:       # @_Z25run_kernel_blocked_sharedPyy
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	(,%rsi,8), %rsi
	movq	%rsp, %rdi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB5_7
# %bb.1:                                # %_Z10cudaAssert10hipError_tPKcib.exit.preheader
	movabsq	$4294967296, %r12               # imm = 0x100000000
	leaq	128(%r12), %r14
.LBB5_2:                                # %_Z10cudaAssert10hipError_tPKcib.exit
                                        # =>This Inner Loop Header: Depth=1
	cmpq	$2, %r15
	jb	.LBB5_13
# %bb.3:                                #   in Loop: Header=BB5_2 Depth=1
	movl	%r15d, %eax
	andl	$127, %eax
	movq	%r15, %r13
	shrq	$7, %r13
	cmpq	$1, %rax
	sbbq	$-1, %r13
	leaq	127(%r15), %rax
	shrq	$7, %rax
	movl	%eax, %edi
	orq	%r12, %rdi
	movl	$1024, %r8d                     # imm = 0x400
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_5
# %bb.4:                                #   in Loop: Header=BB5_2 Depth=1
	movq	(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_Z39__device_stub__reduction_blocked_sharedPyS_y
.LBB5_5:                                #   in Loop: Header=BB5_2 Depth=1
	movq	(%rsp), %rsi
	leaq	(,%r13,8), %rdx
	movq	%rbx, %rdi
	movl	$3, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB5_6
# %bb.9:                                # %_Z10cudaAssert10hipError_tPKcib.exit20
                                        #   in Loop: Header=BB5_2 Depth=1
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB5_10
# %bb.11:                               # %_Z10cudaAssert10hipError_tPKcib.exit22
                                        #   in Loop: Header=BB5_2 Depth=1
	callq	hipGetLastError
	movq	%r13, %r15
	testl	%eax, %eax
	je	.LBB5_2
# %bb.12:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$209, %r8d
	jmp	.LBB5_8
.LBB5_13:
	movq	(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB5_15
# %bb.14:                               # %_Z10cudaAssert10hipError_tPKcib.exit26
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB5_6:
	.cfi_def_cfa_offset 64
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$207, %r8d
	jmp	.LBB5_8
.LBB5_10:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$208, %r8d
.LBB5_8:
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebp, %edi
	callq	exit
.LBB5_7:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$193, %r8d
	jmp	.LBB5_8
.LBB5_15:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$214, %r8d
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebx, %edi
	callq	exit
.Lfunc_end5:
	.size	_Z25run_kernel_blocked_sharedPyy, .Lfunc_end5-_Z25run_kernel_blocked_sharedPyy
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__reduction_blockedPyS_y # -- Begin function _Z32__device_stub__reduction_blockedPyS_y
	.type	_Z32__device_stub__reduction_blockedPyS_y,@function
_Z32__device_stub__reduction_blockedPyS_y: # @_Z32__device_stub__reduction_blockedPyS_y
	.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	24(%rsp), %rsi
	movq	%rdx, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z17reduction_blockedPyS_y, %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_end6:
	.size	_Z32__device_stub__reduction_blockedPyS_y, .Lfunc_end6-_Z32__device_stub__reduction_blockedPyS_y
	.cfi_endproc
                                        # -- End function
	.globl	_Z18run_kernel_blockedPyy       # -- Begin function _Z18run_kernel_blockedPyy
	.type	_Z18run_kernel_blockedPyy,@function
_Z18run_kernel_blockedPyy:              # @_Z18run_kernel_blockedPyy
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	(,%rsi,8), %rsi
	movq	%rsp, %rdi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB7_7
# %bb.1:                                # %_Z10cudaAssert10hipError_tPKcib.exit.preheader
	movabsq	$4294967296, %r12               # imm = 0x100000000
	leaq	128(%r12), %r14
.LBB7_2:                                # %_Z10cudaAssert10hipError_tPKcib.exit
                                        # =>This Inner Loop Header: Depth=1
	cmpq	$2, %r15
	jb	.LBB7_13
# %bb.3:                                #   in Loop: Header=BB7_2 Depth=1
	movl	%r15d, %eax
	andl	$127, %eax
	movq	%r15, %r13
	shrq	$7, %r13
	cmpq	$1, %rax
	sbbq	$-1, %r13
	leaq	127(%r15), %rax
	shrq	$7, %rax
	movl	%eax, %edi
	orq	%r12, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_5
# %bb.4:                                #   in Loop: Header=BB7_2 Depth=1
	movq	(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_Z32__device_stub__reduction_blockedPyS_y
.LBB7_5:                                #   in Loop: Header=BB7_2 Depth=1
	movq	(%rsp), %rsi
	leaq	(,%r13,8), %rdx
	movq	%rbx, %rdi
	movl	$3, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB7_6
# %bb.9:                                # %_Z10cudaAssert10hipError_tPKcib.exit19
                                        #   in Loop: Header=BB7_2 Depth=1
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB7_10
# %bb.11:                               # %_Z10cudaAssert10hipError_tPKcib.exit21
                                        #   in Loop: Header=BB7_2 Depth=1
	callq	hipGetLastError
	movq	%r13, %r15
	testl	%eax, %eax
	je	.LBB7_2
# %bb.12:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$263, %r8d                      # imm = 0x107
	jmp	.LBB7_8
.LBB7_13:
	movq	(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB7_15
# %bb.14:                               # %_Z10cudaAssert10hipError_tPKcib.exit25
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB7_6:
	.cfi_def_cfa_offset 64
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$261, %r8d                      # imm = 0x105
	jmp	.LBB7_8
.LBB7_10:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$262, %r8d                      # imm = 0x106
.LBB7_8:
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebp, %edi
	callq	exit
.LBB7_7:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$248, %r8d
	jmp	.LBB7_8
.LBB7_15:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$268, %r8d                      # imm = 0x10C
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebx, %edi
	callq	exit
.Lfunc_end7:
	.size	_Z18run_kernel_blockedPyy, .Lfunc_end7-_Z18run_kernel_blockedPyy
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__reductionPyyy # -- Begin function _Z24__device_stub__reductionPyyy
	.type	_Z24__device_stub__reductionPyyy,@function
_Z24__device_stub__reductionPyyy:       # @_Z24__device_stub__reductionPyyy
	.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	24(%rsp), %rsi
	movq	%rdx, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9reductionPyyy, %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_end8:
	.size	_Z24__device_stub__reductionPyyy, .Lfunc_end8-_Z24__device_stub__reductionPyyy
	.cfi_endproc
                                        # -- End function
	.globl	_Z16run_kernel_basicPyy         # -- Begin function _Z16run_kernel_basicPyy
	.type	_Z16run_kernel_basicPyy,@function
_Z16run_kernel_basicPyy:                # @_Z16run_kernel_basicPyy
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movabsq	$4294967296, %r13               # imm = 0x100000000
	leaq	128(%r13), %r14
.LBB9_1:                                # %_Z10cudaAssert10hipError_tPKcib.exit17
                                        # =>This Inner Loop Header: Depth=1
	cmpq	$2, %r15
	jb	.LBB9_9
# %bb.2:                                #   in Loop: Header=BB9_1 Depth=1
	movl	%r15d, %eax
	andl	$1, %eax
	movq	%r15, %rcx
	shrq	%rcx
	leaq	(%rcx,%rax), %r12
	addq	%rcx, %rax
	addq	$127, %rax
	shrq	$7, %rax
	movl	%eax, %edi
	orq	%r13, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB9_4
# %bb.3:                                #   in Loop: Header=BB9_1 Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_Z24__device_stub__reductionPyyy
.LBB9_4:                                #   in Loop: Header=BB9_1 Depth=1
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB9_5
# %bb.7:                                # %_Z10cudaAssert10hipError_tPKcib.exit
                                        #   in Loop: Header=BB9_1 Depth=1
	callq	hipGetLastError
	movq	%r12, %r15
	testl	%eax, %eax
	je	.LBB9_1
# %bb.8:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$305, %r8d                      # imm = 0x131
	jmp	.LBB9_6
.LBB9_9:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB9_5:
	.cfi_def_cfa_offset 64
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$304, %r8d                      # imm = 0x130
.LBB9_6:
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebp, %edi
	callq	exit
.Lfunc_end9:
	.size	_Z16run_kernel_basicPyy, .Lfunc_end9-_Z16run_kernel_basicPyy
	.cfi_endproc
                                        # -- End function
	.globl	_Z12initial_dataPyy             # -- Begin function _Z12initial_dataPyy
	.type	_Z12initial_dataPyy,@function
_Z12initial_dataPyy:                    # @_Z12initial_dataPyy
	.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
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	testq	%rsi, %rsi
	je	.LBB10_1
# %bb.3:                                # %.lr.ph.preheader
	movq	%rsi, %rbx
	movq	%rdi, %r14
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
.LBB10_4:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	cltq
	movq	%rax, (%r14,%r12,8)
	addq	%rax, %r15
	incq	%r12
	cmpq	%r12, %rbx
	jne	.LBB10_4
	jmp	.LBB10_2
.LBB10_1:
	xorl	%r15d, %r15d
.LBB10_2:                               # %._crit_edge
	movq	%r15, %rax
	addq	$8, %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_end10:
	.size	_Z12initial_dataPyy, .Lfunc_end10-_Z12initial_dataPyy
	.cfi_endproc
                                        # -- End function
	.globl	_Z11select_modeiPPKc            # -- Begin function _Z11select_modeiPPKc
	.type	_Z11select_modeiPPKc,@function
_Z11select_modeiPPKc:                   # @_Z11select_modeiPPKc
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	cmpl	$2, %edi
	jl	.LBB11_1
# %bb.2:
	movq	8(%rsi), %rdi
	callq	atoi
	cmpl	$5, %eax
	jae	.LBB11_5
# %bb.3:                                # %switch.lookup
	movl	%eax, %ebx
	movl	%eax, %eax
	movq	.Lswitch.table._Z11select_modeiPPKc(,%rax,8), %rdi
	jmp	.LBB11_4
.LBB11_1:
	xorl	%ebx, %ebx
	movl	$.Lstr.4, %edi
.LBB11_4:                               # %.thread
	callq	puts@PLT
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB11_5:
	.cfi_def_cfa_offset 16
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.Lfunc_end11:
	.size	_Z11select_modeiPPKc, .Lfunc_end11-_Z11select_modeiPPKc
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI12_0:
	.quad	0x400999999999999a              # double 3.2000000000000002
.LCPI12_1:
	.quad	0x3ff99999a0000000              # double 1.6000000238418579
.LCPI12_2:
	.quad	0x3f50624dd2f1a9fc              # double 0.001
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$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
	movq	%rsi, %rbx
	movl	%edi, %ebp
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movl	$.Lstr.7, %edi
	callq	puts@PLT
	movl	$.Lstr.8, %edi
	callq	puts@PLT
	movl	%ebp, %edi
	movq	%rbx, %rsi
	callq	_Z11select_modeiPPKc
	movl	%eax, %ebp
	xorl	%r15d, %r15d
	movl	$.L.str.10, %edi
	movl	$400000000, %esi                # imm = 0x17D78400
	xorl	%eax, %eax
	callq	printf
	movsd	.LCPI12_0(%rip), %xmm0          # xmm0 = mem[0],zero
	movl	$.L.str.11, %edi
	movb	$1, %al
	callq	printf
	movl	$3200000000, %edi               # imm = 0xBEBC2000
	callq	malloc
	movq	%rax, %rbx
	xorl	%r14d, %r14d
.LBB12_1:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	cltq
	movq	%rax, (%rbx,%r15,8)
	addq	%rax, %r14
	incq	%r15
	cmpq	$400000000, %r15                # imm = 0x17D78400
	jne	.LBB12_1
# %bb.2:                                # %_Z12initial_dataPyy.exit
	movl	$0, 28(%rsp)
	leaq	40(%rsp), %rdi
	callq	hipEventCreate
	testl	%eax, %eax
	jne	.LBB12_3
# %bb.5:                                # %_Z10cudaAssert10hipError_tPKcib.exit
	leaq	32(%rsp), %rdi
	callq	hipEventCreate
	testl	%eax, %eax
	jne	.LBB12_6
# %bb.7:                                # %_Z10cudaAssert10hipError_tPKcib.exit26
	leaq	8(%rsp), %rdi
	movl	$3200000000, %esi               # imm = 0xBEBC2000
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB12_8
# %bb.9:                                # %_Z10cudaAssert10hipError_tPKcib.exit28
	movq	8(%rsp), %rdi
	movl	$3200000000, %edx               # imm = 0xBEBC2000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB12_10
# %bb.11:                               # %_Z10cudaAssert10hipError_tPKcib.exit30
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB12_16
# %bb.12:                               # %_Z10cudaAssert10hipError_tPKcib.exit32.preheader.preheader
	xorps	%xmm0, %xmm0
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	movl	$4, %r13d
	movl	%ebp, %r15d
.LBB12_13:                              # %_Z10cudaAssert10hipError_tPKcib.exit32.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rdi
	movl	$3200000000, %edx               # imm = 0xBEBC2000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB12_14
# %bb.21:                               # %_Z10cudaAssert10hipError_tPKcib.exit36
                                        #   in Loop: Header=BB12_13 Depth=1
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%eax, %eax
	jne	.LBB12_22
# %bb.23:                               # %_Z10cudaAssert10hipError_tPKcib.exit38
                                        #   in Loop: Header=BB12_13 Depth=1
	cmpl	$4, %ebp
	ja	.LBB12_29
# %bb.24:                               # %_Z10cudaAssert10hipError_tPKcib.exit38
                                        #   in Loop: Header=BB12_13 Depth=1
	jmpq	*.LJTI12_0(,%r15,8)
.LBB12_30:                              #   in Loop: Header=BB12_13 Depth=1
	movq	8(%rsp), %rdi
	movl	$400000000, %esi                # imm = 0x17D78400
	callq	_Z16run_kernel_basicPyy
	jmp	.LBB12_31
.LBB12_28:                              #   in Loop: Header=BB12_13 Depth=1
	movq	8(%rsp), %rdi
	movl	$400000000, %esi                # imm = 0x17D78400
	callq	_Z39run_kernel_blocked_shared_half_unrolledPyy
	jmp	.LBB12_31
.LBB12_26:                              #   in Loop: Header=BB12_13 Depth=1
	movq	8(%rsp), %rdi
	movl	$400000000, %esi                # imm = 0x17D78400
	callq	_Z25run_kernel_blocked_sharedPyy
	jmp	.LBB12_31
.LBB12_27:                              #   in Loop: Header=BB12_13 Depth=1
	movq	8(%rsp), %rdi
	movl	$400000000, %esi                # imm = 0x17D78400
	callq	_Z30run_kernel_blocked_shared_halfPyy
	jmp	.LBB12_31
.LBB12_25:                              #   in Loop: Header=BB12_13 Depth=1
	movq	8(%rsp), %rdi
	movl	$400000000, %esi                # imm = 0x17D78400
	callq	_Z18run_kernel_blockedPyy
.LBB12_31:                              #   in Loop: Header=BB12_13 Depth=1
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%eax, %eax
	jne	.LBB12_32
# %bb.33:                               # %_Z10cudaAssert10hipError_tPKcib.exit40
                                        #   in Loop: Header=BB12_13 Depth=1
	movq	32(%rsp), %rdi
	callq	hipEventSynchronize
	testl	%eax, %eax
	jne	.LBB12_34
# %bb.35:                               # %_Z10cudaAssert10hipError_tPKcib.exit42
                                        #   in Loop: Header=BB12_13 Depth=1
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdx
	leaq	28(%rsp), %rdi
	callq	hipEventElapsedTime
	testl	%eax, %eax
	jne	.LBB12_36
# %bb.17:                               # %_Z10cudaAssert10hipError_tPKcib.exit44
                                        #   in Loop: Header=BB12_13 Depth=1
	movss	16(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	28(%rsp), %xmm0
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	decl	%r13d
	jne	.LBB12_13
# %bb.18:
	movq	8(%rsp), %rsi
	leaq	48(%rsp), %rdi
	movl	$8, %edx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB12_19
# %bb.37:                               # %_Z10cudaAssert10hipError_tPKcib.exit34
	movsd	.LCPI12_1(%rip), %xmm0          # xmm0 = mem[0],zero
	movl	$.L.str.13, %edi
	movb	$1, %al
	callq	printf
	xorps	%xmm0, %xmm0
	cvtss2sd	16(%rsp), %xmm0                 # 4-byte Folded Reload
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
	movl	$.L.str.14, %edi
	movb	$1, %al
	callq	printf
	movsd	16(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	mulsd	.LCPI12_2(%rip), %xmm1
	movsd	.LCPI12_1(%rip), %xmm0          # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movl	$.L.str.15, %edi
	movl	$4, %esi
	movb	$1, %al
	callq	printf
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	movq	48(%rsp), %rdx
	cmpq	%rdx, %r14
	jne	.LBB12_38
# %bb.39:
	movl	$.L.str.18, %edi
	movq	%r14, %rsi
	movq	%r14, %rdx
	jmp	.LBB12_40
.LBB12_38:
	movl	$.L.str.17, %edi
	movq	%r14, %rsi
.LBB12_40:
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr.10, %edi
	callq	puts@PLT
	movq	8(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB12_41
# %bb.42:                               # %_Z10cudaAssert10hipError_tPKcib.exit46
	movq	%rbx, %rdi
	callq	free
	xorl	%eax, %eax
	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
.LBB12_36:
	.cfi_def_cfa_offset 112
	movl	%eax, %r12d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$419, %r8d                      # imm = 0x1A3
	jmp	.LBB12_15
.LBB12_34:
	movl	%eax, %r12d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$418, %r8d                      # imm = 0x1A2
	jmp	.LBB12_15
.LBB12_32:
	movl	%eax, %r12d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$417, %r8d                      # imm = 0x1A1
	jmp	.LBB12_15
.LBB12_22:
	movl	%eax, %r12d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$395, %r8d                      # imm = 0x18B
	jmp	.LBB12_15
.LBB12_14:
	movl	%eax, %r12d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$394, %r8d                      # imm = 0x18A
.LBB12_15:
	xorl	%eax, %eax
	callq	fprintf
	movl	%r12d, %edi
	callq	exit
.LBB12_29:
	movl	$.Lstr.11, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.LBB12_3:
	movl	%eax, %r15d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$381, %r8d                      # imm = 0x17D
	jmp	.LBB12_4
.LBB12_6:
	movl	%eax, %r15d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$382, %r8d                      # imm = 0x17E
	jmp	.LBB12_4
.LBB12_8:
	movl	%eax, %r15d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$387, %r8d                      # imm = 0x183
	jmp	.LBB12_4
.LBB12_10:
	movl	%eax, %r15d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$388, %r8d                      # imm = 0x184
	jmp	.LBB12_4
.LBB12_16:
	movl	%eax, %r15d
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$389, %r8d                      # imm = 0x185
.LBB12_4:
	xorl	%eax, %eax
	callq	fprintf
	movl	%r15d, %edi
	callq	exit
.LBB12_19:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$425, %r8d                      # imm = 0x1A9
	jmp	.LBB12_20
.LBB12_41:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.20, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$441, %r8d                      # imm = 0x1B9
.LBB12_20:
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebp, %edi
	callq	exit
.Lfunc_end12:
	.size	main, .Lfunc_end12-main
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI12_0:
	.quad	.LBB12_30
	.quad	.LBB12_25
	.quad	.LBB12_26
	.quad	.LBB12_27
	.quad	.LBB12_28
                                        # -- 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	.LBB13_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB13_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z29reduction_blocked_shared_halfPyS_y, %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	$_Z24reduction_blocked_sharedPyS_y, %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	$_Z17reduction_blockedPyS_y, %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	$_Z9reductionPyyy, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %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_end13:
	.size	__hip_module_ctor, .Lfunc_end13-__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	.LBB14_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
.LBB14_2:
	retq
.Lfunc_end14:
	.size	__hip_module_dtor, .Lfunc_end14-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/jhson989/cuda_study/main/basic/reduction/reduction.hip"
	.size	.L.str, 117

	.type	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,@object # @_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.section	.rodata._Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,"aG",@progbits,_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,comdat
	.weak	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.p2align	3, 0x0
_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y:
	.quad	_Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.size	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y, 8

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

	.type	_Z24reduction_blocked_sharedPyS_y,@object # @_Z24reduction_blocked_sharedPyS_y
	.globl	_Z24reduction_blocked_sharedPyS_y
	.p2align	3, 0x0
_Z24reduction_blocked_sharedPyS_y:
	.quad	_Z39__device_stub__reduction_blocked_sharedPyS_y
	.size	_Z24reduction_blocked_sharedPyS_y, 8

	.type	_Z17reduction_blockedPyS_y,@object # @_Z17reduction_blockedPyS_y
	.globl	_Z17reduction_blockedPyS_y
	.p2align	3, 0x0
_Z17reduction_blockedPyS_y:
	.quad	_Z32__device_stub__reduction_blockedPyS_y
	.size	_Z17reduction_blockedPyS_y, 8

	.type	_Z9reductionPyyy,@object        # @_Z9reductionPyyy
	.globl	_Z9reductionPyyy
	.p2align	3, 0x0
_Z9reductionPyyy:
	.quad	_Z24__device_stub__reductionPyyy
	.size	_Z9reductionPyyy, 8

	.type	.L.str.10,@object               # @.str.10
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.10:
	.asciz	"Number of DTYPE : %llu\n"
	.size	.L.str.10, 24

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"    size of mem : %.2f GB\n"
	.size	.L.str.11, 27

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"    Total number of add inst. : %.2f Gops\n"
	.size	.L.str.13, 43

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"    Elaped time: %.4f msec\n"
	.size	.L.str.14, 28

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"    GFLOPS : %.4f gflops [Avg. of %d time(s)]\n"
	.size	.L.str.15, 47

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"    [Err] GT(%llu) != Pred(%llu)\n"
	.size	.L.str.17, 34

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"    [Pass] GT(%llu) == Pred(%llu)\n"
	.size	.L.str.18, 35

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"CUDA assert: %s %s %d\n"
	.size	.L.str.20, 23

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z29reduction_blocked_shared_halfPyS_y"
	.size	.L__unnamed_1, 39

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z24reduction_blocked_sharedPyS_y"
	.size	.L__unnamed_2, 34

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z17reduction_blockedPyS_y"
	.size	.L__unnamed_3, 27

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z9reductionPyyy"
	.size	.L__unnamed_4, 17

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y"
	.size	.L__unnamed_5, 58

	.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	"Kernel mode : 4.Blocked shared half unrolled reduction"
	.size	.Lstr, 55

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Kernel mode : 3.Blocked shared half reduction"
	.size	.Lstr.1, 46

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"Kernel mode : 2.Blocked shared reduction"
	.size	.Lstr.2, 41

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Kernel mode : 1.Blocked reduction"
	.size	.Lstr.3, 34

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"Kernel mode : 0.Basic reduction"
	.size	.Lstr.4, 32

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"Selected not implemented mode..."
	.size	.Lstr.5, 33

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"\n\n======================================================================="
	.size	.Lstr.6, 74

	.type	.Lstr.7,@object                 # @str.7
.Lstr.7:
	.asciz	"== Parallel DTYPE reduction"
	.size	.Lstr.7, 28

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"======================================================================="
	.size	.Lstr.8, 72

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"Check result ..."
	.size	.Lstr.9, 17

	.type	.Lstr.10,@object                # @str.10
.Lstr.10:
	.asciz	"=======================================================================\n"
	.size	.Lstr.10, 73

	.type	.Lstr.11,@object                # @str.11
.Lstr.11:
	.asciz	"Not implemented"
	.size	.Lstr.11, 16

	.type	.Lswitch.table._Z11select_modeiPPKc,@object # @switch.table._Z11select_modeiPPKc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.Lswitch.table._Z11select_modeiPPKc:
	.quad	.Lstr.4
	.quad	.Lstr.3
	.quad	.Lstr.2
	.quad	.Lstr.1
	.quad	.Lstr
	.size	.Lswitch.table._Z11select_modeiPPKc, 40

	.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 _Z53__device_stub__reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.addrsig_sym _Z44__device_stub__reduction_blocked_shared_halfPyS_y
	.addrsig_sym _Z39__device_stub__reduction_blocked_sharedPyS_y
	.addrsig_sym _Z32__device_stub__reduction_blockedPyS_y
	.addrsig_sym _Z24__device_stub__reductionPyyy
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.addrsig_sym _Z29reduction_blocked_shared_halfPyS_y
	.addrsig_sym _Z24reduction_blocked_sharedPyS_y
	.addrsig_sym _Z17reduction_blockedPyS_y
	.addrsig_sym _Z9reductionPyyy
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z29reduction_blocked_shared_halfPyS_y ; -- Begin function _Z29reduction_blocked_shared_halfPyS_y
	.globl	_Z29reduction_blocked_shared_halfPyS_y
	.p2align	8
	.type	_Z29reduction_blocked_shared_halfPyS_y,@function
_Z29reduction_blocked_shared_halfPyS_y: ; @_Z29reduction_blocked_shared_halfPyS_y
; %bb.0:
	s_clause 0x2
	s_load_b32 s5, s[0:1], 0x24
	s_load_b64 s[6:7], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	v_mov_b32_e32 v1, 0
	s_mov_b32 s4, s15
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_mov_b32_e32 v3, v1
	s_waitcnt lgkmcnt(0)
	s_and_b32 s5, s5, 0xffff
	s_mul_i32 s8, s15, s5
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshl_add_u32 v2, s8, 1, v0
	s_mov_b32 s8, exec_lo
	v_cmpx_gt_u64_e64 s[6:7], v[2:3]
	s_cbranch_execz .LBB0_4
; %bb.1:
	v_lshlrev_b64 v[3:4], 3, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s0, v3
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v4, vcc_lo
	v_add_co_u32 v7, s0, v2, s5
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v8, null, 0, 0, s0
	global_load_b64 v[3:4], v[5:6], off
	s_mov_b32 s0, exec_lo
	v_cmpx_gt_u64_e64 s[6:7], v[7:8]
	s_cbranch_execz .LBB0_3
; %bb.2:
	s_lshl_b32 s1, s5, 3
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_co_u32 v5, vcc_lo, v5, s1
	v_add_co_ci_u32_e32 v6, vcc_lo, 0, v6, vcc_lo
	global_load_b64 v[5:6], v[5:6], off
	s_waitcnt vmcnt(0)
	v_add_co_u32 v3, vcc_lo, v5, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, v6, v4, vcc_lo
.LBB0_3:                                ; %.sink.split
	s_or_b32 exec_lo, exec_lo, s0
	v_lshl_add_u32 v5, v0, 3, 0
	s_waitcnt vmcnt(0)
	ds_store_b64 v5, v[3:4]
.LBB0_4:                                ; %Flow42
	s_or_b32 exec_lo, exec_lo, s8
	s_cmp_lt_u32 s5, 2
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB0_9
; %bb.5:                                ; %.lr.ph
	v_lshl_add_u32 v3, v0, 3, 0
	s_lshr_b32 s8, s5, 1
	s_mov_b32 s9, 0
.LBB0_6:                                ; =>This Inner Loop Header: Depth=1
	v_add_co_u32 v4, s0, s8, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e64 v5, null, s9, 0, s0
	v_cmp_gt_u64_e32 vcc_lo, s[8:9], v[0:1]
	v_cmp_gt_u64_e64 s0, s[6:7], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, vcc_lo, s0
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	v_lshl_add_u32 v4, s8, 3, v3
	ds_load_b64 v[4:5], v4
	ds_load_b64 v[6:7], v3
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, v6, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, v7, v5, vcc_lo
	ds_store_b64 v3, v[4:5]
.LBB0_8:                                ;   in Loop: Header=BB0_6 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
	v_cmp_lt_u64_e64 s0, s[8:9], 2
	s_lshr_b64 s[8:9], s[8:9], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccz .LBB0_6
.LBB0_9:                                ; %._crit_edge
	s_mov_b32 s5, 0
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_11
; %bb.10:
	v_mov_b32_e32 v2, 0
	s_lshl_b64 s[0:1], s[4:5], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s2, s0
	s_addc_u32 s1, s3, s1
	ds_load_b64 v[0:1], v2
	s_waitcnt lgkmcnt(0)
	global_store_b64 v2, v[0:1], s[0:1]
.LBB0_11:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z29reduction_blocked_shared_halfPyS_y
		.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 9
		.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	_Z29reduction_blocked_shared_halfPyS_y, .Lfunc_end0-_Z29reduction_blocked_shared_halfPyS_y
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 472
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; 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	_Z24reduction_blocked_sharedPyS_y ; -- Begin function _Z24reduction_blocked_sharedPyS_y
	.globl	_Z24reduction_blocked_sharedPyS_y
	.p2align	8
	.type	_Z24reduction_blocked_sharedPyS_y,@function
_Z24reduction_blocked_sharedPyS_y:      ; @_Z24reduction_blocked_sharedPyS_y
; %bb.0:
	s_clause 0x2
	s_load_b32 s5, s[0:1], 0x24
	s_load_b64 s[6:7], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	v_mov_b32_e32 v1, 0
	s_mov_b32 s4, s15
	v_lshl_add_u32 v4, v0, 3, 0
	s_mov_b32 s8, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s5, s5, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s4, s5, v[0:1]
	v_mov_b32_e32 v3, v1
	v_cmpx_gt_u64_e64 s[6:7], v[2:3]
	s_cbranch_execz .LBB1_2
; %bb.1:
	v_lshlrev_b64 v[5:6], 3, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s0, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v6, vcc_lo
	global_load_b64 v[5:6], v[5:6], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v4, v[5:6]
.LBB1_2:
	s_or_b32 exec_lo, exec_lo, s8
	s_cmp_lt_u32 s5, 2
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB1_7
; %bb.3:                                ; %.lr.ph
	s_lshr_b32 s8, s5, 1
	s_mov_b32 s9, 0
.LBB1_4:                                ; =>This Inner Loop Header: Depth=1
	v_add_co_u32 v5, s0, s8, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e64 v6, null, s9, 0, s0
	v_cmp_gt_u64_e32 vcc_lo, s[8:9], v[0:1]
	v_cmp_gt_u64_e64 s0, s[6:7], v[5:6]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, vcc_lo, s0
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB1_6
; %bb.5:                                ;   in Loop: Header=BB1_4 Depth=1
	v_lshl_add_u32 v3, s8, 3, v4
	ds_load_b64 v[5:6], v3
	ds_load_b64 v[7:8], v4
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v5, vcc_lo, v7, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, v8, v6, vcc_lo
	ds_store_b64 v4, v[5:6]
.LBB1_6:                                ;   in Loop: Header=BB1_4 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
	v_cmp_lt_u64_e64 s0, s[8:9], 2
	s_lshr_b64 s[8:9], s[8:9], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccz .LBB1_4
.LBB1_7:                                ; %._crit_edge
	s_mov_b32 s5, 0
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB1_9
; %bb.8:
	v_mov_b32_e32 v2, 0
	s_lshl_b64 s[0:1], s[4:5], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s2, s0
	s_addc_u32 s1, s3, s1
	ds_load_b64 v[0:1], v2
	s_waitcnt lgkmcnt(0)
	global_store_b64 v2, v[0:1], s[0:1]
.LBB1_9:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z24reduction_blocked_sharedPyS_y
		.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 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z24reduction_blocked_sharedPyS_y, .Lfunc_end1-_Z24reduction_blocked_sharedPyS_y
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 372
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; 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	_Z17reduction_blockedPyS_y ; -- Begin function _Z17reduction_blockedPyS_y
	.globl	_Z17reduction_blockedPyS_y
	.p2align	8
	.type	_Z17reduction_blockedPyS_y,@function
_Z17reduction_blockedPyS_y:             ; @_Z17reduction_blockedPyS_y
; %bb.0:
	s_clause 0x2
	s_load_b32 s3, s[0:1], 0x24
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[8:9], s[0:1], 0x10
	v_mov_b32_e32 v1, 0
	s_mov_b32 s2, s15
	s_mov_b32 s11, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s0, s3, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s2, s0, v[0:1]
	v_mov_b32_e32 v5, v1
	s_cmp_lt_u32 s0, 2
	v_lshlrev_b64 v[2:3], 3, v[4:5]
	s_cbranch_scc1 .LBB2_5
; %bb.1:                                ; %.lr.ph
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v3, vcc_lo
	s_lshr_b32 s10, s0, 1
.LBB2_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s0, s10, v4
	v_add_co_ci_u32_e64 v8, null, s11, 0, s0
	v_cmp_gt_u64_e32 vcc_lo, s[10:11], v[0:1]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_u64_e64 s0, s[8:9], v[7:8]
	s_and_b32 s1, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB2_4
; %bb.3:                                ;   in Loop: Header=BB2_2 Depth=1
	s_lshl_b64 s[12:13], s[10:11], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_co_u32 v7, vcc_lo, v5, s12
	v_add_co_ci_u32_e32 v8, vcc_lo, s13, v6, vcc_lo
	s_clause 0x1
	global_load_b64 v[7:8], v[7:8], off
	global_load_b64 v[9:10], v[5:6], off
	s_waitcnt vmcnt(0)
	v_add_co_u32 v7, vcc_lo, v9, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, v10, v8, vcc_lo
	global_store_b64 v[5:6], v[7:8], off
.LBB2_4:                                ;   in Loop: Header=BB2_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
	v_cmp_lt_u64_e64 s0, s[10:11], 2
	s_lshr_b64 s[10:11], s[10:11], 1
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccz .LBB2_2
.LBB2_5:                                ; %._crit_edge
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB2_7
; %bb.6:
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v3, vcc_lo
	s_mov_b32 s3, 0
	v_mov_b32_e32 v2, 0
	s_lshl_b64 s[0:1], s[2:3], 3
	global_load_b64 v[0:1], v[0:1], off
	s_add_u32 s0, s6, s0
	s_addc_u32 s1, s7, s1
	s_waitcnt vmcnt(0)
	global_store_b64 v2, v[0:1], s[0:1]
.LBB2_7:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17reduction_blockedPyS_y
		.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 11
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z17reduction_blockedPyS_y, .Lfunc_end2-_Z17reduction_blockedPyS_y
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 340
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 1
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z9reductionPyyy        ; -- Begin function _Z9reductionPyyy
	.globl	_Z9reductionPyyy
	.p2align	8
	.type	_Z9reductionPyyy,@function
_Z9reductionPyyy:                       ; @_Z9reductionPyyy
; %bb.0:
	s_clause 0x2
	s_load_b32 s6, s[0:1], 0x24
	s_load_b64 s[4:5], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s6, s6, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s6, v[0:1]
	v_add_co_u32 v2, s6, v1, s4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, 0, s5, s6
	v_cmp_gt_u64_e32 vcc_lo, s[2:3], v[2:3]
	v_mov_b32_e32 v2, 0
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB3_2
; %bb.1:
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_lshl_b64 s[0:1], s[4:5], 3
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_add_co_u32 v2, vcc_lo, v0, s0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v1, vcc_lo
	s_clause 0x1
	global_load_b64 v[2:3], v[2:3], off
	global_load_b64 v[4:5], v[0:1], off
	s_waitcnt vmcnt(0)
	v_add_co_u32 v2, vcc_lo, v4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, v5, v3, vcc_lo
	global_store_b64 v[0:1], v[2:3], off
.LBB3_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9reductionPyyy
		.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 6
		.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_end3:
	.size	_Z9reductionPyyy, .Lfunc_end3-_Z9reductionPyyy
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 196
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; 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
	.section	.text._Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,"axG",@progbits,_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,comdat
	.protected	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y ; -- Begin function _Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.globl	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
	.p2align	8
	.type	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,@function
_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y: ; @_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
; %bb.0:
	s_clause 0x1
	s_load_b64 s[6:7], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	s_mov_b32 s4, s15
	s_mov_b32 s5, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[8:9], s[4:5], 8
	v_add_co_u32 v1, s8, s8, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v2, null, s9, 0, s8
	s_mov_b32 s8, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_u64_e64 s[6:7], v[1:2]
	s_cbranch_execz .LBB4_4
; %bb.1:
	v_lshlrev_b64 v[3:4], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s0, v3
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v4, vcc_lo
	v_add_co_u32 v7, vcc_lo, 0x80, v1
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v2, vcc_lo
	global_load_b64 v[3:4], v[5:6], off
	s_mov_b32 s0, exec_lo
	v_cmpx_gt_u64_e64 s[6:7], v[7:8]
	s_cbranch_execz .LBB4_3
; %bb.2:
	global_load_b64 v[5:6], v[5:6], off offset:1024
	s_waitcnt vmcnt(0)
	v_add_co_u32 v3, vcc_lo, v5, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, v6, v4, vcc_lo
.LBB4_3:                                ; %.sink.split
	s_or_b32 exec_lo, exec_lo, s0
	v_lshl_add_u32 v5, v0, 3, 0
	s_waitcnt vmcnt(0)
	ds_store_b64 v5, v[3:4]
.LBB4_4:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s8
	v_add_co_u32 v3, vcc_lo, v1, 64
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v2, vcc_lo
	v_cmp_gt_u32_e64 s0, 64, v0
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u64_e32 vcc_lo, s[6:7], v[3:4]
	v_lshl_add_u32 v3, v0, 3, 0
	buffer_gl0_inv
	s_and_b32 s1, s0, vcc_lo
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB4_6
; %bb.5:
	ds_load_2addr_stride64_b64 v[4:7], v3 offset1:1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, v4, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, v5, v7, vcc_lo
	ds_store_b64 v3, v[4:5]
.LBB4_6:
	s_or_b32 exec_lo, exec_lo, s0
	v_add_co_u32 v4, vcc_lo, v1, 32
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v2, vcc_lo
	v_cmp_gt_u32_e64 s0, 32, v0
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u64_e32 vcc_lo, s[6:7], v[4:5]
	buffer_gl0_inv
	s_and_b32 s1, s0, vcc_lo
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB4_8
; %bb.7:
	ds_load_2addr_b64 v[4:7], v3 offset1:32
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, v4, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, v5, v7, vcc_lo
	ds_store_b64 v3, v[4:5]
.LBB4_8:
	s_or_b32 exec_lo, exec_lo, s0
	v_add_co_u32 v4, vcc_lo, v1, 16
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v2, vcc_lo
	v_cmp_gt_u32_e64 s0, 16, v0
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u64_e32 vcc_lo, s[6:7], v[4:5]
	buffer_gl0_inv
	s_and_b32 s1, s0, vcc_lo
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB4_10
; %bb.9:
	ds_load_2addr_b64 v[4:7], v3 offset1:16
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, v4, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, v5, v7, vcc_lo
	ds_store_b64 v3, v[4:5]
.LBB4_10:
	s_or_b32 exec_lo, exec_lo, s0
	v_add_co_u32 v4, vcc_lo, v1, 8
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v2, vcc_lo
	v_cmp_gt_u32_e64 s0, 8, v0
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u64_e32 vcc_lo, s[6:7], v[4:5]
	buffer_gl0_inv
	s_and_b32 s1, s0, vcc_lo
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB4_12
; %bb.11:
	ds_load_2addr_b64 v[4:7], v3 offset1:8
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, v4, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, v5, v7, vcc_lo
	ds_store_b64 v3, v[4:5]
.LBB4_12:
	s_or_b32 exec_lo, exec_lo, s0
	v_add_co_u32 v4, vcc_lo, v1, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v2, vcc_lo
	v_cmp_gt_u32_e64 s0, 4, v0
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u64_e32 vcc_lo, s[6:7], v[4:5]
	buffer_gl0_inv
	s_and_b32 s1, s0, vcc_lo
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB4_14
; %bb.13:
	ds_load_2addr_b64 v[4:7], v3 offset1:4
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, v4, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, v5, v7, vcc_lo
	ds_store_b64 v3, v[4:5]
.LBB4_14:
	s_or_b32 exec_lo, exec_lo, s0
	v_add_co_u32 v4, vcc_lo, v1, 2
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v2, vcc_lo
	v_cmp_gt_u32_e64 s0, 2, v0
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u64_e32 vcc_lo, s[6:7], v[4:5]
	buffer_gl0_inv
	s_and_b32 s1, s0, vcc_lo
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB4_16
; %bb.15:
	ds_load_2addr_b64 v[4:7], v3 offset1:2
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, v4, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, v5, v7, vcc_lo
	ds_store_b64 v3, v[4:5]
.LBB4_16:
	s_or_b32 exec_lo, exec_lo, s0
	v_add_co_u32 v1, vcc_lo, v1, 1
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v2, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u64_e64 s0, s[6:7], v[1:2]
	buffer_gl0_inv
	s_and_b32 s0, vcc_lo, s0
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB4_18
; %bb.17:
	ds_load_2addr_b64 v[4:7], v3 offset1:1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, s0, v4, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, s0, v5, v7, s0
	ds_store_b64 v3, v[0:1]
.LBB4_18:
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s0, vcc_lo
	s_cbranch_execz .LBB4_20
; %bb.19:
	v_mov_b32_e32 v2, 0
	s_lshl_b64 s[0:1], s[4:5], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s2, s0
	s_addc_u32 s1, s3, s1
	ds_load_b64 v[0:1], v2
	s_waitcnt lgkmcnt(0)
	global_store_b64 v2, v[0:1], s[0:1]
.LBB4_20:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.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 9
		.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
	.section	.text._Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,"axG",@progbits,_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y,comdat
.Lfunc_end4:
	.size	_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y, .Lfunc_end4-_Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 928
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; 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:           8
        .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
      - .offset:         144
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .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:           _Z29reduction_blocked_shared_halfPyS_y
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z29reduction_blocked_shared_halfPyS_y.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .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:           8
        .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
      - .offset:         144
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .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:           _Z24reduction_blocked_sharedPyS_y
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z24reduction_blocked_sharedPyS_y.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .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:           8
        .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:           _Z17reduction_blockedPyS_y
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17reduction_blockedPyS_y.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .offset:         16
        .size:           8
        .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:           _Z9reductionPyyy
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9reductionPyyy.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .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:           8
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 24
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z38reduction_blocked_shared_half_unrolledILm128EEvPyS0_y.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
