#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>

#define DATA_SIZE 1048576

int data[DATA_SIZE];

static void GenerateNumbers(int *number, int size)
{
    for(int i = 0; i < size; i++) {
        number[i] = rand() % 10;
    }

	return;
}

static void print_device_prop(const cudaDeviceProp &prop)
{
    printf("Device Name : %s.\n", prop.name);
    printf("totalGlobalMem : %d.\n", prop.totalGlobalMem);
    printf("sharedMemPerBlock : %d.\n", prop.sharedMemPerBlock);
    printf("regsPerBlock : %d.\n", prop.regsPerBlock);
    printf("warpSize : %d.\n", prop.warpSize);
    printf("memPitch : %d.\n", prop.memPitch);
    printf("maxThreadsPerBlock : %d.\n", prop.maxThreadsPerBlock);
    printf("maxThreadsDim[0 - 2] : %d %d %d.\n", prop.maxThreadsDim[0], prop.maxThreadsDim[1], prop.maxThreadsDim[2]);
    printf("maxGridSize[0 - 2] : %d %d %d.\n", prop.maxGridSize[0], prop.maxGridSize[1], prop.maxGridSize[2]);
    printf("totalConstMem : %d.\n", prop.totalConstMem);
    printf("major.minor : %d.%d.\n", prop.major, prop.minor);
    printf("clockRate : %d.\n", prop.clockRate);
    printf("textureAlignment : %d.\n", prop.textureAlignment);
    printf("deviceOverlap : %d.\n", prop.deviceOverlap);
    printf("multiProcessorCount : %d.\n", prop.multiProcessorCount);
}

bool init_cuda()
{
    int count;

    cudaGetDeviceCount(&count);
    if(0 == count){
        fprintf(stderr,"There is no device\n");
        return false;
    }

    int i;
    for(i = 0; i < count; i++){
        cudaDeviceProp prop;
        cudaGetDeviceProperties(&prop, i);
        //打印设备信息
        print_device_prop(prop);
        if(cudaSuccess == cudaGetDeviceProperties(&prop,i)){
            if(prop.major >= 1){
                break;
            }
        }
    }

    if(i == count){
        fprintf(stderr,"There is no device supporting CUDA 1.x.\n");
        return false;
    }

    cudaSetDevice(i);

    return true;
}

__global__ static void sumOfSquares(int *num, int* result, clock_t* time)
{
    int sum = 0;
    int i;
	clock_t start = clock();
    for(i = 0; i < DATA_SIZE; i++) {
        sum += num[i] * num[i];
    }

    *result = sum;
	*time = clock() - start;
}

int main()
{
    if(!init_cuda()){
        return 0;
    }

    printf("CUDA initialize.\n");

    //生成随机数
    GenerateNumbers(data, DATA_SIZE);

	int *gpudata, *result;
	clock_t* time;
	cudaMalloc((void **)&gpudata, sizeof(int)*DATA_SIZE);
	cudaMalloc((void **)&result,sizeof(int));
	cudaMalloc((clock_t **)&time,sizeof(clock_t));
	cudaMemcpy(gpudata,data,sizeof(int)*DATA_SIZE,cudaMemcpyHostToDevice);

	sumOfSquares<<<1,1,0>>>(gpudata,result,time);

	int sum = 0;
	clock_t time_used;
	cudaMemcpy(&sum,result,sizeof(int),cudaMemcpyDeviceToHost);
	cudaMemcpy(&time_used,time,sizeof(clock_t),cudaMemcpyDeviceToHost);
	cudaFree(gpudata);
	cudaFree(result);
	cudaFree(time);

	printf("sum(GPU):%d, time: %d\n", sum, time_used);

    sum = 0;
    for(int i = 0; i < DATA_SIZE; i++) {
        sum += data[i] * data[i];
    }
    printf("sum (CPU): %d\n", sum);

    return 0;
}































	.file	"tmpxft_00388ab5_00000000-6_main.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2033:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2033:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_ZL36__device_stub__Z12sumOfSquaresPiS_PlPiS_Pl, @function
