#include <iostream>
#include <math.h>
#include <ctime>
#include <cstdlib>
#include <chrono>
#include <cuda_runtime.h>

using namespace std;

struct stats {
    double mean;
    double min;
    double max;
    double stddev;
};

    
// CPU function to find mean of an array
double cpu_get_mean(int n, double *x) {
    double sum = 0;
    for (int i = 0; i < n; i++) {
        sum += x[i];
    }
    return sum/n;
}

// use CPU to calculate std deviation (Welford's algorithm)
double cpu_get_stddev(int n, double *x){
    double mean = x[0];
    double m2 = 0;
    double delta;
    double delta2;
    for (int i = 1; i < n; i++){
        delta = x[i] - mean;
        mean += delta/(i+1);
        delta2 = x[i] - mean;
        m2 += delta * delta2;
    }
    return sqrt(m2/n);
}

// CPU function to find max element of an array
double cpu_get_max(int n, double *x) {
    double max = x[0];
    for (int i = 1; i < n; i++) {
        max = (max < x[i]) ? x[i] : max;
    }
    return max;
}

// CPU function to find min element of an array
double cpu_get_min(int n, double *x) {
    double min = x[0];
    for (int i = 1; i < n; i++) {
        min = (x[i] < min) ? x[i] : min;
    }
    return min;
}

// use CPU to calculate min, mean, max, std deviation (Welford's algorithm)
stats cpu_get_all(int n, double *x){
    stats myStats; 
    double mean = x[0];
    double min = x[0];
    double max = x[0];
    double m2 = 0;
    double delta;
    double delta2;
    for (int i = 1; i < n; i++){
        max = (max < x[i]) ? x[i] : max;
        min = (x[i] < min) ? x[i] : min;
        delta = x[i] - mean;
        mean += delta/(i+1);
        delta2 = x[i] - mean;
        m2 += delta * delta2;
    }
    myStats.mean = mean;
    myStats.min = min;
    myStats.max = max;
    myStats.stddev = sqrt(m2/n);
    return myStats;
}

// Kernel function to find the maximum element of an array
__global__ void get_gpu_max(int n, double *x, double *results) {
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double max = x[index];
    for (int i = index + stride; i < n; i += stride) {
        max = (max < x[i]) ? x[i] : max;
    }
    results[index] = max;
}

// Kernel function to find the minimum element of an array
__global__ void get_gpu_min(int n, double *x, double *results) {
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double min = x[index];
    for (int i = index + stride; i < n; i += stride) {
        min = (x[i] < min) ? x[i] : min;
    }
    results[index] = min;
}

// kernel to calculate the mean on the GPU
__global__ void get_gpu_mean(int n, double *x, double *results) {
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double mean = x[index];
    int count = 1;
    for (int i = index + stride; i < n; i += stride){
        count++;
        mean += (x[i] - mean)/count;
    }
    results[index] = mean;
}

// Calculate std deviation on the GPU
__global__ void get_gpu_stddev(int n, double *x, double *results){
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double mean = x[index];
    double m2 = 0;
    double delta;
    double delta2;
    int count = 1;
    for (int i = index + stride; i < n; i += stride){
        count++;
        delta = x[i] - mean;
        mean += delta/count;
        delta2 = x[i] - mean;
        m2 += delta * delta2;
    }
    results[index] = m2;
}



// caluclate all stats on the GPU
__global__ void get_gpu_all(int n, double *x, stats *all_results){
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double mean = x[index];
    double min = x[index];
    double max = x[index];
    double m2 = 0;
    double delta;
    double delta2;
    int count = 1;
    for (int i = index + stride; i < n; i += stride){
        max = (max < x[i]) ? x[i] : max;
        min = (x[i] < min) ? x[i] : min;
        count++;
        delta = x[i] - mean;
        mean += delta/count;
        delta2 = x[i] - mean;
        m2 += delta * delta2;
    }
    all_results[index].mean = mean;
    all_results[index].min = min;
    all_results[index].max = max;
    all_results[index].stddev = m2; // m2 not actually std dev
}

void print_diff(double x, double y){
    cout << "Difference: " << 100*(y - x)/x << "%\n";
}


void run_tests(int N_pre, int N_BLOCKS, int THREADS_PER_BLK) {

    // We need N to be a multiple of N_THREADS
    int N = N_BLOCKS * THREADS_PER_BLK * floor(N_pre / (THREADS_PER_BLK * N_BLOCKS));
    
    /**  
    cout << "N = " << N << endl;
    cout << "N_BLOCKS = " << N_BLOCKS << endl;
    cout << "THREADS_PER_BLK = " << THREADS_PER_BLK << endl;
    cout << "Allocating memory and initializing...";
    **/
    double *x;
    cudaMallocManaged(&x, N*sizeof(double));
    srand(time(NULL));
    for (int i = 0; i < N; i++) {
      x[i] = ((double) rand()) / ((double) RAND_MAX);
    }
    double *results;
    cudaMallocManaged(&results, N_BLOCKS*THREADS_PER_BLK*sizeof(double));

    // use CPU to calculate max
    auto start = std::chrono::high_resolution_clock::now();
    double cpu_max = cpu_get_max(N, x);
    auto end = std::chrono::high_resolution_clock::now();
    auto dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    // cout << "CPU calculated max:" << fixed << cpu_max << endl;
    // fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,max,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());


    // use GPU to calculate max
    start = std::chrono::high_resolution_clock::now();
    get_gpu_max<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, results);
    cudaDeviceSynchronize();
    double gpu_max = results[0];
    for (int i = 1; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        gpu_max = (gpu_max < results[i]) ? results[i] : gpu_max;
    }
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "GPU calculated max:" << fixed << gpu_max << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,max,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    //print_diff(cpu_max, gpu_max);
    //cout << endl;

    // use CPU to calculate min
    start = std::chrono::high_resolution_clock::now();
    double cpu_min = cpu_get_min(N, x);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "CPU calculated min:" << fixed << cpu_min << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,min,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    // use GPU to calculate min
    start = std::chrono::high_resolution_clock::now();
    get_gpu_min<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, results);
    cudaDeviceSynchronize();
    double gpu_min = results[0];
    for (int i = 1; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        gpu_min = (results[i] < gpu_min) ? results[i] : gpu_min;
    }
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "GPU calculated min:" << fixed << gpu_min << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,min,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    //print_diff(cpu_min, gpu_min);
    //cout << endl;

    // use CPU to calculate mean
    start = std::chrono::high_resolution_clock::now();
    double cpu_mean = cpu_get_mean(N, x);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "CPU calculated mean:" << fixed << cpu_mean << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,avg,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    // use GPU to calculate mean
    start = std::chrono::high_resolution_clock::now();
    get_gpu_mean<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, results);
    cudaDeviceSynchronize();
    double gpu_mean_sum = 0;
    for (int i = 0; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        gpu_mean_sum += results[i];
    }
    double gpu_mean = gpu_mean_sum/(N_BLOCKS*THREADS_PER_BLK);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "GPU calculated mean:" << fixed << gpu_mean << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,avg,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    //print_diff(cpu_mean, gpu_mean);
    //cout << endl;

    // use CPU to calculate std dev
    start = std::chrono::high_resolution_clock::now();
    double cpu_stddev = cpu_get_stddev(N, x);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "CPU calculated std dev:" << fixed << cpu_stddev << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,dev,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    // use GPU to calculate std dev
    start = std::chrono::high_resolution_clock::now();
    get_gpu_stddev<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, results);
    cudaDeviceSynchronize();
    double gpu_m2 = 0;
    for (int i = 0; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        gpu_m2 += results[i];
    }
    double gpu_stddev = sqrt(gpu_m2/N);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "GPU calculated std dev:" << fixed << gpu_stddev << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,dev,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());
    /**
    print_diff(cpu_stddev, gpu_stddev);
    cout << endl;
    **/

    // use CPU to calculate all stats
    start = std::chrono::high_resolution_clock::now();
    stats my_stats = cpu_get_all(N, x);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    /**
    cout << "Concurrent: CPU calculated max:" << fixed << my_stats.max << endl;
    cout << "Concurrent: CPU calculated min:" << fixed << my_stats.min << endl;
    cout << "Concurrent: CPU calculated mean:" << fixed << my_stats.mean << endl;
    cout << "Concurrent: CPU calculated std dev:" << fixed << my_stats.stddev << endl;
    fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    **/
    fprintf(stdout,"%d,%d,%d,all,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());
    

    cudaFree(results);

    // use GPU to calculate all stats
    stats* all_results;
    cudaMallocManaged(&all_results, N_BLOCKS*THREADS_PER_BLK*sizeof(stats));
    
    // start the timer
    start = std::chrono::high_resolution_clock::now();

    // run calculations on the GPU
    get_gpu_all<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, all_results);

    // synchrnonize 
    cudaDeviceSynchronize();

    // We now need to accumulate results from all threads
    double m2 = all_results[0].stddev;
    double mean = all_results[0].mean;
    double delta;
    double new_mean;
    int n_a = N / (N_BLOCKS*THREADS_PER_BLK); 
    int n_b = n_a;
    double max = all_results[0].max;
    double min = all_results[0].min;
    for (int i = 1; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        new_mean = all_results[i].mean;
        delta = new_mean - mean;

        // we update our running mean value
        mean = (n_a*mean + n_b*new_mean)/(n_a + n_b);

        m2 += all_results[i].stddev + delta * delta * n_a * n_b / (n_a + n_b);

        n_a += n_b;

        min = (all_results[i].min < min) ? all_results[i].min : min;
        max = (all_results[i].max > max) ? all_results[i].max : max;
    }
    double stddev = sqrt(m2/N);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    /**
    cout << "Concurrent: GPU calculated max:" << fixed << max << endl;
    cout << "Concurrent: GPU calculated min:" << fixed << min << endl;
    cout << "Concurrent: GPU calculated mean:" << fixed << mean << endl;
    cout << "Concurrent: GPU calculated std dev:" << fixed << stddev << endl;
    fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    **/
    fprintf(stdout,"%d,%d,%d,all,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());
    
    // Free memory
    cudaFree(x);
    cudaFree(all_results);
}


int main(void) {

    // We want to display floats with max precision
    cout.precision(17);

    int Ns[] = {50000000,100000000,150000000,200000000};
    int TPBs[] = {128, 256, 512, 1024};
    int NBs[] = {1, 4, 16, 28};

    for (int n : Ns) {
        for (int threads_per_block : TPBs) {
            for (int n_blocks : NBs) {
                run_tests(n, n_blocks, threads_per_block); 
            }
        }
    }
   
}

	.file	"tmpxft_0037f601_00000000-6_stats.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3746:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3746:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z12cpu_get_meaniPd
	.type	_Z12cpu_get_meaniPd, @function
