
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

#include <stdio.h>


static __device__ __forceinline__ unsigned int bfind32_cuda(unsigned int x)
{
	unsigned int ret;
	asm volatile("bfind.u32 %0, %1;" : "=r"(ret) : "r"(x));
	return 31 - ret;
}

__device__ __host__ unsigned int nlz32_IEEE(unsigned int x)
{
	/* Hacker's Delight 2nd by H. S. Warren Jr., 5.3, p. 104 -- */
	double d = x;
	d += 0.5;
	unsigned int *p = ((unsigned int*)&d) + 1;
	return 0x41e - (*p >> 20);  // 31 - ((*(p+1)>>20) - 0x3FF)
}

__device__ __host__ unsigned int ceil2pow32(unsigned int x) {
	return (-(x != 0)) & (1 << (32 - nlz32_IEEE(x - 1)));
}

cudaError_t prefixScan(int *a, unsigned const int nsize);

__global__ void prefscan(int *a, const int width)
{
    int thidx = threadIdx.x;
	if ( !(thidx < (width>>1)) ) {
		a[thidx] = a[thidx - (width >> 1)] + a[thidx];	
	}
}

int main()
{
    int a[] = { 11, 21, 13, 24, 8, -3, 15, 31 };
	const unsigned int arraySize = sizeof(a)/sizeof(int);

	printf("{ ");
	for (int i = 0; i < arraySize; i++) {
		printf("%3d, ", a[i]);
	}
	printf("} = \n");
	// Add vectors in parallel.
    cudaError_t cudaStatus = prefixScan(a, arraySize);
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "prefscan failed!");
        return 1;
    }

	
	printf("{ ");
	for (int i = 0; i < arraySize; i++) {
		printf("%3d, ", a[i]);
	}
	printf("}\n");

    // cudaDeviceReset must be called before exiting in order for profiling and
    // tracing tools such as Nsight and Visual Profiler to show complete traces.
    cudaStatus = cudaDeviceReset();
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "cudaDeviceReset failed!");
        return 1;
    }

    return 0;
}

cudaError_t prefixScan(int *a, unsigned const int nsize) 
{
    int *dev_a = 0;
	unsigned int arraySize = ceil2pow32(nsize);
    cudaError_t cudaStatus;

    // Choose which GPU to run on, change this on a multi-GPU system.
    cudaStatus = cudaSetDevice(0);
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "cudaSetDevice failed!  Do you have a CUDA-capable GPU installed?");
        goto Error;
    }

    // Allocate GPU buffers for vectors a and b.
	cudaStatus = cudaMalloc((void**)&dev_a, arraySize * sizeof(int));
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "cudaMalloc failed!");
        goto Error;
    }

    // Copy input vectors from host memory to GPU buffers.
	cudaStatus = cudaMemcpy(dev_a, a, nsize * sizeof(int), cudaMemcpyHostToDevice);
	if ( nsize < arraySize)
		cudaStatus = cudaMemset(dev_a + nsize, 0, arraySize - nsize);
	if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "cudaMemcpy/Memset failed!");
        goto Error;
    }

    // Launch a kernel on the GPU with one thread for each element.
	for(int width = 2; width <= arraySize; width <<= 1)
	    prefscan<<<1, arraySize>>>(dev_a, width);

    // Check for any errors launching the kernel
    cudaStatus = cudaGetLastError();
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "prefixScanKernel launch failed: %s\n", cudaGetErrorString(cudaStatus));
        goto Error;
    }
    
    // cudaDeviceSynchronize waits for the kernel to finish, and returns
    // any errors encountered during the launch.
    cudaStatus = cudaDeviceSynchronize();
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus);
        goto Error;
    }

    // Copy output vector from GPU buffer to host memory.
    cudaStatus = cudaMemcpy(a, dev_a, nsize * sizeof(int), cudaMemcpyDeviceToHost);
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "cudaMemcpy failed!");
        goto Error;
    }

Error:
    cudaFree(dev_a);
    
    return cudaStatus;
}

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2034:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2034:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z10nlz32_IEEEj
	.type	_Z10nlz32_IEEEj, @function