_ZL36__device_stub__Z12sumOfSquaresPiS_PlPiS_Pl:
.LFB2055:
	.cfi_startproc
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_ZL12sumOfSquaresPiS_Pl(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L2:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_ZL36__device_stub__Z12sumOfSquaresPiS_PlPiS_Pl, .-_ZL36__device_stub__Z12sumOfSquaresPiS_PlPiS_Pl
	.type	_ZL12sumOfSquaresPiS_Pl, @function
_ZL12sumOfSquaresPiS_Pl:
.LFB2056:
	.cfi_startproc
	endbr64
	jmp	_ZL36__device_stub__Z12sumOfSquaresPiS_PlPiS_Pl
	.cfi_endproc
.LFE2056:
	.size	_ZL12sumOfSquaresPiS_Pl, .-_ZL12sumOfSquaresPiS_Pl
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"There is no device\n"
.LC1:
	.string	"Device Name : %s.\n"
.LC2:
	.string	"totalGlobalMem : %d.\n"
.LC3:
	.string	"sharedMemPerBlock : %d.\n"
.LC4:
	.string	"regsPerBlock : %d.\n"
.LC5:
	.string	"warpSize : %d.\n"
.LC6:
	.string	"memPitch : %d.\n"
.LC7:
	.string	"maxThreadsPerBlock : %d.\n"
.LC8:
	.string	"maxThreadsDim[0 - 2] : %d %d %d.\n"
.LC9:
	.string	"maxGridSize[0 - 2] : %d %d %d.\n"
.LC10:
	.string	"totalConstMem : %d.\n"
.LC11:
	.string	"major.minor : %d.%d.\n"
.LC12:
	.string	"clockRate : %d.\n"
.LC13:
	.string	"textureAlignment : %d.\n"
.LC14:
	.string	"deviceOverlap : %d.\n"
.LC15:
	.string	"multiProcessorCount : %d.\n"
.LC16:
	.string	"There is no device supporting CUDA 1.x.\n"
	.text
	.globl	_Z9init_cudav
	.type	_Z9init_cudav, @function
_Z9init_cudav:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$1056, %rsp
	.cfi_def_cfa_offset 1088
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdi
	call	cudaGetDeviceCount@PLT
	cmpl	$0, 12(%rsp)
	leaq	.LC0(%rip), %rdx
	je	.L22
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
.L9:
	cmpl	%ebx, 12(%rsp)
	jle	.L13
	leaq	16(%rsp), %rbp
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	304(%rsp), %rdx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	312(%rsp), %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	320(%rsp), %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	324(%rsp), %edx
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	328(%rsp), %rdx
	leaq	.LC6(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	336(%rsp), %edx
	leaq	.LC7(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	348(%rsp), %r8d
	xorl	%eax, %eax
	movl	344(%rsp), %ecx
	movl	340(%rsp), %edx
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	360(%rsp), %r8d
	xorl	%eax, %eax
	movl	356(%rsp), %ecx
	movl	352(%rsp), %edx
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	368(%rsp), %rdx
	leaq	.LC10(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	380(%rsp), %ecx
	movl	$2, %edi
	xorl	%eax, %eax
	movl	376(%rsp), %edx
	leaq	.LC11(%rip), %rsi
	call	__printf_chk@PLT
	movl	364(%rsp), %edx
	leaq	.LC12(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	384(%rsp), %rdx
	leaq	.LC13(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	400(%rsp), %edx
	leaq	.LC14(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	404(%rsp), %edx
	leaq	.LC15(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	testl	%eax, %eax
	jne	.L11
	cmpl	$0, 376(%rsp)
	jg	.L13
.L11:
	incl	%ebx
	jmp	.L9
.L13:
	cmpl	%ebx, 12(%rsp)
	jne	.L15
	leaq	.LC16(%rip), %rdx
.L22:
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	xorl	%eax, %eax
	jmp	.L8
.L15:
	movl	%ebx, %edi
	call	cudaSetDevice@PLT
	movb	$1, %al
.L8:
	movq	1048(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$1056, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z9init_cudav, .-_Z9init_cudav
	.section	.rodata.str1.1
.LC17:
	.string	"CUDA initialize.\n"
.LC18:
	.string	"sum(GPU):%d, time: %d\n"
.LC19:
	.string	"sum (CPU): %d\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2030:
	.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
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	_Z9init_cudav
	testb	%al, %al
	je	.L24
	leaq	data(%rip), %rbx
	leaq	.LC17(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	4194304(%rbx), %rbp
	movq	%rbx, %r12
	movq	%rbx, %r14
	movl	$10, %r13d
.L25:
	call	rand@PLT
	addq	$4, %r12
	cltd
	idivl	%r13d
	movl	%edx, -4(%r12)
	cmpq	%rbp, %r12
	jne	.L25
	movq	%rsp, %rdi
	movl	$4194304, %esi
	call	cudaMalloc@PLT
	leaq	8(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	16(%rsp), %rdi
	movl	$8, %esi
	call	cudaMalloc@PLT
	movq	(%rsp), %rdi
	movl	$1, %ecx
	movq	%r14, %rsi
	movl	$4194304, %edx
	call	cudaMemcpy@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 48(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 40(%rsp)
	movq	%rdi, 28(%rsp)
	movl	$1, 36(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	movq	16(%rsp), %rdx
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	call	_ZL36__device_stub__Z12sumOfSquaresPiS_PlPiS_Pl
.L26:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	28(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	movl	%eax, 28(%rsp)
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rsi
	movl	$2, %ecx
	movl	$8, %edx
	leaq	40(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movl	28(%rsp), %edx
	movq	40(%rsp), %rcx
	xorl	%eax, %eax
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	xorl	%edx, %edx
.L27:
	movl	(%rbx), %eax
	addq	$4, %rbx
	imull	%eax, %eax
	addl	%eax, %edx
	cmpq	%rbp, %rbx
	jne	.L27
	leaq	.LC19(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movl	%edx, 28(%rsp)
	call	__printf_chk@PLT
.L24:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	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
.LFE2030:
	.size	main, .-main
	.section	.rodata.str1.1
.LC20:
	.string	"_Z12sumOfSquaresPiS_Pl"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2058:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC20(%rip), %rdx
	movq	%rax, %rdi
	leaq	_ZL12sumOfSquaresPiS_Pl(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2058:
	.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
	.globl	data
	.bss
	.align 32
	.type	data, @object
	.size	data, 4194304
data:
	.zero	4194304
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

#define DATA_SIZE 1048576

int data[DATA_SIZE];

static void GenerateNumbers(int *number, int size)
{
    for(int i = 0; i < size; i++) {
        number[i] = rand() % 10;
    }

	return;
}

static void print_device_prop(const hipDeviceProp_t &prop)
{
    printf("Device Name : %s.\n", prop.name);
    printf("totalGlobalMem : %d.\n", prop.totalGlobalMem);
    printf("sharedMemPerBlock : %d.\n", prop.sharedMemPerBlock);
    printf("regsPerBlock : %d.\n", prop.regsPerBlock);
    printf("warpSize : %d.\n", prop.warpSize);
    printf("memPitch : %d.\n", prop.memPitch);
    printf("maxThreadsPerBlock : %d.\n", prop.maxThreadsPerBlock);
    printf("maxThreadsDim[0 - 2] : %d %d %d.\n", prop.maxThreadsDim[0], prop.maxThreadsDim[1], prop.maxThreadsDim[2]);
    printf("maxGridSize[0 - 2] : %d %d %d.\n", prop.maxGridSize[0], prop.maxGridSize[1], prop.maxGridSize[2]);
    printf("totalConstMem : %d.\n", prop.totalConstMem);
    printf("major.minor : %d.%d.\n", prop.major, prop.minor);
    printf("clockRate : %d.\n", prop.clockRate);
    printf("textureAlignment : %d.\n", prop.textureAlignment);
    printf("deviceOverlap : %d.\n", prop.deviceOverlap);
    printf("multiProcessorCount : %d.\n", prop.multiProcessorCount);
}

bool init_cuda()
{
    int count;

    hipGetDeviceCount(&count);
    if(0 == count){
        fprintf(stderr,"There is no device\n");
        return false;
    }

    int i;
    for(i = 0; i < count; i++){
        hipDeviceProp_t prop;
        hipGetDeviceProperties(&prop, i);
        //打印设备信息
        print_device_prop(prop);
        if(hipSuccess == hipGetDeviceProperties(&prop,i)){
            if(prop.major >= 1){
                break;
            }
        }
    }

    if(i == count){
        fprintf(stderr,"There is no device supporting CUDA 1.x.\n");
        return false;
    }

    hipSetDevice(i);

    return true;
}

__global__ static void sumOfSquares(int *num, int* result, clock_t* time)
{
    int sum = 0;
    int i;
	clock_t start = clock();
    for(i = 0; i < DATA_SIZE; i++) {
        sum += num[i] * num[i];
    }

    *result = sum;
	*time = clock() - start;
}

int main()
{
    if(!init_cuda()){
        return 0;
    }

    printf("CUDA initialize.\n");

    //生成随机数
    GenerateNumbers(data, DATA_SIZE);

	int *gpudata, *result;
	clock_t* time;
	hipMalloc((void **)&gpudata, sizeof(int)*DATA_SIZE);
	hipMalloc((void **)&result,sizeof(int));
	hipMalloc((clock_t **)&time,sizeof(clock_t));
	hipMemcpy(gpudata,data,sizeof(int)*DATA_SIZE,hipMemcpyHostToDevice);

	sumOfSquares<<<1,1,0>>>(gpudata,result,time);

	int sum = 0;
	clock_t time_used;
	hipMemcpy(&sum,result,sizeof(int),hipMemcpyDeviceToHost);
	hipMemcpy(&time_used,time,sizeof(clock_t),hipMemcpyDeviceToHost);
	hipFree(gpudata);
	hipFree(result);
	hipFree(time);

	printf("sum(GPU):%d, time: %d\n", sum, time_used);

    sum = 0;
    for(int i = 0; i < DATA_SIZE; i++) {
        sum += data[i] * data[i];
    }
    printf("sum (CPU): %d\n", sum);

    return 0;
}































	.text
	.file	"main.hip"
	.globl	_Z9init_cudav                   # -- Begin function _Z9init_cudav
	.type	_Z9init_cudav,@function
_Z9init_cudav:                          # @_Z9init_cudav
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$1480, %rsp                     # imm = 0x5C8
	.cfi_def_cfa_offset 1504
	.cfi_offset %rbx, -24
	.cfi_offset %rbp, -16
	leaq	4(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDeviceCount
	movl	(%rbx), %ecx
	testl	%ecx, %ecx
	je	.LBB0_3
# %bb.1:                                # %.preheader
	jle	.LBB0_2
# %bb.5:                                # %.lr.ph
	leaq	8(%rsp), %rbx
	xorl	%ebp, %ebp
.LBB0_6:                                # =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	%ebp, %esi
	callq	hipGetDevicePropertiesR0600
	movl	$.L.str.5, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	296(%rsp), %rsi
	movl	$.L.str.6, %edi
	xorl	%eax, %eax
	callq	printf
	movq	304(%rsp), %rsi
	movl	$.L.str.7, %edi
	xorl	%eax, %eax
	callq	printf
	movl	312(%rsp), %esi
	movl	$.L.str.8, %edi
	xorl	%eax, %eax
	callq	printf
	movl	316(%rsp), %esi
	movl	$.L.str.9, %edi
	xorl	%eax, %eax
	callq	printf
	movq	320(%rsp), %rsi
	movl	$.L.str.10, %edi
	xorl	%eax, %eax
	callq	printf
	movl	328(%rsp), %esi
	movl	$.L.str.11, %edi
	xorl	%eax, %eax
	callq	printf
	movl	332(%rsp), %esi
	movl	336(%rsp), %edx
	movl	340(%rsp), %ecx
	movl	$.L.str.12, %edi
	xorl	%eax, %eax
	callq	printf
	movl	344(%rsp), %esi
	movl	348(%rsp), %edx
	movl	352(%rsp), %ecx
	movl	$.L.str.13, %edi
	xorl	%eax, %eax
	callq	printf
	movq	360(%rsp), %rsi
	movl	$.L.str.14, %edi
	xorl	%eax, %eax
	callq	printf
	movl	368(%rsp), %esi
	movl	372(%rsp), %edx
	movl	$.L.str.15, %edi
	xorl	%eax, %eax
	callq	printf
	movl	356(%rsp), %esi
	movl	$.L.str.16, %edi
	xorl	%eax, %eax
	callq	printf
	movq	376(%rsp), %rsi
	movl	$.L.str.17, %edi
	xorl	%eax, %eax
	callq	printf
	movl	392(%rsp), %esi
	movl	$.L.str.18, %edi
	xorl	%eax, %eax
	callq	printf
	movl	396(%rsp), %esi
	movl	$.L.str.19, %edi
	xorl	%eax, %eax
	callq	printf
	movq	%rbx, %rdi
	movl	%ebp, %esi
	callq	hipGetDevicePropertiesR0600
	movl	4(%rsp), %ecx
	testl	%eax, %eax
	jne	.LBB0_8
# %bb.7:                                #   in Loop: Header=BB0_6 Depth=1
	cmpl	$0, 368(%rsp)
	jg	.LBB0_9
.LBB0_8:                                #   in Loop: Header=BB0_6 Depth=1
	incl	%ebp
	cmpl	%ecx, %ebp
	jl	.LBB0_6
	jmp	.LBB0_9
.LBB0_2:
	xorl	%ebp, %ebp
.LBB0_9:                                # %._crit_edge
	cmpl	%ecx, %ebp
	je	.LBB0_10
# %bb.11:
	movl	%ebp, %edi
	callq	hipSetDevice
	movb	$1, %al
.LBB0_12:
                                        # kill: def $al killed $al killed $eax
	addq	$1480, %rsp                     # imm = 0x5C8
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB0_3:
	.cfi_def_cfa_offset 1504
	movq	stderr(%rip), %rcx
	movl	$.L.str, %edi
	movl	$19, %esi
	jmp	.LBB0_4
.LBB0_10:
	movq	stderr(%rip), %rcx
	movl	$.L.str.1, %edi
	movl	$40, %esi
.LBB0_4:
	movl	$1, %edx
	callq	fwrite@PLT
	xorl	%eax, %eax
	jmp	.LBB0_12
.Lfunc_end0:
	.size	_Z9init_cudav, .Lfunc_end0-_Z9init_cudav
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$48, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	callq	_Z9init_cudav
	testb	%al, %al
	je	.LBB1_8
# %bb.1:
	movl	$.Lstr, %edi
	callq	puts@PLT
	movq	$-4194304, %rbx                 # imm = 0xFFC00000
.LBB1_2:                                # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	movl	%eax, data+4194304(%rbx)
	addq	$4, %rbx
	jne	.LBB1_2
# %bb.3:                                # %_ZL15GenerateNumbersPii.exit
	leaq	32(%rsp), %rbx
	movl	$4194304, %esi                  # imm = 0x400000
	movq	%rbx, %rdi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	leaq	8(%rsp), %rdi
	movl	$8, %esi
	callq	hipMalloc
	movq	(%rbx), %rdi
	movl	$data, %esi
	movl	$4194304, %edx                  # imm = 0x400000
	movl	$1, %ecx
	callq	hipMemcpy
	xorl	%ebx, %ebx
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%rdi, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_5
# %bb.4:
	movq	32(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdx
	callq	_ZL27__device_stub__sumOfSquaresPiS_Pl
.LBB1_5:
	leaq	28(%rsp), %r14
	movl	$0, (%r14)
	movq	16(%rsp), %rsi
	movl	$4, %edx
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rsi
	leaq	40(%rsp), %r15
	movl	$8, %edx
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	movl	(%r14), %esi
	movq	(%r15), %rdx
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	movq	$-4194304, %rax                 # imm = 0xFFC00000
.LBB1_6:                                # =>This Inner Loop Header: Depth=1
	movl	data+4194304(%rax), %ecx
	imull	%ecx, %ecx
	addl	%ecx, %ebx
	addq	$4, %rax
	jne	.LBB1_6
# %bb.7:
	movl	%ebx, 28(%rsp)
	movl	$.L.str.4, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	printf
.LBB1_8:
	xorl	%eax, %eax
	addq	$48, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.type	_ZL27__device_stub__sumOfSquaresPiS_Pl,@function # -- Begin function _ZL27__device_stub__sumOfSquaresPiS_Pl
_ZL27__device_stub__sumOfSquaresPiS_Pl: # @_ZL27__device_stub__sumOfSquaresPiS_Pl
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_ZL12sumOfSquaresPiS_Pl, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_ZL27__device_stub__sumOfSquaresPiS_Pl, .Lfunc_end2-_ZL27__device_stub__sumOfSquaresPiS_Pl
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_ZL12sumOfSquaresPiS_Pl, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__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	.LBB4_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
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	data,@object                    # @data
	.bss
	.globl	data
	.p2align	4, 0x0
data:
	.zero	4194304
	.size	data, 4194304

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"There is no device\n"
	.size	.L.str, 20

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"There is no device supporting CUDA 1.x.\n"
	.size	.L.str.1, 41

	.type	_ZL12sumOfSquaresPiS_Pl,@object # @_ZL12sumOfSquaresPiS_Pl
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
_ZL12sumOfSquaresPiS_Pl:
	.quad	_ZL27__device_stub__sumOfSquaresPiS_Pl
	.size	_ZL12sumOfSquaresPiS_Pl, 8

	.type	.L.str.3,@object                # @.str.3
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.3:
	.asciz	"sum(GPU):%d, time: %d\n"
	.size	.L.str.3, 23

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"sum (CPU): %d\n"
	.size	.L.str.4, 15

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Device Name : %s.\n"
	.size	.L.str.5, 19

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"totalGlobalMem : %d.\n"
	.size	.L.str.6, 22

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"sharedMemPerBlock : %d.\n"
	.size	.L.str.7, 25

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"regsPerBlock : %d.\n"
	.size	.L.str.8, 20

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"warpSize : %d.\n"
	.size	.L.str.9, 16

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"memPitch : %d.\n"
	.size	.L.str.10, 16

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"maxThreadsPerBlock : %d.\n"
	.size	.L.str.11, 26

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"maxThreadsDim[0 - 2] : %d %d %d.\n"
	.size	.L.str.12, 34

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"maxGridSize[0 - 2] : %d %d %d.\n"
	.size	.L.str.13, 32

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"totalConstMem : %d.\n"
	.size	.L.str.14, 21

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"major.minor : %d.%d.\n"
	.size	.L.str.15, 22

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"clockRate : %d.\n"
	.size	.L.str.16, 17

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"textureAlignment : %d.\n"
	.size	.L.str.17, 24

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"deviceOverlap : %d.\n"
	.size	.L.str.18, 21

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"multiProcessorCount : %d.\n"
	.size	.L.str.19, 27

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_ZL12sumOfSquaresPiS_Pl"
	.size	.L__unnamed_1, 24

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"CUDA initialize."
	.size	.Lstr, 17

	.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 _ZL27__device_stub__sumOfSquaresPiS_Pl
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym data
	.addrsig_sym _ZL12sumOfSquaresPiS_Pl
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.section	.text._ZL12sumOfSquaresPiS_Pl,"axG",@progbits,_ZL12sumOfSquaresPiS_Pl,comdat
	.globl	_ZL12sumOfSquaresPiS_Pl         ; -- Begin function _ZL12sumOfSquaresPiS_Pl
	.p2align	8
	.type	_ZL12sumOfSquaresPiS_Pl,@function
_ZL12sumOfSquaresPiS_Pl:                ; @_ZL12sumOfSquaresPiS_Pl
; %bb.0:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v0, 0
	s_getreg_b32 s8, hwreg(HW_REG_SHADER_CYCLES, 0, 20)
	s_mov_b64 s[2:3], 0
.LBB0_1:                                ; =>This Inner Loop Header: Depth=1
	s_waitcnt lgkmcnt(0)
	s_add_u32 s10, s4, s2
	s_addc_u32 s11, s5, s3
	s_add_u32 s2, s2, 4
	global_load_b32 v2, v1, s[10:11]
	s_addc_u32 s3, s3, 0
	s_cmp_lg_u32 s2, 0x400000
	s_waitcnt vmcnt(0)
	v_mul_lo_u32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v2, v0
	s_cbranch_scc1 .LBB0_1
; %bb.2:
	v_mov_b32_e32 v2, 0
	global_store_b32 v2, v0, s[6:7]
	s_getreg_b32 s2, hwreg(HW_REG_SHADER_CYCLES, 0, 20)
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_sub_u32 s2, s2, s8
	s_subb_u32 s3, 0, 0
	v_dual_mov_b32 v0, s2 :: v_dual_mov_b32 v1, s3
	global_store_b64 v2, v[0:1], s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _ZL12sumOfSquaresPiS_Pl
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 3
		.amdhsa_next_free_sgpr 12
		.amdhsa_reserve_vcc 0
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.section	.text._ZL12sumOfSquaresPiS_Pl,"axG",@progbits,_ZL12sumOfSquaresPiS_Pl,comdat
.Lfunc_end0:
	.size	_ZL12sumOfSquaresPiS_Pl, .Lfunc_end0-_ZL12sumOfSquaresPiS_Pl
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 152
; NumSgprs: 12
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 12
; NumVGPRsForWavesPerEU: 3
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 24
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _ZL12sumOfSquaresPiS_Pl
    .private_segment_fixed_size: 0
    .sgpr_count:     12
    .sgpr_spill_count: 0
    .symbol:         _ZL12sumOfSquaresPiS_Pl.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