_Z12cpu_get_meaniPd:
.LFB3734:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L3:
	cmpl	%eax, %edi
	jle	.L6
	addsd	(%rsi,%rax,8), %xmm0
	incq	%rax
	jmp	.L3
.L6:
	cvtsi2sdl	%edi, %xmm1
	divsd	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE3734:
	.size	_Z12cpu_get_meaniPd, .-_Z12cpu_get_meaniPd
	.globl	_Z14cpu_get_stddeviPd
	.type	_Z14cpu_get_stddeviPd, @function
_Z14cpu_get_stddeviPd:
.LFB3735:
	.cfi_startproc
	endbr64
	movsd	(%rsi), %xmm2
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L8:
	incq	%rax
	cmpl	%eax, %edi
	jle	.L10
	movsd	(%rsi,%rax,8), %xmm1
	leal	1(%rax), %edx
	cvtsi2sdl	%edx, %xmm5
	movaps	%xmm1, %xmm3
	subsd	%xmm2, %xmm3
	movaps	%xmm3, %xmm4
	divsd	%xmm5, %xmm4
	addsd	%xmm4, %xmm2
	subsd	%xmm2, %xmm1
	mulsd	%xmm3, %xmm1
	addsd	%xmm1, %xmm0
	jmp	.L8
.L10:
	cvtsi2sdl	%edi, %xmm1
	divsd	%xmm1, %xmm0
	jmp	sqrt@PLT
	.cfi_endproc
.LFE3735:
	.size	_Z14cpu_get_stddeviPd, .-_Z14cpu_get_stddeviPd
	.globl	_Z11cpu_get_maxiPd
	.type	_Z11cpu_get_maxiPd, @function
_Z11cpu_get_maxiPd:
.LFB3736:
	.cfi_startproc
	endbr64
	movsd	(%rsi), %xmm0
	movl	$1, %eax
.L12:
	cmpl	%eax, %edi
	jle	.L15
	movsd	(%rsi,%rax,8), %xmm1
	incq	%rax
	maxsd	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	jmp	.L12
.L15:
	ret
	.cfi_endproc
.LFE3736:
	.size	_Z11cpu_get_maxiPd, .-_Z11cpu_get_maxiPd
	.globl	_Z11cpu_get_miniPd
	.type	_Z11cpu_get_miniPd, @function
_Z11cpu_get_miniPd:
.LFB3737:
	.cfi_startproc
	endbr64
	movsd	(%rsi), %xmm0
	movl	$1, %eax
.L17:
	cmpl	%eax, %edi
	jle	.L20
	movsd	(%rsi,%rax,8), %xmm1
	incq	%rax
	minsd	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	jmp	.L17
.L20:
	ret
	.cfi_endproc
.LFE3737:
	.size	_Z11cpu_get_miniPd, .-_Z11cpu_get_miniPd
	.globl	_Z11cpu_get_alliPd
	.type	_Z11cpu_get_alliPd, @function
_Z11cpu_get_alliPd:
.LFB3738:
	.cfi_startproc
	endbr64
	movsd	(%rdx), %xmm2
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$1, %eax
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movaps	%xmm2, %xmm4
	movaps	%xmm2, %xmm3
.L22:
	cmpl	%eax, %esi
	jle	.L29
	movsd	(%rdx,%rax,8), %xmm1
	leal	1(%rax), %ecx
	incq	%rax
	movaps	%xmm1, %xmm7
	movaps	%xmm1, %xmm6
	movaps	%xmm1, %xmm5
	minsd	%xmm4, %xmm7
	subsd	%xmm3, %xmm5
	maxsd	%xmm2, %xmm6
	movaps	%xmm7, %xmm4
	cvtsi2sdl	%ecx, %xmm7
	movaps	%xmm6, %xmm2
	movaps	%xmm5, %xmm6
	divsd	%xmm7, %xmm6
	addsd	%xmm6, %xmm3
	subsd	%xmm3, %xmm1
	mulsd	%xmm5, %xmm1
	addsd	%xmm1, %xmm0
	jmp	.L22