_Z10nlz32_IEEEj:
.LFB2028:
	.cfi_startproc
	endbr64
	movl	%edi, %edi
	movl	$1054, %eax
	cvtsi2sdq	%rdi, %xmm0
	addsd	.LC0(%rip), %xmm0
	movq	%xmm0, %rdx
	shrq	$52, %rdx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z10nlz32_IEEEj, .-_Z10nlz32_IEEEj
	.globl	_Z10ceil2pow32j
	.type	_Z10ceil2pow32j, @function
_Z10ceil2pow32j:
.LFB2029:
	.cfi_startproc
	endbr64
	movl	%edi, %ecx
	leal	-1(%rdi), %edi
	call	_Z10nlz32_IEEEj
	movl	%eax, %edx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	movl	$32, %ecx
	setne	%al
	subl	%edx, %ecx
	sall	%cl, %eax
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z10ceil2pow32j, .-_Z10ceil2pow32j
	.globl	_Z28__device_stub__Z8prefscanPiiPii
	.type	_Z28__device_stub__Z8prefscanPiiPii, @function
_Z28__device_stub__Z8prefscanPiiPii:
.LFB2056:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L6
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z8prefscanPii(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L6:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z28__device_stub__Z8prefscanPiiPii, .-_Z28__device_stub__Z8prefscanPiiPii
	.globl	_Z8prefscanPii
	.type	_Z8prefscanPii, @function
_Z8prefscanPii:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z28__device_stub__Z8prefscanPiiPii
	.cfi_endproc
.LFE2057:
	.size	_Z8prefscanPii, .-_Z8prefscanPii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"cudaSetDevice failed!  Do you have a CUDA-capable GPU installed?"
.LC2:
	.string	"cudaMalloc failed!"
.LC3:
	.string	"cudaMemcpy/Memset failed!"
.LC4:
	.string	"prefixScanKernel launch failed: %s\n"
.LC5:
	.string	"cudaDeviceSynchronize returned error code %d after launching addKernel!\n"
.LC6:
	.string	"cudaMemcpy failed!"
	.text
	.globl	_Z10prefixScanPij
	.type	_Z10prefixScanPij, @function
_Z10prefixScanPij:
.LFB2031:
	.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
	movq	%rdi, %r14
	xorl	%edi, %edi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	xorl	%eax, %eax
	movq	%rax, 8(%rsp)
	call	cudaSetDevice@PLT
	leaq	.LC1(%rip), %rdx
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L28
	movl	%r12d, %edi
	call	_Z10ceil2pow32j
	leaq	8(%rsp), %rdi
	movl	%eax, %esi
	movq	%rsi, %rbp
	salq	$2, %rsi
	call	cudaMalloc@PLT
	leaq	.LC2(%rip), %rdx
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L28
	movl	%r12d, %r13d
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	%r14, %rsi
	salq	$2, %r13
	movq	%r13, %rdx
	call	cudaMemcpy@PLT
	movl	%eax, %ebx
	cmpl	%ebp, %r12d
	jnb	.L16
	movq	8(%rsp), %rdi
	movl	%ebp, %edx
	xorl	%esi, %esi
	subl	%r12d, %edx
	addq	%r13, %rdi
	call	cudaMemset@PLT
	movl	%eax, %ebx
.L16:
	movl	$2, %r12d
	leaq	.LC3(%rip), %rdx
	movabsq	$4294967297, %r15
	testl	%ebx, %ebx
	jne	.L28
.L17:
	cmpl	%r12d, %ebp
	jb	.L29
	movq	%r15, 32(%rsp)
	movl	36(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%ebp, 28(%rsp)
	movq	28(%rsp), %rdx
	movq	%r15, %rdi
	movl	$1, %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	movq	8(%rsp), %rdi
	movl	%r12d, %esi
	call	_Z28__device_stub__Z8prefscanPiiPii
.L18:
	addl	%r12d, %r12d
	jmp	.L17
.L29:
	call	cudaGetLastError@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L20
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC4(%rip), %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	jmp	.L14
.L20:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L21
	movq	stderr(%rip), %rdi
	movl	%eax, %ecx
	movl	$2, %esi
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rdx
	call	__fprintf_chk@PLT
	jmp	.L14
.L21:
	movq	8(%rsp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdx
	movq	%r14, %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L14
	leaq	.LC6(%rip), %rdx
.L28:
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L14:
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z10prefixScanPij, .-_Z10prefixScanPij
	.section	.rodata.str1.1
.LC7:
	.string	"{ "
.LC8:
	.string	"%3d, "
.LC9:
	.string	"} = \n"
.LC10:
	.string	"prefscan failed!"
.LC11:
	.string	"}\n"
.LC12:
	.string	"cudaDeviceReset failed!"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC7(%rip), %r13
	movl	$2, %edi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rsi
	leaq	.LC8(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	movabsq	$90194313227, %rax
	movq	%rax, 8(%rsp)
	movabsq	$103079215117, %rax
	movq	%rax, 16(%rsp)
	movabsq	$-12884901880, %rax
	movq	%rax, 24(%rsp)
	movabsq	$133143986191, %rax
	movq	%rax, 32(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L31:
	leaq	8(%rsp), %rbp
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movl	0(%rbp,%rbx,4), %edx
	incq	%rbx
	call	__printf_chk@PLT
	cmpq	$8, %rbx
	jne	.L31
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$8, %esi
	movq	%rbp, %rdi
	call	_Z10prefixScanPij
	testl	%eax, %eax
	je	.L32
	movq	stderr(%rip), %rdi
	leaq	.LC10(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	jmp	.L42
.L32:
	movq	%r13, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
.L34:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	cmpq	$8, %rbx
	jne	.L34
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	cudaDeviceReset@PLT
	movl	%eax, %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	je	.L30
	movq	stderr(%rip), %rdi
	leaq	.LC12(%rip), %rdx
	movl	$2, %esi
.L42:
	call	__fprintf_chk@PLT
	movl	$1, %eax
.L30:
	movq	40(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	main, .-main
	.section	.rodata.str1.1
.LC13:
	.string	"_Z8prefscanPii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2059:
	.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	.LC13(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z8prefscanPii(%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
.LFE2059:
	.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
.LC0:
	.long	0
	.long	1071644672
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include "hip/hip_runtime.h"


#include <stdio.h>


static __device__ __forceinline__ unsigned int bfind32_cuda(unsigned int x)
{
	unsigned int ret;
	asm volatile("bfind.u32 %0, %1;" : "=r"(ret) : "r"(x));
	return 31 - ret;
}

__device__ __host__ unsigned int nlz32_IEEE(unsigned int x)
{
	/* Hacker's Delight 2nd by H. S. Warren Jr., 5.3, p. 104 -- */
	double d = x;
	d += 0.5;
	unsigned int *p = ((unsigned int*)&d) + 1;
	return 0x41e - (*p >> 20);  // 31 - ((*(p+1)>>20) - 0x3FF)
}

__device__ __host__ unsigned int ceil2pow32(unsigned int x) {
	return (-(x != 0)) & (1 << (32 - nlz32_IEEE(x - 1)));
}

hipError_t prefixScan(int *a, unsigned const int nsize);

__global__ void prefscan(int *a, const int width)
{
    int thidx = threadIdx.x;
	if ( !(thidx < (width>>1)) ) {
		a[thidx] = a[thidx - (width >> 1)] + a[thidx];	
	}
}

int main()
{
    int a[] = { 11, 21, 13, 24, 8, -3, 15, 31 };
	const unsigned int arraySize = sizeof(a)/sizeof(int);

	printf("{ ");
	for (int i = 0; i < arraySize; i++) {
		printf("%3d, ", a[i]);
	}
	printf("} = \n");
	// Add vectors in parallel.
    hipError_t cudaStatus = prefixScan(a, arraySize);
    if (cudaStatus != hipSuccess) {
        fprintf(stderr, "prefscan failed!");
        return 1;
    }

	
	printf("{ ");
	for (int i = 0; i < arraySize; i++) {
		printf("%3d, ", a[i]);
	}
	printf("}\n");

    // cudaDeviceReset must be called before exiting in order for profiling and
    // tracing tools such as Nsight and Visual Profiler to show complete traces.
    cudaStatus = hipDeviceReset();
    if (cudaStatus != hipSuccess) {
        fprintf(stderr, "hipDeviceReset failed!");
        return 1;
    }

    return 0;
}

hipError_t prefixScan(int *a, unsigned const int nsize) 
{
    int *dev_a = 0;
	unsigned int arraySize = ceil2pow32(nsize);
    hipError_t cudaStatus;

    // Choose which GPU to run on, change this on a multi-GPU system.
    cudaStatus = hipSetDevice(0);
    if (cudaStatus != hipSuccess) {
        fprintf(stderr, "hipSetDevice failed!  Do you have a CUDA-capable GPU installed?");
        goto Error;
    }

    // Allocate GPU buffers for vectors a and b.
	cudaStatus = hipMalloc((void**)&dev_a, arraySize * sizeof(int));
    if (cudaStatus != hipSuccess) {
        fprintf(stderr, "hipMalloc failed!");
        goto Error;
    }

    // Copy input vectors from host memory to GPU buffers.
	cudaStatus = hipMemcpy(dev_a, a, nsize * sizeof(int), hipMemcpyHostToDevice);
	if ( nsize < arraySize)
		cudaStatus = hipMemset(dev_a + nsize, 0, arraySize - nsize);
	if (cudaStatus != hipSuccess) {
        fprintf(stderr, "cudaMemcpy/Memset failed!");
        goto Error;
    }

    // Launch a kernel on the GPU with one thread for each element.
	for(int width = 2; width <= arraySize; width <<= 1)
	    prefscan<<<1, arraySize>>>(dev_a, width);

    // Check for any errors launching the kernel
    cudaStatus = hipGetLastError();
    if (cudaStatus != hipSuccess) {
        fprintf(stderr, "prefixScanKernel launch failed: %s\n", hipGetErrorString(cudaStatus));
        goto Error;
    }
    
    // cudaDeviceSynchronize waits for the kernel to finish, and returns
    // any errors encountered during the launch.
    cudaStatus = hipDeviceSynchronize();
    if (cudaStatus != hipSuccess) {
        fprintf(stderr, "hipDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus);
        goto Error;
    }

    // Copy output vector from GPU buffer to host memory.
    cudaStatus = hipMemcpy(a, dev_a, nsize * sizeof(int), hipMemcpyDeviceToHost);
    if (cudaStatus != hipSuccess) {
        fprintf(stderr, "hipMemcpy failed!");
        goto Error;
    }

Error:
    hipFree(dev_a);
    
    return cudaStatus;
}

	.text
	.file	"main.hip"
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10nlz32_IEEEj
.LCPI0_0:
	.quad	0x3fe0000000000000              # double 0.5
	.text
	.globl	_Z10nlz32_IEEEj
	.type	_Z10nlz32_IEEEj,@function
_Z10nlz32_IEEEj:                        # @_Z10nlz32_IEEEj
	.cfi_startproc
# %bb.0:
	movl	%edi, %eax
	cvtsi2sd	%rax, %xmm0
	addsd	.LCPI0_0(%rip), %xmm0
	movq	%xmm0, %rcx
	shrq	$52, %rcx
	movl	$1054, %eax                     # imm = 0x41E
	subl	%ecx, %eax
	retq
.Lfunc_end0:
	.size	_Z10nlz32_IEEEj, .Lfunc_end0-_Z10nlz32_IEEEj
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10ceil2pow32j
.LCPI1_0:
	.quad	0x3fe0000000000000              # double 0.5
	.text
	.globl	_Z10ceil2pow32j
	.type	_Z10ceil2pow32j,@function
_Z10ceil2pow32j:                        # @_Z10ceil2pow32j
	.cfi_startproc
# %bb.0:
                                        # kill: def $edi killed $edi def $rdi
	leal	-1(%rdi), %eax
	cvtsi2sd	%rax, %xmm0
	addsd	.LCPI1_0(%rip), %xmm0
	movq	%xmm0, %rcx
	shrq	$52, %rcx
	addb	$2, %cl
	movl	$1, %edx
                                        # kill: def $cl killed $cl killed $rcx
	shll	%cl, %edx
	xorl	%eax, %eax
	cmpl	$1, %edi
	cmovael	%edx, %eax
	retq
.Lfunc_end1:
	.size	_Z10ceil2pow32j, .Lfunc_end1-_Z10ceil2pow32j
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__prefscanPii  # -- Begin function _Z23__device_stub__prefscanPii
	.type	_Z23__device_stub__prefscanPii,@function
_Z23__device_stub__prefscanPii:         # @_Z23__device_stub__prefscanPii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%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	$_Z8prefscanPii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z23__device_stub__prefscanPii, .Lfunc_end2-_Z23__device_stub__prefscanPii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI3_0:
	.long	11                              # 0xb
	.long	21                              # 0x15
	.long	13                              # 0xd
	.long	24                              # 0x18
.LCPI3_1:
	.long	8                               # 0x8
	.long	4294967293                      # 0xfffffffd
	.long	15                              # 0xf
	.long	31                              # 0x1f
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movaps	.LCPI3_0(%rip), %xmm0           # xmm0 = [11,21,13,24]
	movaps	%xmm0, (%rsp)
	movaps	.LCPI3_1(%rip), %xmm0           # xmm0 = [8,4294967293,15,31]
	movaps	%xmm0, 16(%rsp)
	movl	$.L.str, %edi
	xorl	%eax, %eax
	callq	printf
	xorl	%ebx, %ebx
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	movl	(%rsp,%rbx,4), %esi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%rbx
	cmpq	$8, %rbx
	jne	.LBB3_1
# %bb.2:
	movl	$.Lstr, %edi
	callq	puts@PLT
	movq	%rsp, %rdi
	movl	$8, %esi
	callq	_Z10prefixScanPij
	testl	%eax, %eax
	jne	.LBB3_3
# %bb.4:
	movl	$.L.str, %edi
	xorl	%eax, %eax
	callq	printf
	xorl	%ebx, %ebx
.LBB3_5:                                # =>This Inner Loop Header: Depth=1
	movl	(%rsp,%rbx,4), %esi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%rbx
	cmpq	$8, %rbx
	jne	.LBB3_5
# %bb.6:
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	callq	hipDeviceReset
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	.LBB3_7
.LBB3_9:
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB3_3:
	.cfi_def_cfa_offset 48
	movq	stderr(%rip), %rcx
	movl	$.L.str.3, %edi
	movl	$16, %esi
	jmp	.LBB3_8
.LBB3_7:
	movq	stderr(%rip), %rcx
	movl	$.L.str.5, %edi
	movl	$22, %esi
.LBB3_8:
	movl	$1, %edx
	callq	fwrite@PLT
	movl	$1, %eax
	jmp	.LBB3_9
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10prefixScanPij
.LCPI4_0:
	.quad	0x3fe0000000000000              # double 0.5
	.text
	.globl	_Z10prefixScanPij
	.type	_Z10prefixScanPij,@function
_Z10prefixScanPij:                      # @_Z10prefixScanPij
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %r12d
	leal	-1(%r12), %eax
	cvtsi2sd	%rax, %xmm0
	movq	%rdi, %rbx
	addsd	.LCPI4_0(%rip), %xmm0
	movq	%xmm0, %rcx
	shrq	$52, %rcx
	addb	$2, %cl
	movl	$1, %r13d
                                        # kill: def $cl killed $cl killed $rcx
	shll	%cl, %r13d
	xorl	%eax, %eax
	cmpl	$1, %esi
	movq	$0, (%rsp)
	cmovbl	%eax, %r13d
	xorl	%edi, %edi
	callq	hipSetDevice
	testl	%eax, %eax
	jne	.LBB4_1
# %bb.2:
	movl	%r13d, %r15d
	leaq	(,%r15,4), %rsi
	movq	%rsp, %rdi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_3
# %bb.4:
	movq	(%rsp), %rdi
	movl	%r12d, %r14d
	shlq	$2, %r14
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	%r13d, %edx
	subl	%r12d, %edx
	jbe	.LBB4_6
# %bb.5:
	movq	(%rsp), %rdi
	addq	%r14, %rdi
	xorl	%esi, %esi
	callq	hipMemset
.LBB4_6:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB4_14
# %bb.7:                                # %.preheader
	cmpl	$2, %r13d
	jb	.LBB4_12
# %bb.8:                                # %.lr.ph
	movabsq	$4294967296, %r12               # imm = 0x100000000
	btsq	$32, %r15
	movl	$2, %ebp
	incq	%r12
.LBB4_9:                                # =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_11
# %bb.10:                               #   in Loop: Header=BB4_9 Depth=1
	movq	(%rsp), %rdi
	movl	%ebp, %esi
	callq	_Z23__device_stub__prefscanPii
.LBB4_11:                               #   in Loop: Header=BB4_9 Depth=1
	addl	%ebp, %ebp
	cmpl	%r13d, %ebp
	jbe	.LBB4_9
.LBB4_12:                               # %._crit_edge
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB4_13
# %bb.16:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB4_17
# %bb.18:
	movq	(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	xorl	%ebp, %ebp
	testl	%eax, %eax
	jne	.LBB4_19
.LBB4_20:
	movq	(%rsp), %rdi
	callq	hipFree
	movl	%ebp, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB4_1:
	.cfi_def_cfa_offset 64
	movl	%eax, %ebp
	movq	stderr(%rip), %rcx
	movl	$.L.str.6, %edi
	movl	$63, %esi
	jmp	.LBB4_15
.LBB4_3:
	movl	%eax, %ebp
	movq	stderr(%rip), %rcx
	movl	$.L.str.7, %edi
	movl	$17, %esi
	jmp	.LBB4_15
.LBB4_14:
	movq	stderr(%rip), %rcx
	movl	$.L.str.8, %edi
	movl	$25, %esi
.LBB4_15:
	movl	$1, %edx
	callq	fwrite@PLT
	jmp	.LBB4_20
.LBB4_13:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.9, %esi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB4_20
.LBB4_17:
	movl	%eax, %ebp
	movq	stderr(%rip), %rdi
	movl	$.L.str.10, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB4_20
.LBB4_19:
	movl	%eax, %ebx
	movq	stderr(%rip), %rcx
	movl	$.L.str.11, %edi
	movl	$17, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movl	%ebx, %ebp
	jmp	.LBB4_20
.Lfunc_end4:
	.size	_Z10prefixScanPij, .Lfunc_end4-_Z10prefixScanPij
	.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	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8prefscanPii, %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_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__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	.LBB6_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
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z8prefscanPii,@object          # @_Z8prefscanPii
	.section	.rodata,"a",@progbits
	.globl	_Z8prefscanPii
	.p2align	3, 0x0
_Z8prefscanPii:
	.quad	_Z23__device_stub__prefscanPii
	.size	_Z8prefscanPii, 8

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

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%3d, "
	.size	.L.str.1, 6

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"prefscan failed!"
	.size	.L.str.3, 17

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"hipDeviceReset failed!"
	.size	.L.str.5, 23

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"hipSetDevice failed!  Do you have a CUDA-capable GPU installed?"
	.size	.L.str.6, 64

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"hipMalloc failed!"
	.size	.L.str.7, 18

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"cudaMemcpy/Memset failed!"
	.size	.L.str.8, 26

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"prefixScanKernel launch failed: %s\n"
	.size	.L.str.9, 36

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"hipDeviceSynchronize returned error code %d after launching addKernel!\n"
	.size	.L.str.10, 72

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"hipMemcpy failed!"
	.size	.L.str.11, 18

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z8prefscanPii"
	.size	.L__unnamed_1, 15

	.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	"} = "
	.size	.Lstr, 5

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"}"
	.size	.Lstr.1, 2

	.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 _Z23__device_stub__prefscanPii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z8prefscanPii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8prefscanPii          ; -- Begin function _Z8prefscanPii
	.globl	_Z8prefscanPii
	.p2align	8
	.type	_Z8prefscanPii,@function
_Z8prefscanPii:                         ; @_Z8prefscanPii
; %bb.0:
	s_load_b32 s2, s[0:1], 0x8
	s_mov_b32 s3, exec_lo
	s_waitcnt lgkmcnt(0)
	s_ashr_i32 s2, s2, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cmpx_le_i32_e64 s2, v0
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x0
	v_subrev_nc_u32_e32 v1, s2, v0
	v_lshlrev_b32_e32 v0, 2, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	s_clause 0x1
	global_load_b32 v1, v[1:2], off
	global_load_b32 v2, v0, s[0:1]
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v1, v2, v1
	global_store_b32 v0, v1, s[0:1]
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8prefscanPii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 12
		.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 4
		.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	_Z8prefscanPii, .Lfunc_end0-_Z8prefscanPii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 136
; NumSgprs: 6
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 6
; 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
      - .offset:         8
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 12
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8prefscanPii
    .private_segment_fixed_size: 0
    .sgpr_count:     6
    .sgpr_spill_count: 0
    .symbol:         _Z8prefscanPii.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