.L29:
	cvtsi2sdl	%esi, %xmm1
	movsd	%xmm3, (%rbx)
	movsd	%xmm4, 8(%rbx)
	movsd	%xmm2, 16(%rbx)
	divsd	%xmm1, %xmm0
	call	sqrt@PLT
	movq	%rbx, %rax
	movsd	%xmm0, 24(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3738:
	.size	_Z11cpu_get_alliPd, .-_Z11cpu_get_alliPd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Difference: "
.LC3:
	.string	"%\n"
	.text
	.globl	_Z10print_diffdd
	.type	_Z10print_diffdd, @function
_Z10print_diffdd:
.LFB3739:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movsd	%xmm0, 8(%rsp)
	movsd	%xmm1, (%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	8(%rsp), %xmm2
	movsd	(%rsp), %xmm1
	movsd	.LC2(%rip), %xmm0
	movq	%rax, %rdi
	subsd	%xmm2, %xmm1
	mulsd	%xmm1, %xmm0
	divsd	%xmm2, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC3(%rip), %rsi
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	movq	%rax, %rdi
	jmp	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	.cfi_endproc
.LFE3739:
	.size	_Z10print_diffdd, .-_Z10print_diffdd
	.globl	_Z34__device_stub__Z11get_gpu_maxiPdS_iPdS_
	.type	_Z34__device_stub__Z11get_gpu_maxiPdS_iPdS_, @function
_Z34__device_stub__Z11get_gpu_maxiPdS_iPdS_:
.LFB3768:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movl	%edi, 28(%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	28(%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	.L32
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z11get_gpu_maxiPdS_(%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
.L32:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3768:
	.size	_Z34__device_stub__Z11get_gpu_maxiPdS_iPdS_, .-_Z34__device_stub__Z11get_gpu_maxiPdS_iPdS_
	.globl	_Z11get_gpu_maxiPdS_
	.type	_Z11get_gpu_maxiPdS_, @function
_Z11get_gpu_maxiPdS_:
.LFB3769:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z11get_gpu_maxiPdS_iPdS_
	.cfi_endproc
.LFE3769:
	.size	_Z11get_gpu_maxiPdS_, .-_Z11get_gpu_maxiPdS_
	.globl	_Z34__device_stub__Z11get_gpu_miniPdS_iPdS_
	.type	_Z34__device_stub__Z11get_gpu_miniPdS_iPdS_, @function
_Z34__device_stub__Z11get_gpu_miniPdS_iPdS_:
.LFB3770:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movl	%edi, 28(%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	28(%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	.L37
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z11get_gpu_miniPdS_(%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
.L37:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3770:
	.size	_Z34__device_stub__Z11get_gpu_miniPdS_iPdS_, .-_Z34__device_stub__Z11get_gpu_miniPdS_iPdS_
	.globl	_Z11get_gpu_miniPdS_
	.type	_Z11get_gpu_miniPdS_, @function
_Z11get_gpu_miniPdS_:
.LFB3771:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z11get_gpu_miniPdS_iPdS_
	.cfi_endproc
.LFE3771:
	.size	_Z11get_gpu_miniPdS_, .-_Z11get_gpu_miniPdS_
	.globl	_Z35__device_stub__Z12get_gpu_meaniPdS_iPdS_
	.type	_Z35__device_stub__Z12get_gpu_meaniPdS_iPdS_, @function
_Z35__device_stub__Z12get_gpu_meaniPdS_iPdS_:
.LFB3772:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movl	%edi, 28(%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	28(%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	.L42
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z12get_gpu_meaniPdS_(%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
.L42:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3772:
	.size	_Z35__device_stub__Z12get_gpu_meaniPdS_iPdS_, .-_Z35__device_stub__Z12get_gpu_meaniPdS_iPdS_
	.globl	_Z12get_gpu_meaniPdS_
	.type	_Z12get_gpu_meaniPdS_, @function
_Z12get_gpu_meaniPdS_:
.LFB3773:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z12get_gpu_meaniPdS_iPdS_
	.cfi_endproc
.LFE3773:
	.size	_Z12get_gpu_meaniPdS_, .-_Z12get_gpu_meaniPdS_
	.globl	_Z37__device_stub__Z14get_gpu_stddeviPdS_iPdS_
	.type	_Z37__device_stub__Z14get_gpu_stddeviPdS_iPdS_, @function
_Z37__device_stub__Z14get_gpu_stddeviPdS_iPdS_:
.LFB3774:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movl	%edi, 28(%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	28(%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	.L47
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z14get_gpu_stddeviPdS_(%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
.L47:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3774:
	.size	_Z37__device_stub__Z14get_gpu_stddeviPdS_iPdS_, .-_Z37__device_stub__Z14get_gpu_stddeviPdS_iPdS_
	.globl	_Z14get_gpu_stddeviPdS_
	.type	_Z14get_gpu_stddeviPdS_, @function
_Z14get_gpu_stddeviPdS_:
.LFB3775:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z14get_gpu_stddeviPdS_iPdS_
	.cfi_endproc
.LFE3775:
	.size	_Z14get_gpu_stddeviPdS_, .-_Z14get_gpu_stddeviPdS_
	.globl	_Z39__device_stub__Z11get_gpu_alliPdP5statsiPdP5stats
	.type	_Z39__device_stub__Z11get_gpu_alliPdP5statsiPdP5stats, @function
_Z39__device_stub__Z11get_gpu_alliPdP5statsiPdP5stats:
.LFB3776:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movl	%edi, 28(%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	28(%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	.L52
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z11get_gpu_alliPdP5stats(%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
.L52:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3776:
	.size	_Z39__device_stub__Z11get_gpu_alliPdP5statsiPdP5stats, .-_Z39__device_stub__Z11get_gpu_alliPdP5statsiPdP5stats
	.globl	_Z11get_gpu_alliPdP5stats
	.type	_Z11get_gpu_alliPdP5stats, @function
_Z11get_gpu_alliPdP5stats:
.LFB3777:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z11get_gpu_alliPdP5statsiPdP5stats
	.cfi_endproc
.LFE3777:
	.size	_Z11get_gpu_alliPdP5stats, .-_Z11get_gpu_alliPdP5stats
	.section	.rodata.str1.1
.LC5:
	.string	"%d,%d,%d,max,cpu,%lld\n"
.LC6:
	.string	"%d,%d,%d,max,gpu,%lld\n"
.LC7:
	.string	"%d,%d,%d,min,cpu,%lld\n"
.LC8:
	.string	"%d,%d,%d,min,gpu,%lld\n"
.LC9:
	.string	"%d,%d,%d,avg,cpu,%lld\n"
.LC10:
	.string	"%d,%d,%d,avg,gpu,%lld\n"
.LC11:
	.string	"%d,%d,%d,dev,cpu,%lld\n"
.LC12:
	.string	"%d,%d,%d,dev,gpu,%lld\n"
.LC13:
	.string	"%d,%d,%d,all,cpu,%lld\n"
.LC14:
	.string	"%d,%d,%d,all,gpu,%lld\n"
	.text
	.globl	_Z9run_testsiii
	.type	_Z9run_testsiii, @function
_Z9run_testsiii:
.LFB3740:
	.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	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	imull	%edx, %r14d
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	cvtsi2sdl	%r14d, %xmm1
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movl	%edi, %eax
	leaq	56(%rsp), %rdi
	cltd
	idivl	%r14d
	movl	$1, %edx
	cvtsi2sdl	%eax, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %ebx
	movslq	%ebx, %rsi
	salq	$3, %rsi
	call	cudaMallocManaged@PLT
	xorl	%edi, %edi
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
.L58:
	cmpl	%ebp, %ebx
	jle	.L71
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	movq	56(%rsp), %rax
	divsd	.LC4(%rip), %xmm0
	movsd	%xmm0, (%rax,%rbp,8)
	incq	%rbp
	jmp	.L58
.L71:
	movslq	%r14d, %r15
	leaq	64(%rsp), %rdi
	movl	$1, %edx
	leaq	0(,%r15,8), %rsi
	call	cudaMallocManaged@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	%rax, %rbp
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	pushq	%r10
	.cfi_def_cfa_offset 184
	movq	stdout(%rip), %rdi
	leaq	.LC5(%rip), %rdx
	pushq	%rax
	.cfi_def_cfa_offset 192
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r12d, 96(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rax, %rbp
	movl	%r13d, 108(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 100(%rsp)
	movq	%rax, 112(%rsp)
	popq	%r11
	.cfi_def_cfa_offset 184
	popq	%rax
	.cfi_def_cfa_offset 176
	movl	100(%rsp), %ecx
	movq	92(%rsp), %rdx
	movq	80(%rsp), %rdi
	movl	88(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	%ebx, %edi
	call	_Z34__device_stub__Z11get_gpu_maxiPdS_iPdS_
.L60:
	call	cudaDeviceSynchronize@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	pushq	%rdi
	.cfi_def_cfa_offset 184
	movq	stdout(%rip), %rdi
	movl	$2, %esi
	pushq	%rax
	.cfi_def_cfa_offset 192
	leaq	.LC6(%rip), %rdx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	%rax, %rbp
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	movq	stdout(%rip), %rdi
	movl	$2, %esi
	leaq	.LC7(%rip), %rdx
	movq	%rax, (%rsp)
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r12d, 96(%rsp)
	movq	%rax, %rbp
	movl	%r13d, 108(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 100(%rsp)
	movq	%rax, 112(%rsp)
	popq	%r8
	.cfi_def_cfa_offset 184
	xorl	%r8d, %r8d
	popq	%r9
	.cfi_def_cfa_offset 176
	movl	100(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	92(%rsp), %rdx
	movq	80(%rsp), %rdi
	movl	88(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L61
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	%ebx, %edi
	call	_Z34__device_stub__Z11get_gpu_miniPdS_iPdS_
.L61:
	call	cudaDeviceSynchronize@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	pushq	%rdx
	.cfi_def_cfa_offset 184
	movq	stdout(%rip), %rdi
	movl	$2, %esi
	pushq	%rax
	.cfi_def_cfa_offset 192
	leaq	.LC8(%rip), %rdx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	%rax, %rbp
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	movq	stdout(%rip), %rdi
	movl	$2, %esi
	leaq	.LC9(%rip), %rdx
	movq	%rax, (%rsp)
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r12d, 96(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rax, %rbp
	movl	%r13d, 108(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 100(%rsp)
	movq	%rax, 112(%rsp)
	popq	%rcx
	.cfi_def_cfa_offset 184
	popq	%rsi
	.cfi_def_cfa_offset 176
	movl	100(%rsp), %ecx
	movq	92(%rsp), %rdx
	movq	80(%rsp), %rdi
	movl	88(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L62
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	%ebx, %edi
	call	_Z35__device_stub__Z12get_gpu_meaniPdS_iPdS_
.L62:
	call	cudaDeviceSynchronize@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	pushq	%r10
	.cfi_def_cfa_offset 184
	movq	stdout(%rip), %rdi
	leaq	.LC10(%rip), %rdx
	pushq	%rax
	.cfi_def_cfa_offset 192
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	72(%rsp), %rsi
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	_Z14cpu_get_stddeviPd
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	movq	stdout(%rip), %rdi
	movl	$2, %esi
	leaq	.LC11(%rip), %rdx
	movq	%rax, (%rsp)
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r12d, 96(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rax, %rbp
	movl	%r13d, 108(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 100(%rsp)
	movq	%rax, 112(%rsp)
	popq	%r11
	.cfi_def_cfa_offset 184
	popq	%rax
	.cfi_def_cfa_offset 176
	movl	100(%rsp), %ecx
	movq	92(%rsp), %rdx
	movq	80(%rsp), %rdi
	movl	88(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L63
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	%ebx, %edi
	call	_Z37__device_stub__Z14get_gpu_stddeviPdS_iPdS_
.L63:
	call	cudaDeviceSynchronize@PLT
	movq	64(%rsp), %rdx
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L64:
	cmpl	%eax, %r14d
	jle	.L72
	addsd	(%rdx,%rax,8), %xmm0
	incq	%rax
	jmp	.L64
.L72:
	cvtsi2sdl	%ebx, %xmm6
	divsd	%xmm6, %xmm0
	movsd	%xmm6, 8(%rsp)
	call	sqrt@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	pushq	%rdi
	.cfi_def_cfa_offset 184
	movq	stdout(%rip), %rdi
	movl	$2, %esi
	pushq	%rax
	.cfi_def_cfa_offset 192
	leaq	.LC12(%rip), %rdx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	72(%rsp), %rdx
	leaq	32(%rsp), %rdi
	movl	%ebx, %esi
	movq	%rax, %rbp
	call	_Z11cpu_get_alliPd
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%ebx, %ecx
	movl	$2, %esi
	movl	%r13d, %r9d
	subq	%rbp, %rax
	movq	stdout(%rip), %rdi
	leaq	.LC13(%rip), %rdx
	movl	%r12d, %r8d
	movq	%rax, (%rsp)
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	popq	%r8
	.cfi_def_cfa_offset 184
	popq	%r9
	.cfi_def_cfa_offset 176
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	%r15, %rsi
	leaq	72(%rsp), %rdi
	movl	$1, %edx
	salq	$5, %rsi
	call	cudaMallocManaged@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, 92(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rax, %rbp
	movl	%r12d, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 96(%rsp)
	movl	100(%rsp), %ecx
	movq	%rax, 84(%rsp)
	movq	92(%rsp), %rdx
	movq	80(%rsp), %rdi
	movl	88(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L66
	movq	72(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	%ebx, %edi
	call	_Z39__device_stub__Z11get_gpu_alliPdP5statsiPdP5stats
.L66:
	call	cudaDeviceSynchronize@PLT
	movl	%ebx, %eax
	movq	72(%rsp), %rcx
	movl	$1, %esi
	cltd
	idivl	%r14d
	movsd	24(%rcx), %xmm0
	movsd	(%rcx), %xmm2
	leaq	32(%rcx), %rdx
	movl	%eax, %ecx
.L67:
	cmpl	%esi, %r14d
	jle	.L73
	movsd	(%rdx), %xmm4
	cvtsi2sdl	%ecx, %xmm5
	addl	%eax, %ecx
	incl	%esi
	cvtsi2sdl	%eax, %xmm3
	addq	$32, %rdx
	movaps	%xmm4, %xmm1
	subsd	%xmm2, %xmm1
	mulsd	%xmm5, %xmm2
	mulsd	%xmm3, %xmm4
	mulsd	%xmm1, %xmm1
	addsd	%xmm4, %xmm2
	mulsd	%xmm5, %xmm1
	cvtsi2sdl	%ecx, %xmm4
	divsd	%xmm4, %xmm2
	mulsd	%xmm3, %xmm1
	divsd	%xmm4, %xmm1
	addsd	-8(%rdx), %xmm1
	addsd	%xmm1, %xmm0
	jmp	.L67
.L73:
	divsd	8(%rsp), %xmm0
	call	sqrt@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	%r13d, %r9d
	movl	%r12d, %r8d
	movl	%ebx, %ecx
	subq	%rbp, %rax
	pushq	%rdx
	.cfi_def_cfa_offset 184
	movq	stdout(%rip), %rdi
	movl	$2, %esi
	pushq	%rax
	.cfi_def_cfa_offset 192
	leaq	.LC14(%rip), %rdx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	popq	%rcx
	.cfi_def_cfa_offset 184
	popq	%rsi
	.cfi_def_cfa_offset 176
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L69
	call	__stack_chk_fail@PLT
.L69:
	addq	$120, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3740:
	.size	_Z9run_testsiii, .-_Z9run_testsiii
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3743:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movabsq	$429496729650000000, %rax
	movq	$17, 16+_ZSt4cout(%rip)
	movq	%rax, 8(%rsp)
	movabsq	$858993459350000000, %rax
	movq	%rax, 16(%rsp)
	movabsq	$1099511627904, %rax
	movq	%rax, 24(%rsp)
	movabsq	$4398046511616, %rax
	movq	%rax, 32(%rsp)
	movabsq	$17179869185, %rax
	movq	%rax, 40(%rsp)
	movabsq	$120259084304, %rax
	movq	%rax, 48(%rsp)
.L77:
	movl	8(%rsp,%rbx), %r13d
	xorl	%ebp, %ebp
.L76:
	movl	24(%rsp,%rbp), %r14d
	xorl	%r12d, %r12d
.L75:
	movl	40(%rsp,%r12), %esi
	movl	%r14d, %edx
	movl	%r13d, %edi
	addq	$4, %r12
	call	_Z9run_testsiii
	cmpq	$16, %r12
	jne	.L75
	addq	$4, %rbp
	cmpq	$16, %rbp
	jne	.L76
	addq	$4, %rbx
	cmpq	$16, %rbx
	jne	.L77
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L78
	call	__stack_chk_fail@PLT
.L78:
	addq	$64, %rsp
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
.LFE3743:
	.size	main, .-main
	.section	.rodata.str1.1
.LC15:
	.string	"_Z11get_gpu_alliPdP5stats"
.LC16:
	.string	"_Z14get_gpu_stddeviPdS_"
.LC17:
	.string	"_Z12get_gpu_meaniPdS_"
.LC18:
	.string	"_Z11get_gpu_miniPdS_"
.LC19:
	.string	"_Z11get_gpu_maxiPdS_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3779:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC15(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z11get_gpu_alliPdP5stats(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC16(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14get_gpu_stddeviPdS_(%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	.LC17(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z12get_gpu_meaniPdS_(%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	.LC18(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11get_gpu_miniPdS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC19(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11get_gpu_maxiPdS_(%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
.LFE3779:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC4:
	.long	-4194304
	.long	1105199103
	.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 <iostream>
#include <math.h>
#include <ctime>
#include <cstdlib>
#include <chrono>
#include <hip/hip_runtime.h>

using namespace std;

struct stats {
    double mean;
    double min;
    double max;
    double stddev;
};

    
// CPU function to find mean of an array
double cpu_get_mean(int n, double *x) {
    double sum = 0;
    for (int i = 0; i < n; i++) {
        sum += x[i];
    }
    return sum/n;
}

// use CPU to calculate std deviation (Welford's algorithm)
double cpu_get_stddev(int n, double *x){
    double mean = x[0];
    double m2 = 0;
    double delta;
    double delta2;
    for (int i = 1; i < n; i++){
        delta = x[i] - mean;
        mean += delta/(i+1);
        delta2 = x[i] - mean;
        m2 += delta * delta2;
    }
    return sqrt(m2/n);
}

// CPU function to find max element of an array
double cpu_get_max(int n, double *x) {
    double max = x[0];
    for (int i = 1; i < n; i++) {
        max = (max < x[i]) ? x[i] : max;
    }
    return max;
}

// CPU function to find min element of an array
double cpu_get_min(int n, double *x) {
    double min = x[0];
    for (int i = 1; i < n; i++) {
        min = (x[i] < min) ? x[i] : min;
    }
    return min;
}

// use CPU to calculate min, mean, max, std deviation (Welford's algorithm)
stats cpu_get_all(int n, double *x){
    stats myStats; 
    double mean = x[0];
    double min = x[0];
    double max = x[0];
    double m2 = 0;
    double delta;
    double delta2;
    for (int i = 1; i < n; i++){
        max = (max < x[i]) ? x[i] : max;
        min = (x[i] < min) ? x[i] : min;
        delta = x[i] - mean;
        mean += delta/(i+1);
        delta2 = x[i] - mean;
        m2 += delta * delta2;
    }
    myStats.mean = mean;
    myStats.min = min;
    myStats.max = max;
    myStats.stddev = sqrt(m2/n);
    return myStats;
}

// Kernel function to find the maximum element of an array
__global__ void get_gpu_max(int n, double *x, double *results) {
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double max = x[index];
    for (int i = index + stride; i < n; i += stride) {
        max = (max < x[i]) ? x[i] : max;
    }
    results[index] = max;
}

// Kernel function to find the minimum element of an array
__global__ void get_gpu_min(int n, double *x, double *results) {
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double min = x[index];
    for (int i = index + stride; i < n; i += stride) {
        min = (x[i] < min) ? x[i] : min;
    }
    results[index] = min;
}

// kernel to calculate the mean on the GPU
__global__ void get_gpu_mean(int n, double *x, double *results) {
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double mean = x[index];
    int count = 1;
    for (int i = index + stride; i < n; i += stride){
        count++;
        mean += (x[i] - mean)/count;
    }
    results[index] = mean;
}

// Calculate std deviation on the GPU
__global__ void get_gpu_stddev(int n, double *x, double *results){
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double mean = x[index];
    double m2 = 0;
    double delta;
    double delta2;
    int count = 1;
    for (int i = index + stride; i < n; i += stride){
        count++;
        delta = x[i] - mean;
        mean += delta/count;
        delta2 = x[i] - mean;
        m2 += delta * delta2;
    }
    results[index] = m2;
}



// caluclate all stats on the GPU
__global__ void get_gpu_all(int n, double *x, stats *all_results){
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    double mean = x[index];
    double min = x[index];
    double max = x[index];
    double m2 = 0;
    double delta;
    double delta2;
    int count = 1;
    for (int i = index + stride; i < n; i += stride){
        max = (max < x[i]) ? x[i] : max;
        min = (x[i] < min) ? x[i] : min;
        count++;
        delta = x[i] - mean;
        mean += delta/count;
        delta2 = x[i] - mean;
        m2 += delta * delta2;
    }
    all_results[index].mean = mean;
    all_results[index].min = min;
    all_results[index].max = max;
    all_results[index].stddev = m2; // m2 not actually std dev
}

void print_diff(double x, double y){
    cout << "Difference: " << 100*(y - x)/x << "%\n";
}


void run_tests(int N_pre, int N_BLOCKS, int THREADS_PER_BLK) {

    // We need N to be a multiple of N_THREADS
    int N = N_BLOCKS * THREADS_PER_BLK * floor(N_pre / (THREADS_PER_BLK * N_BLOCKS));
    
    /**  
    cout << "N = " << N << endl;
    cout << "N_BLOCKS = " << N_BLOCKS << endl;
    cout << "THREADS_PER_BLK = " << THREADS_PER_BLK << endl;
    cout << "Allocating memory and initializing...";
    **/
    double *x;
    hipMallocManaged(&x, N*sizeof(double));
    srand(time(NULL));
    for (int i = 0; i < N; i++) {
      x[i] = ((double) rand()) / ((double) RAND_MAX);
    }
    double *results;
    hipMallocManaged(&results, N_BLOCKS*THREADS_PER_BLK*sizeof(double));

    // use CPU to calculate max
    auto start = std::chrono::high_resolution_clock::now();
    double cpu_max = cpu_get_max(N, x);
    auto end = std::chrono::high_resolution_clock::now();
    auto dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    // cout << "CPU calculated max:" << fixed << cpu_max << endl;
    // fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,max,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());


    // use GPU to calculate max
    start = std::chrono::high_resolution_clock::now();
    get_gpu_max<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, results);
    hipDeviceSynchronize();
    double gpu_max = results[0];
    for (int i = 1; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        gpu_max = (gpu_max < results[i]) ? results[i] : gpu_max;
    }
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "GPU calculated max:" << fixed << gpu_max << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,max,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    //print_diff(cpu_max, gpu_max);
    //cout << endl;

    // use CPU to calculate min
    start = std::chrono::high_resolution_clock::now();
    double cpu_min = cpu_get_min(N, x);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "CPU calculated min:" << fixed << cpu_min << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,min,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    // use GPU to calculate min
    start = std::chrono::high_resolution_clock::now();
    get_gpu_min<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, results);
    hipDeviceSynchronize();
    double gpu_min = results[0];
    for (int i = 1; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        gpu_min = (results[i] < gpu_min) ? results[i] : gpu_min;
    }
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "GPU calculated min:" << fixed << gpu_min << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,min,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    //print_diff(cpu_min, gpu_min);
    //cout << endl;

    // use CPU to calculate mean
    start = std::chrono::high_resolution_clock::now();
    double cpu_mean = cpu_get_mean(N, x);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "CPU calculated mean:" << fixed << cpu_mean << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,avg,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    // use GPU to calculate mean
    start = std::chrono::high_resolution_clock::now();
    get_gpu_mean<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, results);
    hipDeviceSynchronize();
    double gpu_mean_sum = 0;
    for (int i = 0; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        gpu_mean_sum += results[i];
    }
    double gpu_mean = gpu_mean_sum/(N_BLOCKS*THREADS_PER_BLK);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "GPU calculated mean:" << fixed << gpu_mean << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,avg,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    //print_diff(cpu_mean, gpu_mean);
    //cout << endl;

    // use CPU to calculate std dev
    start = std::chrono::high_resolution_clock::now();
    double cpu_stddev = cpu_get_stddev(N, x);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "CPU calculated std dev:" << fixed << cpu_stddev << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,dev,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());

    // use GPU to calculate std dev
    start = std::chrono::high_resolution_clock::now();
    get_gpu_stddev<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, results);
    hipDeviceSynchronize();
    double gpu_m2 = 0;
    for (int i = 0; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        gpu_m2 += results[i];
    }
    double gpu_stddev = sqrt(gpu_m2/N);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    //cout << "GPU calculated std dev:" << fixed << gpu_stddev << endl;
    //fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    fprintf(stdout,"%d,%d,%d,dev,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());
    /**
    print_diff(cpu_stddev, gpu_stddev);
    cout << endl;
    **/

    // use CPU to calculate all stats
    start = std::chrono::high_resolution_clock::now();
    stats my_stats = cpu_get_all(N, x);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    /**
    cout << "Concurrent: CPU calculated max:" << fixed << my_stats.max << endl;
    cout << "Concurrent: CPU calculated min:" << fixed << my_stats.min << endl;
    cout << "Concurrent: CPU calculated mean:" << fixed << my_stats.mean << endl;
    cout << "Concurrent: CPU calculated std dev:" << fixed << my_stats.stddev << endl;
    fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    **/
    fprintf(stdout,"%d,%d,%d,all,cpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());
    

    hipFree(results);

    // use GPU to calculate all stats
    stats* all_results;
    hipMallocManaged(&all_results, N_BLOCKS*THREADS_PER_BLK*sizeof(stats));
    
    // start the timer
    start = std::chrono::high_resolution_clock::now();

    // run calculations on the GPU
    get_gpu_all<<<N_BLOCKS, THREADS_PER_BLK>>>(N, x, all_results);

    // synchrnonize 
    hipDeviceSynchronize();

    // We now need to accumulate results from all threads
    double m2 = all_results[0].stddev;
    double mean = all_results[0].mean;
    double delta;
    double new_mean;
    int n_a = N / (N_BLOCKS*THREADS_PER_BLK); 
    int n_b = n_a;
    double max = all_results[0].max;
    double min = all_results[0].min;
    for (int i = 1; i < N_BLOCKS*THREADS_PER_BLK; i++) {
        new_mean = all_results[i].mean;
        delta = new_mean - mean;

        // we update our running mean value
        mean = (n_a*mean + n_b*new_mean)/(n_a + n_b);

        m2 += all_results[i].stddev + delta * delta * n_a * n_b / (n_a + n_b);

        n_a += n_b;

        min = (all_results[i].min < min) ? all_results[i].min : min;
        max = (all_results[i].max > max) ? all_results[i].max : max;
    }
    double stddev = sqrt(m2/N);
    end = std::chrono::high_resolution_clock::now();
    dur_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
    /**
    cout << "Concurrent: GPU calculated max:" << fixed << max << endl;
    cout << "Concurrent: GPU calculated min:" << fixed << min << endl;
    cout << "Concurrent: GPU calculated mean:" << fixed << mean << endl;
    cout << "Concurrent: GPU calculated std dev:" << fixed << stddev << endl;
    fprintf(stdout, "Elapsed time %lld ns\n", dur_ns.count());
    **/
    fprintf(stdout,"%d,%d,%d,all,gpu,%lld\n",N,N_BLOCKS,THREADS_PER_BLK,dur_ns.count());
    
    // Free memory
    hipFree(x);
    hipFree(all_results);
}


int main(void) {

    // We want to display floats with max precision
    cout.precision(17);

    int Ns[] = {50000000,100000000,150000000,200000000};
    int TPBs[] = {128, 256, 512, 1024};
    int NBs[] = {1, 4, 16, 28};

    for (int n : Ns) {
        for (int threads_per_block : TPBs) {
            for (int n_blocks : NBs) {
                run_tests(n, n_blocks, threads_per_block); 
            }
        }
    }
   
}

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

                                        # End of file scope inline assembly
	.globl	_Z12cpu_get_meaniPd             # -- Begin function _Z12cpu_get_meaniPd
	.type	_Z12cpu_get_meaniPd,@function
_Z12cpu_get_meaniPd:                    # @_Z12cpu_get_meaniPd
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jle	.LBB0_1
# %bb.3:                                # %.lr.ph.preheader
	movl	%edi, %eax
	xorpd	%xmm0, %xmm0
	xorl	%ecx, %ecx
.LBB0_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	addsd	(%rsi,%rcx,8), %xmm0
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB0_4
	jmp	.LBB0_2
.LBB0_1:
	xorpd	%xmm0, %xmm0
.LBB0_2:                                # %._crit_edge
	cvtsi2sd	%edi, %xmm1
	divsd	%xmm1, %xmm0
	retq
.Lfunc_end0:
	.size	_Z12cpu_get_meaniPd, .Lfunc_end0-_Z12cpu_get_meaniPd
	.cfi_endproc
                                        # -- End function
	.globl	_Z14cpu_get_stddeviPd           # -- Begin function _Z14cpu_get_stddeviPd
	.type	_Z14cpu_get_stddeviPd,@function
_Z14cpu_get_stddeviPd:                  # @_Z14cpu_get_stddeviPd
	.cfi_startproc
# %bb.0:
	xorpd	%xmm1, %xmm1
	xorpd	%xmm0, %xmm0
	cmpl	$2, %edi
	jl	.LBB1_3
# %bb.1:                                # %.lr.ph.preheader
	movsd	(%rsi), %xmm2                   # xmm2 = mem[0],zero
	movl	%edi, %eax
	movl	$1, %ecx
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rsi,%rcx,8), %xmm3            # xmm3 = mem[0],zero
	movapd	%xmm3, %xmm4
	incq	%rcx
	xorps	%xmm5, %xmm5
	cvtsi2sd	%ecx, %xmm5
	subsd	%xmm2, %xmm4
	movapd	%xmm4, %xmm6
	divsd	%xmm5, %xmm6
	addsd	%xmm6, %xmm2
	subsd	%xmm2, %xmm3
	mulsd	%xmm4, %xmm3
	addsd	%xmm3, %xmm0
	cmpq	%rcx, %rax
	jne	.LBB1_2
.LBB1_3:                                # %._crit_edge
	xorps	%xmm2, %xmm2
	cvtsi2sd	%edi, %xmm2
	divsd	%xmm2, %xmm0
	ucomisd	%xmm1, %xmm0
	jb	sqrt                            # TAILCALL
# %bb.4:                                # %._crit_edge.split
	sqrtsd	%xmm0, %xmm0
	retq
.Lfunc_end1:
	.size	_Z14cpu_get_stddeviPd, .Lfunc_end1-_Z14cpu_get_stddeviPd
	.cfi_endproc
                                        # -- End function
	.globl	_Z11cpu_get_maxiPd              # -- Begin function _Z11cpu_get_maxiPd
	.type	_Z11cpu_get_maxiPd,@function
_Z11cpu_get_maxiPd:                     # @_Z11cpu_get_maxiPd
	.cfi_startproc
# %bb.0:
	movsd	(%rsi), %xmm1                   # xmm1 = mem[0],zero
	cmpl	$2, %edi
	jl	.LBB2_1
# %bb.3:                                # %.lr.ph.preheader
	movl	%edi, %eax
	movl	$1, %ecx
.LBB2_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rsi,%rcx,8), %xmm0            # xmm0 = mem[0],zero
	maxsd	%xmm1, %xmm0
	incq	%rcx
	movapd	%xmm0, %xmm1
	cmpq	%rcx, %rax
	jne	.LBB2_4
# %bb.2:                                # %._crit_edge
	retq
.LBB2_1:
	movapd	%xmm1, %xmm0
	retq
.Lfunc_end2:
	.size	_Z11cpu_get_maxiPd, .Lfunc_end2-_Z11cpu_get_maxiPd
	.cfi_endproc
                                        # -- End function
	.globl	_Z11cpu_get_miniPd              # -- Begin function _Z11cpu_get_miniPd
	.type	_Z11cpu_get_miniPd,@function
_Z11cpu_get_miniPd:                     # @_Z11cpu_get_miniPd
	.cfi_startproc
# %bb.0:
	movsd	(%rsi), %xmm1                   # xmm1 = mem[0],zero
	cmpl	$2, %edi
	jl	.LBB3_1
# %bb.3:                                # %.lr.ph.preheader
	movl	%edi, %eax
	movl	$1, %ecx
.LBB3_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rsi,%rcx,8), %xmm0            # xmm0 = mem[0],zero
	minsd	%xmm1, %xmm0
	incq	%rcx
	movapd	%xmm0, %xmm1
	cmpq	%rcx, %rax
	jne	.LBB3_4
# %bb.2:                                # %._crit_edge
	retq
.LBB3_1:
	movapd	%xmm1, %xmm0
	retq
.Lfunc_end3:
	.size	_Z11cpu_get_miniPd, .Lfunc_end3-_Z11cpu_get_miniPd
	.cfi_endproc
                                        # -- End function
	.globl	_Z11cpu_get_alliPd              # -- Begin function _Z11cpu_get_alliPd
	.type	_Z11cpu_get_alliPd,@function
_Z11cpu_get_alliPd:                     # @_Z11cpu_get_alliPd
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movsd	(%rdx), %xmm3                   # xmm3 = mem[0],zero
	xorpd	%xmm1, %xmm1
	cmpl	$2, %esi
	jl	.LBB4_1
# %bb.6:                                # %.lr.ph.preheader
	movl	%esi, %eax
	xorpd	%xmm0, %xmm0
	movl	$1, %ecx
	movapd	%xmm3, %xmm6
	movapd	%xmm3, %xmm7
.LBB4_7:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rdx,%rcx,8), %xmm8            # xmm8 = mem[0],zero
	movapd	%xmm8, %xmm2
	maxsd	%xmm7, %xmm2
	movapd	%xmm8, %xmm4
	minsd	%xmm6, %xmm4
	movapd	%xmm8, %xmm6
	subsd	%xmm3, %xmm6
	incq	%rcx
	xorps	%xmm7, %xmm7
	cvtsi2sd	%ecx, %xmm7
	movapd	%xmm6, %xmm5
	divsd	%xmm7, %xmm5
	addsd	%xmm3, %xmm5
	subsd	%xmm5, %xmm8
	mulsd	%xmm6, %xmm8
	addsd	%xmm8, %xmm0
	movapd	%xmm5, %xmm3
	movapd	%xmm4, %xmm6
	movapd	%xmm2, %xmm7
	cmpq	%rcx, %rax
	jne	.LBB4_7
	jmp	.LBB4_2
.LBB4_1:
	movapd	%xmm3, %xmm2
	xorpd	%xmm0, %xmm0
	movapd	%xmm3, %xmm4
	movapd	%xmm3, %xmm5
.LBB4_2:                                # %._crit_edge
	movsd	%xmm5, (%rbx)
	movsd	%xmm4, 8(%rbx)
	xorps	%xmm3, %xmm3
	cvtsi2sd	%esi, %xmm3
	movsd	%xmm2, 16(%rbx)
	divsd	%xmm3, %xmm0
	ucomisd	%xmm1, %xmm0
	jb	.LBB4_4
# %bb.3:
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB4_5
.LBB4_4:                                # %call.sqrt
	callq	sqrt
.LBB4_5:                                # %._crit_edge.split
	movsd	%xmm0, 24(%rbx)
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z11cpu_get_alliPd, .Lfunc_end4-_Z11cpu_get_alliPd
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__get_gpu_maxiPdS_ # -- Begin function _Z26__device_stub__get_gpu_maxiPdS_
	.type	_Z26__device_stub__get_gpu_maxiPdS_,@function
_Z26__device_stub__get_gpu_maxiPdS_:    # @_Z26__device_stub__get_gpu_maxiPdS_
	.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	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	32(%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	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11get_gpu_maxiPdS_, %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_end5:
	.size	_Z26__device_stub__get_gpu_maxiPdS_, .Lfunc_end5-_Z26__device_stub__get_gpu_maxiPdS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__get_gpu_miniPdS_ # -- Begin function _Z26__device_stub__get_gpu_miniPdS_
	.type	_Z26__device_stub__get_gpu_miniPdS_,@function
_Z26__device_stub__get_gpu_miniPdS_:    # @_Z26__device_stub__get_gpu_miniPdS_
	.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	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	32(%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	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11get_gpu_miniPdS_, %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	_Z26__device_stub__get_gpu_miniPdS_, .Lfunc_end6-_Z26__device_stub__get_gpu_miniPdS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__get_gpu_meaniPdS_ # -- Begin function _Z27__device_stub__get_gpu_meaniPdS_
	.type	_Z27__device_stub__get_gpu_meaniPdS_,@function
_Z27__device_stub__get_gpu_meaniPdS_:   # @_Z27__device_stub__get_gpu_meaniPdS_
	.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	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	32(%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	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z12get_gpu_meaniPdS_, %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_end7:
	.size	_Z27__device_stub__get_gpu_meaniPdS_, .Lfunc_end7-_Z27__device_stub__get_gpu_meaniPdS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__get_gpu_stddeviPdS_ # -- Begin function _Z29__device_stub__get_gpu_stddeviPdS_
	.type	_Z29__device_stub__get_gpu_stddeviPdS_,@function
_Z29__device_stub__get_gpu_stddeviPdS_: # @_Z29__device_stub__get_gpu_stddeviPdS_
	.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	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	32(%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	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z14get_gpu_stddeviPdS_, %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	_Z29__device_stub__get_gpu_stddeviPdS_, .Lfunc_end8-_Z29__device_stub__get_gpu_stddeviPdS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__get_gpu_alliPdP5stats # -- Begin function _Z26__device_stub__get_gpu_alliPdP5stats
	.type	_Z26__device_stub__get_gpu_alliPdP5stats,@function
_Z26__device_stub__get_gpu_alliPdP5stats: # @_Z26__device_stub__get_gpu_alliPdP5stats
	.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	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	32(%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	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11get_gpu_alliPdP5stats, %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_end9:
	.size	_Z26__device_stub__get_gpu_alliPdP5stats, .Lfunc_end9-_Z26__device_stub__get_gpu_alliPdP5stats
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10print_diffdd
.LCPI10_0:
	.quad	0x4059000000000000              # double 100
	.text
	.globl	_Z10print_diffdd
	.type	_Z10print_diffdd,@function
_Z10print_diffdd:                       # @_Z10print_diffdd
	.cfi_startproc
# %bb.0:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	subsd	%xmm1, %xmm0
	mulsd	.LCPI10_0(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l # TAILCALL
.Lfunc_end10:
	.size	_Z10print_diffdd, .Lfunc_end10-_Z10print_diffdd
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z9run_testsiii
.LCPI11_0:
	.quad	0x41dfffffffc00000              # double 2147483647
	.text
	.globl	_Z9run_testsiii
	.type	_Z9run_testsiii,@function
_Z9run_testsiii:                        # @_Z9run_testsiii
	.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	$120, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebp
	movl	%edx, %ecx
	movl	%esi, 12(%rsp)                  # 4-byte Spill
	imull	%esi, %ecx
	cvtsi2sd	%ecx, %xmm0
	movl	%edi, %eax
	cltd
	movl	%ecx, 28(%rsp)                  # 4-byte Spill
	idivl	%ecx
	cvtsi2sd	%eax, %xmm1
	mulsd	%xmm0, %xmm1
	cvttsd2si	%xmm1, %r14d
	movslq	%r14d, %r15
	leaq	(,%r15,8), %rsi
	leaq	16(%rsp), %rdi
	movl	$1, %edx
	callq	hipMallocManaged
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movl	%r14d, %r12d
	testl	%r15d, %r15d
	jle	.LBB11_3
# %bb.1:                                # %.lr.ph.preheader
	xorl	%r15d, %r15d
.LBB11_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI11_0(%rip), %xmm0
	movq	16(%rsp), %rax
	movsd	%xmm0, (%rax,%r15,8)
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB11_2
.LBB11_3:                               # %._crit_edge
	movslq	28(%rsp), %rax                  # 4-byte Folded Reload
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	leaq	(,%rax,8), %rsi
	leaq	32(%rsp), %rdi
	movl	$1, %edx
	callq	hipMallocManaged
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.2, %esi
	movl	%r14d, %edx
	movl	12(%rsp), %ebx                  # 4-byte Reload
	movl	%ebx, %ecx
	movl	%ebp, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	movl	%ebx, %r13d
	btsq	$32, %r13
	movl	%ebp, 44(%rsp)                  # 4-byte Spill
	movl	%ebp, %edx
	btsq	$32, %rdx
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rdx, 64(%rsp)                  # 8-byte Spill
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_5
# %bb.4:
	movq	16(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	%r14d, %edi
	callq	_Z26__device_stub__get_gpu_maxiPdS_
.LBB11_5:                               # %._crit_edge322
	callq	hipDeviceSynchronize
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.3, %esi
	movl	%r14d, %edx
	movl	12(%rsp), %ebp                  # 4-byte Reload
	movl	%ebp, %ecx
	movl	44(%rsp), %ebx                  # 4-byte Reload
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.4, %esi
	movl	%r14d, %edx
	movl	%ebp, %ecx
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	movq	%r13, %rdi
	movl	$1, %esi
	movq	64(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_7
# %bb.6:
	movq	16(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	%r14d, %edi
	callq	_Z26__device_stub__get_gpu_miniPdS_
.LBB11_7:                               # %._crit_edge327
	callq	hipDeviceSynchronize
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.5, %esi
	movl	%r14d, %edx
	movl	12(%rsp), %ebp                  # 4-byte Reload
	movl	%ebp, %ecx
	movl	44(%rsp), %ebx                  # 4-byte Reload
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.6, %esi
	movl	%r14d, %edx
	movl	%ebp, %ecx
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	movq	%r13, 72(%rsp)                  # 8-byte Spill
	movq	%r13, %rdi
	movl	$1, %esi
	movq	64(%rsp), %r13                  # 8-byte Reload
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_9
# %bb.8:
	movq	16(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	%r14d, %edi
	callq	_Z27__device_stub__get_gpu_meaniPdS_
.LBB11_9:
	cvtsi2sd	%r14d, %xmm0
	movsd	%xmm0, 48(%rsp)                 # 8-byte Spill
	callq	hipDeviceSynchronize
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.7, %esi
	movl	%r14d, %edx
	movl	12(%rsp), %ecx                  # 4-byte Reload
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	xorpd	%xmm1, %xmm1
	xorpd	%xmm0, %xmm0
	cmpl	$2, %r14d
	jl	.LBB11_12
# %bb.10:                               # %.lr.ph.preheader.i232
	movq	16(%rsp), %rax
	movsd	(%rax), %xmm2                   # xmm2 = mem[0],zero
	movl	$1, %ecx
.LBB11_11:                              # %.lr.ph.i234
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rax,%rcx,8), %xmm3            # xmm3 = mem[0],zero
	movapd	%xmm3, %xmm4
	incq	%rcx
	xorps	%xmm5, %xmm5
	cvtsi2sd	%ecx, %xmm5
	subsd	%xmm2, %xmm4
	movapd	%xmm4, %xmm6
	divsd	%xmm5, %xmm6
	addsd	%xmm6, %xmm2
	subsd	%xmm2, %xmm3
	mulsd	%xmm4, %xmm3
	addsd	%xmm3, %xmm0
	cmpq	%rcx, %r12
	jne	.LBB11_11
.LBB11_12:                              # %_Z14cpu_get_stddeviPd.exit
	divsd	48(%rsp), %xmm0                 # 8-byte Folded Reload
	ucomisd	%xmm1, %xmm0
	jae	.LBB11_14
# %bb.13:                               # %call.sqrt
	callq	sqrt
.LBB11_14:                              # %_Z14cpu_get_stddeviPd.exit.split
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.8, %esi
	movl	%r14d, %edx
	movl	12(%rsp), %ebp                  # 4-byte Reload
	movl	%ebp, %ecx
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_16
# %bb.15:
	movq	16(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	%r14d, %edi
	callq	_Z29__device_stub__get_gpu_stddeviPdS_
.LBB11_16:
	callq	hipDeviceSynchronize
	xorpd	%xmm1, %xmm1
	movl	28(%rsp), %eax                  # 4-byte Reload
	movl	%eax, %r12d
	xorpd	%xmm0, %xmm0
	testl	%eax, %eax
	jle	.LBB11_19
# %bb.17:                               # %.lr.ph331
	movq	32(%rsp), %rax
	xorl	%ecx, %ecx
.LBB11_18:                              # =>This Inner Loop Header: Depth=1
	addsd	(%rax,%rcx,8), %xmm0
	incq	%rcx
	cmpq	%rcx, %r12
	jne	.LBB11_18
.LBB11_19:                              # %._crit_edge332
	divsd	48(%rsp), %xmm0                 # 8-byte Folded Reload
	ucomisd	%xmm1, %xmm0
	jae	.LBB11_21
# %bb.20:                               # %call.sqrt377
	callq	sqrt
.LBB11_21:                              # %._crit_edge332.split
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.9, %esi
	movl	%r14d, %edx
	movl	%ebp, %ecx
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	movq	16(%rsp), %rdx
	leaq	88(%rsp), %rdi
	movl	%r14d, %esi
	callq	_Z11cpu_get_alliPd
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.10, %esi
	movl	%r14d, %edx
	movl	%ebp, %ecx
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	80(%rsp), %rsi                  # 8-byte Reload
	shlq	$5, %rsi
	leaq	56(%rsp), %rdi
	movl	$1, %edx
	callq	hipMallocManaged
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_23
# %bb.22:
	movq	16(%rsp), %rsi
	movq	56(%rsp), %rdx
	movl	%r14d, %edi
	callq	_Z26__device_stub__get_gpu_alliPdP5stats
.LBB11_23:
	callq	hipDeviceSynchronize
	movl	%r14d, %eax
	cltd
	movl	28(%rsp), %esi                  # 4-byte Reload
	idivl	%esi
                                        # kill: def $eax killed $eax def $rax
	movq	56(%rsp), %rcx
	movsd	24(%rcx), %xmm0                 # xmm0 = mem[0],zero
	cmpl	$2, %esi
	jl	.LBB11_26
# %bb.24:                               # %.lr.ph340
	movsd	(%rcx), %xmm3                   # xmm3 = mem[0],zero
	cvtsi2sd	%eax, %xmm1
	shlq	$5, %r12
	leal	(%rax,%rax), %edx
	movl	$32, %esi
	movl	%eax, %edi
.LBB11_25:                              # =>This Inner Loop Header: Depth=1
	movsd	(%rcx,%rsi), %xmm2              # xmm2 = mem[0],zero
	movapd	%xmm2, %xmm4
	subsd	%xmm3, %xmm4
	xorps	%xmm5, %xmm5
	cvtsi2sd	%edi, %xmm5
	mulsd	%xmm5, %xmm3
	mulsd	%xmm1, %xmm2
	addsd	%xmm3, %xmm2
	addl	%eax, %edi
	xorps	%xmm3, %xmm3
	cvtsi2sd	%edx, %xmm3
	divsd	%xmm3, %xmm2
	mulsd	%xmm4, %xmm4
	mulsd	%xmm5, %xmm4
	mulsd	%xmm1, %xmm4
	divsd	%xmm3, %xmm4
	addsd	24(%rcx,%rsi), %xmm4
	addsd	%xmm4, %xmm0
	addq	$32, %rsi
	addl	%eax, %edx
	movapd	%xmm2, %xmm3
	cmpq	%rsi, %r12
	jne	.LBB11_25
.LBB11_26:                              # %._crit_edge341
	divsd	48(%rsp), %xmm0                 # 8-byte Folded Reload
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jae	.LBB11_28
# %bb.27:                               # %call.sqrt378
	callq	sqrt
.LBB11_28:                              # %._crit_edge341.split
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movq	stdout(%rip), %rdi
	movl	$.L.str.11, %esi
	movl	%r14d, %edx
	movl	%ebp, %ecx
	movl	%ebx, %r8d
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	56(%rsp), %rdi
	callq	hipFree
	addq	$120, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_Z9run_testsiii, .Lfunc_end11-_Z9run_testsiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI12_0:
	.long	50000000                        # 0x2faf080
	.long	100000000                       # 0x5f5e100
	.long	150000000                       # 0x8f0d180
	.long	200000000                       # 0xbebc200
.LCPI12_1:
	.long	128                             # 0x80
	.long	256                             # 0x100
	.long	512                             # 0x200
	.long	1024                            # 0x400
.LCPI12_2:
	.long	1                               # 0x1
	.long	4                               # 0x4
	.long	16                              # 0x10
	.long	28                              # 0x1c
	.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	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	movq	$17, _ZSt4cout+8(%rax)
	movaps	.LCPI12_0(%rip), %xmm0          # xmm0 = [50000000,100000000,150000000,200000000]
	movaps	%xmm0, 32(%rsp)
	movaps	.LCPI12_1(%rip), %xmm0          # xmm0 = [128,256,512,1024]
	movaps	%xmm0, 16(%rsp)
	movaps	.LCPI12_2(%rip), %xmm0          # xmm0 = [1,4,16,28]
	movaps	%xmm0, (%rsp)
	xorl	%r14d, %r14d
.LBB12_1:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB12_2 Depth 2
                                        #       Child Loop BB12_3 Depth 3
	movl	32(%rsp,%r14), %ebx
	xorl	%r15d, %r15d
.LBB12_2:                               #   Parent Loop BB12_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB12_3 Depth 3
	movl	16(%rsp,%r15), %ebp
	xorl	%r12d, %r12d
.LBB12_3:                               #   Parent Loop BB12_1 Depth=1
                                        #     Parent Loop BB12_2 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rsp,%r12), %esi
	movl	%ebx, %edi
	movl	%ebp, %edx
	callq	_Z9run_testsiii
	addq	$4, %r12
	cmpq	$16, %r12
	jne	.LBB12_3
# %bb.4:                                #   in Loop: Header=BB12_2 Depth=2
	addq	$4, %r15
	cmpq	$16, %r15
	jne	.LBB12_2
# %bb.5:                                #   in Loop: Header=BB12_1 Depth=1
	addq	$4, %r14
	cmpq	$16, %r14
	jne	.LBB12_1
# %bb.6:
	xorl	%eax, %eax
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	main, .Lfunc_end12-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.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	$_Z11get_gpu_maxiPdS_, %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	$_Z11get_gpu_miniPdS_, %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	$_Z12get_gpu_meaniPdS_, %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	$_Z14get_gpu_stddeviPdS_, %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	$_Z11get_gpu_alliPdP5stats, %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	_Z11get_gpu_maxiPdS_,@object    # @_Z11get_gpu_maxiPdS_
	.section	.rodata,"a",@progbits
	.globl	_Z11get_gpu_maxiPdS_
	.p2align	3, 0x0
_Z11get_gpu_maxiPdS_:
	.quad	_Z26__device_stub__get_gpu_maxiPdS_
	.size	_Z11get_gpu_maxiPdS_, 8

	.type	_Z11get_gpu_miniPdS_,@object    # @_Z11get_gpu_miniPdS_
	.globl	_Z11get_gpu_miniPdS_
	.p2align	3, 0x0
_Z11get_gpu_miniPdS_:
	.quad	_Z26__device_stub__get_gpu_miniPdS_
	.size	_Z11get_gpu_miniPdS_, 8

	.type	_Z12get_gpu_meaniPdS_,@object   # @_Z12get_gpu_meaniPdS_
	.globl	_Z12get_gpu_meaniPdS_
	.p2align	3, 0x0
_Z12get_gpu_meaniPdS_:
	.quad	_Z27__device_stub__get_gpu_meaniPdS_
	.size	_Z12get_gpu_meaniPdS_, 8

	.type	_Z14get_gpu_stddeviPdS_,@object # @_Z14get_gpu_stddeviPdS_
	.globl	_Z14get_gpu_stddeviPdS_
	.p2align	3, 0x0
_Z14get_gpu_stddeviPdS_:
	.quad	_Z29__device_stub__get_gpu_stddeviPdS_
	.size	_Z14get_gpu_stddeviPdS_, 8

	.type	_Z11get_gpu_alliPdP5stats,@object # @_Z11get_gpu_alliPdP5stats
	.globl	_Z11get_gpu_alliPdP5stats
	.p2align	3, 0x0
_Z11get_gpu_alliPdP5stats:
	.quad	_Z26__device_stub__get_gpu_alliPdP5stats
	.size	_Z11get_gpu_alliPdP5stats, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Difference: "
	.size	.L.str, 13

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%\n"
	.size	.L.str.1, 3

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%d,%d,%d,max,cpu,%lld\n"
	.size	.L.str.2, 23

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"%d,%d,%d,max,gpu,%lld\n"
	.size	.L.str.3, 23

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%d,%d,%d,min,cpu,%lld\n"
	.size	.L.str.4, 23

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%d,%d,%d,min,gpu,%lld\n"
	.size	.L.str.5, 23

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"%d,%d,%d,avg,cpu,%lld\n"
	.size	.L.str.6, 23

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"%d,%d,%d,avg,gpu,%lld\n"
	.size	.L.str.7, 23

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"%d,%d,%d,dev,cpu,%lld\n"
	.size	.L.str.8, 23

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"%d,%d,%d,dev,gpu,%lld\n"
	.size	.L.str.9, 23

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"%d,%d,%d,all,cpu,%lld\n"
	.size	.L.str.10, 23

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"%d,%d,%d,all,gpu,%lld\n"
	.size	.L.str.11, 23

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z11get_gpu_miniPdS_"
	.size	.L__unnamed_2, 21

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z12get_gpu_meaniPdS_"
	.size	.L__unnamed_3, 22

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z14get_gpu_stddeviPdS_"
	.size	.L__unnamed_4, 24

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z11get_gpu_alliPdP5stats"
	.size	.L__unnamed_5, 26

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z26__device_stub__get_gpu_maxiPdS_
	.addrsig_sym _Z26__device_stub__get_gpu_miniPdS_
	.addrsig_sym _Z27__device_stub__get_gpu_meaniPdS_
	.addrsig_sym _Z29__device_stub__get_gpu_stddeviPdS_
	.addrsig_sym _Z26__device_stub__get_gpu_alliPdP5stats
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z11get_gpu_maxiPdS_
	.addrsig_sym _Z11get_gpu_miniPdS_
	.addrsig_sym _Z12get_gpu_meaniPdS_
	.addrsig_sym _Z14get_gpu_stddeviPdS_
	.addrsig_sym _Z11get_gpu_alliPdP5stats
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11get_gpu_maxiPdS_    ; -- Begin function _Z11get_gpu_maxiPdS_
	.globl	_Z11get_gpu_maxiPdS_
	.p2align	8
	.type	_Z11get_gpu_maxiPdS_,@function
_Z11get_gpu_maxiPdS_:                   ; @_Z11get_gpu_maxiPdS_
; %bb.0:
	s_clause 0x3
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x18
	s_load_b128 s[4:7], s[0:1], 0x8
	s_load_b32 s9, s[0:1], 0x0
	s_mov_b32 s8, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s15, s2, v[0:1]
	s_mul_i32 s2, s3, s2
	v_ashrrev_i32_e32 v5, 31, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 3, v[4:5]
	v_add_nc_u32_e32 v4, s2, v4
	v_add_co_u32 v2, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v1, vcc_lo
	global_load_b64 v[2:3], v[2:3], off
	v_cmpx_gt_i32_e64 s9, v4
	s_cbranch_execz .LBB0_4
; %bb.1:                                ; %.lr.ph.preheader
	v_ashrrev_i32_e32 v5, 31, v4
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[5:6], 3, v[4:5]
	v_add_co_u32 v5, vcc_lo, s4, v5
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v6, vcc_lo
	s_lshl_b64 s[4:5], s[2:3], 3
	s_mov_b32 s3, 0
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[7:8], v[5:6], off
	v_add_nc_u32_e32 v4, s2, v4
	v_add_co_u32 v5, s0, v5, s4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v6, s0, s5, v6, s0
	v_cmp_le_i32_e64 s1, s9, v4
	s_delay_alu instid0(VALU_DEP_1)
	s_or_b32 s3, s1, s3
	s_waitcnt vmcnt(0)
	v_cmp_lt_f64_e32 vcc_lo, v[2:3], v[7:8]
	v_dual_cndmask_b32 v3, v3, v8 :: v_dual_cndmask_b32 v2, v2, v7
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB0_2
; %bb.3:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s3
.LBB0_4:                                ; %Flow31
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s8
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b64 v[0:1], v[2:3], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11get_gpu_maxiPdS_
		.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	_Z11get_gpu_maxiPdS_, .Lfunc_end0-_Z11get_gpu_maxiPdS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 288
; 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	_Z11get_gpu_miniPdS_    ; -- Begin function _Z11get_gpu_miniPdS_
	.globl	_Z11get_gpu_miniPdS_
	.p2align	8
	.type	_Z11get_gpu_miniPdS_,@function
_Z11get_gpu_miniPdS_:                   ; @_Z11get_gpu_miniPdS_
; %bb.0:
	s_clause 0x3
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x18
	s_load_b128 s[4:7], s[0:1], 0x8
	s_load_b32 s9, s[0:1], 0x0
	s_mov_b32 s8, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s15, s2, v[0:1]
	s_mul_i32 s2, s3, s2
	v_ashrrev_i32_e32 v5, 31, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 3, v[4:5]
	v_add_nc_u32_e32 v4, s2, v4
	v_add_co_u32 v2, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v1, vcc_lo
	global_load_b64 v[2:3], v[2:3], off
	v_cmpx_gt_i32_e64 s9, v4
	s_cbranch_execz .LBB1_4
; %bb.1:                                ; %.lr.ph.preheader
	v_ashrrev_i32_e32 v5, 31, v4
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[5:6], 3, v[4:5]
	v_add_co_u32 v5, vcc_lo, s4, v5
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v6, vcc_lo
	s_lshl_b64 s[4:5], s[2:3], 3
	s_mov_b32 s3, 0
.LBB1_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[7:8], v[5:6], off
	v_add_nc_u32_e32 v4, s2, v4
	v_add_co_u32 v5, s0, v5, s4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v6, s0, s5, v6, s0
	v_cmp_le_i32_e64 s1, s9, v4
	s_delay_alu instid0(VALU_DEP_1)
	s_or_b32 s3, s1, s3
	s_waitcnt vmcnt(0)
	v_cmp_lt_f64_e32 vcc_lo, v[7:8], v[2:3]
	v_dual_cndmask_b32 v3, v3, v8 :: v_dual_cndmask_b32 v2, v2, v7
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB1_2
; %bb.3:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s3
.LBB1_4:                                ; %Flow31
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s8
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b64 v[0:1], v[2:3], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11get_gpu_miniPdS_
		.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	_Z11get_gpu_miniPdS_, .Lfunc_end1-_Z11get_gpu_miniPdS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 288
; 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	_Z12get_gpu_meaniPdS_   ; -- Begin function _Z12get_gpu_meaniPdS_
	.globl	_Z12get_gpu_meaniPdS_
	.p2align	8
	.type	_Z12get_gpu_meaniPdS_,@function
_Z12get_gpu_meaniPdS_:                  ; @_Z12get_gpu_meaniPdS_
; %bb.0:
	s_clause 0x3
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x18
	s_load_b128 s[4:7], s[0:1], 0x8
	s_load_b32 s8, s[0:1], 0x0
	s_mov_b32 s1, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s15, s2, v[0:1]
	s_mul_i32 s2, s3, s2
	v_ashrrev_i32_e32 v5, 31, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 3, v[4:5]
	v_add_nc_u32_e32 v4, s2, v4
	v_add_co_u32 v2, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v1, vcc_lo
	global_load_b64 v[2:3], v[2:3], off
	v_cmpx_gt_i32_e64 s8, v4
	s_cbranch_execz .LBB2_4
; %bb.1:                                ; %.lr.ph.preheader
	v_ashrrev_i32_e32 v5, 31, v4
	s_ashr_i32 s3, s2, 31
	s_mov_b32 s9, 2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[5:6], 3, v[4:5]
	v_add_co_u32 v5, vcc_lo, s4, v5
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v6, vcc_lo
	s_lshl_b64 s[4:5], s[2:3], 3
	s_mov_b32 s3, 0
.LBB2_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[7:8], v[5:6], off
	v_cvt_f64_i32_e32 v[9:10], s9
	v_add_nc_u32_e32 v4, s2, v4
	v_add_co_u32 v5, s0, v5, s4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v6, s0, s5, v6, s0
	s_add_i32 s9, s9, 1
	s_waitcnt vmcnt(0)
	v_add_f64 v[7:8], v[7:8], -v[2:3]
	v_div_scale_f64 v[11:12], null, v[9:10], v[9:10], v[7:8]
	v_div_scale_f64 v[17:18], vcc_lo, v[7:8], v[9:10], v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[13:14], v[11:12]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[15:16], -v[11:12], v[13:14], 1.0
	v_fma_f64 v[13:14], v[13:14], v[15:16], v[13:14]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[15:16], -v[11:12], v[13:14], 1.0
	v_fma_f64 v[13:14], v[13:14], v[15:16], v[13:14]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[15:16], v[17:18], v[13:14]
	v_fma_f64 v[11:12], -v[11:12], v[15:16], v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_div_fmas_f64 v[11:12], v[11:12], v[13:14], v[15:16]
	v_cmp_le_i32_e32 vcc_lo, s8, v4
	s_or_b32 s3, vcc_lo, s3
	v_div_fixup_f64 v[7:8], v[11:12], v[9:10], v[7:8]
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f64 v[2:3], v[2:3], v[7:8]
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB2_2
; %bb.3:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s3
.LBB2_4:                                ; %Flow33
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s1
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b64 v[0:1], v[2:3], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12get_gpu_meaniPdS_
		.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 19
		.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	_Z12get_gpu_meaniPdS_, .Lfunc_end2-_Z12get_gpu_meaniPdS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 404
; NumSgprs: 18
; NumVgprs: 19
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 19
; 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	_Z14get_gpu_stddeviPdS_ ; -- Begin function _Z14get_gpu_stddeviPdS_
	.globl	_Z14get_gpu_stddeviPdS_
	.p2align	8
	.type	_Z14get_gpu_stddeviPdS_,@function
_Z14get_gpu_stddeviPdS_:                ; @_Z14get_gpu_stddeviPdS_
; %bb.0:
	s_clause 0x3
	s_load_b32 s4, s[0:1], 0x24
	s_load_b32 s5, s[0:1], 0x18
	s_load_b32 s8, s[0:1], 0x0
	s_load_b128 s[0:3], s[0:1], 0x8
	s_mov_b32 s9, exec_lo
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[5:6], null, s15, s4, v[0:1]
	s_mul_i32 s4, s5, s4
	v_ashrrev_i32_e32 v6, 31, v5
	v_add_nc_u32_e32 v2, s4, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 3, v[5:6]
	v_cmpx_gt_i32_e64 s8, v2
	s_cbranch_execz .LBB3_4
; %bb.1:                                ; %.lr.ph.preheader
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v3, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v4, vcc_lo, s1, v1, vcc_lo
	s_ashr_i32 s5, s4, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	s_lshl_b64 s[6:7], s[4:5], 3
	global_load_b64 v[5:6], v[3:4], off
	v_ashrrev_i32_e32 v3, 31, v2
	s_mov_b32 s5, 2
	v_lshlrev_b64 v[7:8], 3, v[2:3]
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v7, vcc_lo, s0, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s1, v8, vcc_lo
	s_mov_b32 s1, 0
.LBB3_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[9:10], v[7:8], off
	v_cvt_f64_i32_e32 v[11:12], s5
	v_add_nc_u32_e32 v2, s4, v2
	v_add_co_u32 v7, s0, v7, s6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v8, s0, s7, v8, s0
	s_add_i32 s5, s5, 1
	s_waitcnt vmcnt(0)
	v_add_f64 v[13:14], v[9:10], -v[5:6]
	v_div_scale_f64 v[15:16], null, v[11:12], v[11:12], v[13:14]
	v_div_scale_f64 v[21:22], vcc_lo, v[13:14], v[11:12], v[13:14]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[17:18], v[15:16]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[19:20], -v[15:16], v[17:18], 1.0
	v_fma_f64 v[17:18], v[17:18], v[19:20], v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], -v[15:16], v[17:18], 1.0
	v_fma_f64 v[17:18], v[17:18], v[19:20], v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[19:20], v[21:22], v[17:18]
	v_fma_f64 v[15:16], -v[15:16], v[19:20], v[21:22]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_div_fmas_f64 v[15:16], v[15:16], v[17:18], v[19:20]
	v_cmp_le_i32_e32 vcc_lo, s8, v2
	s_or_b32 s1, vcc_lo, s1
	v_div_fixup_f64 v[11:12], v[15:16], v[11:12], v[13:14]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[5:6], v[5:6], v[11:12]
	v_add_f64 v[9:10], v[9:10], -v[5:6]
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[3:4], v[13:14], v[9:10], v[3:4]
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB3_2
; %bb.3:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s1
.LBB3_4:                                ; %Flow42
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_or_b32 exec_lo, exec_lo, s9
	v_add_co_u32 v0, vcc_lo, s2, v0
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	global_store_b64 v[0:1], v[3:4], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14get_gpu_stddeviPdS_
		.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 23
		.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	_Z14get_gpu_stddeviPdS_, .Lfunc_end3-_Z14get_gpu_stddeviPdS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 440
; NumSgprs: 18
; NumVgprs: 23
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 23
; 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	_Z11get_gpu_alliPdP5stats ; -- Begin function _Z11get_gpu_alliPdP5stats
	.globl	_Z11get_gpu_alliPdP5stats
	.p2align	8
	.type	_Z11get_gpu_alliPdP5stats,@function
_Z11get_gpu_alliPdP5stats:              ; @_Z11get_gpu_alliPdP5stats
; %bb.0:
	s_clause 0x3
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x18
	s_load_b128 s[4:7], s[0:1], 0x8
	s_load_b32 s8, s[0:1], 0x0
	s_mov_b32 s9, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[8:9], null, s15, s2, v[0:1]
	s_mul_i32 s2, s3, s2
	v_ashrrev_i32_e32 v9, 31, v8
	v_add_nc_u32_e32 v10, s2, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[8:9]
	v_add_co_u32 v0, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_load_b64 v[0:1], v[0:1], off
	v_mov_b32_e32 v6, 0
	v_mov_b32_e32 v7, 0
	s_waitcnt vmcnt(0)
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
	v_cmpx_gt_i32_e64 s8, v10
	s_cbranch_execz .LBB4_4
; %bb.1:                                ; %.lr.ph.preheader
	v_ashrrev_i32_e32 v11, 31, v10
	v_dual_mov_b32 v6, 0 :: v_dual_mov_b32 v3, v1
	v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v2, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[4:5], 3, v[10:11]
	s_ashr_i32 s3, s2, 31
	s_mov_b32 s10, 2
	v_add_co_u32 v11, vcc_lo, s4, v4
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v12, vcc_lo, s5, v5, vcc_lo
	v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
	s_lshl_b64 s[4:5], s[2:3], 3
	s_mov_b32 s3, 0
.LBB4_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[13:14], v[11:12], off
	v_cvt_f64_i32_e32 v[15:16], s10
	v_add_nc_u32_e32 v10, s2, v10
	v_add_co_u32 v11, s1, v11, s4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v12, s1, s5, v12, s1
	v_cmp_le_i32_e64 s1, s8, v10
	s_add_i32 s10, s10, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	s_or_b32 s3, s1, s3
	s_waitcnt vmcnt(0)
	v_add_f64 v[17:18], v[13:14], -v[0:1]
	v_cmp_lt_f64_e64 s0, v[13:14], v[2:3]
	v_div_scale_f64 v[19:20], null, v[15:16], v[15:16], v[17:18]
	v_div_scale_f64 v[25:26], vcc_lo, v[17:18], v[15:16], v[17:18]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v3, v3, v14, s0
	v_cndmask_b32_e64 v2, v2, v13, s0
	v_rcp_f64_e32 v[21:22], v[19:20]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[23:24], -v[19:20], v[21:22], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[21:22], v[21:22], v[23:24], v[21:22]
	v_fma_f64 v[23:24], -v[19:20], v[21:22], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[21:22], v[21:22], v[23:24], v[21:22]
	v_mul_f64 v[23:24], v[25:26], v[21:22]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], -v[19:20], v[23:24], v[25:26]
	v_div_fmas_f64 v[19:20], v[19:20], v[21:22], v[23:24]
	v_cmp_lt_f64_e32 vcc_lo, v[4:5], v[13:14]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_fixup_f64 v[15:16], v[19:20], v[15:16], v[17:18]
	v_dual_cndmask_b32 v5, v5, v14 :: v_dual_cndmask_b32 v4, v4, v13
	v_add_f64 v[0:1], v[0:1], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[15:16], v[13:14], -v[0:1]
	v_fma_f64 v[6:7], v[17:18], v[15:16], v[6:7]
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB4_2
; %bb.3:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s3
.LBB4_4:                                ; %Flow88
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s9
	v_lshlrev_b64 v[8:9], 5, v[8:9]
	v_add_co_u32 v8, vcc_lo, s6, v8
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v9, vcc_lo, s7, v9, vcc_lo
	s_clause 0x1
	global_store_b128 v[8:9], v[0:3], off
	global_store_b128 v[8:9], v[4:7], off offset:16
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11get_gpu_alliPdP5stats
		.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 27
		.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_end4:
	.size	_Z11get_gpu_alliPdP5stats, .Lfunc_end4-_Z11get_gpu_alliPdP5stats
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 540
; NumSgprs: 18
; NumVgprs: 27
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 27
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     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:           _Z11get_gpu_maxiPdS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11get_gpu_maxiPdS_.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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z11get_gpu_miniPdS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11get_gpu_miniPdS_.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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z12get_gpu_meaniPdS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z12get_gpu_meaniPdS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     19
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z14get_gpu_stddeviPdS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14get_gpu_stddeviPdS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     23
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z11get_gpu_alliPdP5stats
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11get_gpu_alliPdP5stats.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     27
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
