/**  
  This example is based on the article titled "CUDA Pro Tip: Occupancy API Simplifies Launch Configuration".
  More info on https://devblogs.nvidia.com/parallelforall/cuda-pro-tip-occupancy-api-simplifies-launch-configuration/
*/

#include "stdio.h"

__global__ void VectorMultiplicationKernel(int *array, int arrayCount)
{
    int idx = threadIdx.x + blockIdx.x * blockDim.x;
    if (idx < arrayCount)
    {
        array[idx] *= array[idx];
    }
}

void launchMaxOccupancyKernel(int *array, int arrayCount)
{
    int blockSize;   // The launch configurator returned block size
    int minGridSize; // The minimum grid size needed to achieve the
    int gridSize;    // The actual grid size needed, based on input size

    cudaOccupancyMaxPotentialBlockSize( &minGridSize, &blockSize, VectorMultiplicationKernel, 0, 0);
    // Round up according to array size
    gridSize = (arrayCount + blockSize - 1) / blockSize;
    printf("Grid size is %d, array count is %d, min grid size is %d\n", gridSize, arrayCount, minGridSize);

    VectorMultiplicationKernel<<< gridSize, blockSize >>>(array, arrayCount);

    cudaDeviceSynchronize();

    // calculate theoretical occupancy
    int maxActiveBlocks;
    cudaOccupancyMaxActiveBlocksPerMultiprocessor( &maxActiveBlocks,
                                                   VectorMultiplicationKernel,
                                                   blockSize, 0);

    int device;
    cudaDeviceProp props;
    cudaGetDevice(&device);
    cudaGetDeviceProperties(&props, device);

    float occupancy = (float) (maxActiveBlocks * blockSize / props.warpSize) /
            (float)(props.maxThreadsPerMultiProcessor / props.warpSize);

    printf("Device maxThreadsPerMultiProcessor %d\n", props.maxThreadsPerMultiProcessor);
    printf("Device warpSize %d\n", props.warpSize);

    printf("Launched blocks of size %d. Theoretical occupancy: %f\n", blockSize, occupancy);
}

void initializeData(int *array, int count){
    for (int i = 0; i < count; i += 1) {
        array[i] = i;
    }
}

void resetData(int *array, int count){
    for (int i = 0; i < count; i += 1) {
        array[i] = 0;
    }
}

void verifyData(int *array, int count){
    bool isDataCorrect = true;

    for (int i = 0; i < count; i += 1) {
        if (array[i] != i * i) {
            printf("Element %d expected: %d actual %d", i, i *i, array[i]);
            isDataCorrect = false;
        }
    }
    if (isDataCorrect) printf("Data is correct\n");
}

int main()
{
    const int count = 1000000;
    int *hostArray;
    int *deviceArray;
    int size = count * sizeof(int);

    hostArray = new int[count];

    initializeData(hostArray, count);

    cudaMalloc(&deviceArray, size);
    cudaMemcpy(deviceArray, hostArray, size, cudaMemcpyHostToDevice);

    resetData(hostArray, count);

    launchMaxOccupancyKernel(deviceArray, count);

    cudaMemcpy(hostArray, deviceArray, size, cudaMemcpyDeviceToHost);
    verifyData(hostArray, count);

    cudaFree(deviceArray);

    delete[] hostArray;

    return 0;
}

	.file	"tmpxft_002bff92_00000000-6_vector_multi.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	_Z14initializeDataPii
	.type	_Z14initializeDataPii, @function
_Z14initializeDataPii:
.LFB2028:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L3:
	cmpl	%eax, %esi
	jle	.L6
	movl	%eax, (%rdi,%rax,4)
	incq	%rax
	jmp	.L3
.L6:
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z14initializeDataPii, .-_Z14initializeDataPii
	.globl	_Z9resetDataPii
	.type	_Z9resetDataPii, @function
_Z9resetDataPii:
.LFB2029:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L8:
	cmpl	%eax, %esi
	jle	.L10
	xorl	%edx, %edx
	movl	%edx, (%rdi,%rax,4)
	incq	%rax
	jmp	.L8
.L10:
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z9resetDataPii, .-_Z9resetDataPii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Element %d expected: %d actual %d"
.LC1:
	.string	"Data is correct\n"
	.text
	.globl	_Z10verifyDataPii
	.type	_Z10verifyDataPii, @function
_Z10verifyDataPii:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movb	$1, %al
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 48
.L12:
	movl	%ebx, %edx
	cmpl	%ebx, %ebp
	jle	.L17
	movl	%ebx, %ecx
	movl	(%r12,%rbx,4), %r8d
	imull	%ebx, %ecx
	cmpl	%ecx, %r8d
	je	.L13
	movq	%r13, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
.L13:
	incq	%rbx
	jmp	.L12
.L17:
	testb	%al, %al
	je	.L11
	popq	%rdx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	leaq	.LC1(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L11:
	.cfi_restore_state
	popq	%rax
	.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	_Z10verifyDataPii, .-_Z10verifyDataPii
	.globl	_Z47__device_stub__Z26VectorMultiplicationKernelPiiPii
	.type	_Z47__device_stub__Z26VectorMultiplicationKernelPiiPii, @function
_Z47__device_stub__Z26VectorMultiplicationKernelPiiPii:
.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	.L18
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z26VectorMultiplicationKernelPii(%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
.L18:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z47__device_stub__Z26VectorMultiplicationKernelPiiPii, .-_Z47__device_stub__Z26VectorMultiplicationKernelPiiPii
	.globl	_Z26VectorMultiplicationKernelPii
	.type	_Z26VectorMultiplicationKernelPii, @function
_Z26VectorMultiplicationKernelPii:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z47__device_stub__Z26VectorMultiplicationKernelPiiPii
	.cfi_endproc
.LFE2057:
	.size	_Z26VectorMultiplicationKernelPii, .-_Z26VectorMultiplicationKernelPii
	.section	.rodata.str1.1
.LC2:
	.string	"Grid size is %d, array count is %d, min grid size is %d\n"
.LC3:
	.string	"Device maxThreadsPerMultiProcessor %d\n"
.LC4:
	.string	"Device warpSize %d\n"
.LC5:
	.string	"Launched blocks of size %d. Theoretical occupancy: %f\n"
	.text
	.globl	_Z24launchMaxOccupancyKernelPii
	.type	_Z24launchMaxOccupancyKernelPii, @function
_Z24launchMaxOccupancyKernelPii:
.LFB2027:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1144, %rsp
	.cfi_def_cfa_offset 1200
	movq	%rdi, 32(%rsp)
	leaq	56(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1128(%rsp)
	xorl	%eax, %eax
	call	cudaGetDevice@PLT
	testl	%eax, %eax
	leaq	72(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 16(%rsp)
	jne	.L25
	movl	56(%rsp), %edx
	leaq	60(%rsp), %rdi
	movl	$39, %esi
	call	cudaDeviceGetAttribute@PLT
	testl	%eax, %eax
	jne	.L25
	movl	56(%rsp), %edx
	leaq	64(%rsp), %rdi
	movl	$10, %esi
	call	cudaDeviceGetAttribute@PLT
	testl	%eax, %eax
	jne	.L25
	movl	56(%rsp), %edx
	leaq	68(%rsp), %rdi
	movl	$1, %esi
	call	cudaDeviceGetAttribute@PLT
	testl	%eax, %eax
	jne	.L25
	movl	56(%rsp), %edx
	movq	8(%rsp), %rdi
	movl	$16, %esi
	call	cudaDeviceGetAttribute@PLT
	testl	%eax, %eax
	jne	.L25
	movq	16(%rsp), %rdi
	leaq	_Z26VectorMultiplicationKernelPii(%rip), %rsi
	call	cudaFuncGetAttributes@PLT
	testl	%eax, %eax
	jne	.L25
	movl	60(%rsp), %eax
	movl	120(%rsp), %r12d
	movl	64(%rsp), %r15d
	movl	%eax, 24(%rsp)
	movl	68(%rsp), %eax
	cmpl	%eax, %r12d
	cmovg	%eax, %r12d
	xorl	%r10d, %r10d
	xorl	%r14d, %r14d
	xorl	%ebp, %ebp
	leal	-1(%r15,%r12), %ebx
	movl	%ebx, %eax
	cltd
	idivl	%r15d
	subl	%edx, %ebx
.L27:
	testl	%ebx, %ebx
	jle	.L29
	cmpl	%ebx, %r12d
	movl	%ebx, %edx
	leaq	84(%rsp), %rdi
	movl	%r10d, 44(%rsp)
	cmovle	%r12d, %edx
	leaq	_Z26VectorMultiplicationKernelPii(%rip), %rsi
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	movl	%edx, 40(%rsp)
	call	cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags@PLT
	testl	%eax, %eax
	jne	.L25
	movl	40(%rsp), %edx
	movl	84(%rsp), %eax
	movl	44(%rsp), %r10d
	movl	%edx, %ecx
	imull	%eax, %ecx
	cmpl	%r10d, %ecx
	jle	.L28
	movl	%ecx, %r10d
	movl	%eax, %r14d
	movl	%edx, %ebp
.L28:
	cmpl	%r10d, 24(%rsp)
	je	.L29
	subl	%r15d, %ebx
	jmp	.L27
.L29:
	imull	72(%rsp), %r14d
	movl	%r14d, 28(%rsp)
.L25:
	leal	-1(%rbp,%r13), %eax
	movl	28(%rsp), %r8d
	movl	%r13d, %ecx
	leaq	.LC2(%rip), %rsi
	cltd
	movl	$2, %edi
	idivl	%ebp
	movl	%eax, %edx
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebp, 84(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rax
	movl	%ebx, 72(%rsp)
	movq	%rax, 88(%rsp)
	movl	92(%rsp), %ecx
	movq	%rax, 76(%rsp)
	movq	84(%rsp), %rdx
	movq	72(%rsp), %rdi
	movl	80(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L31
	movq	32(%rsp), %rdi
	movl	%r13d, %esi
	call	_Z47__device_stub__Z26VectorMultiplicationKernelPiiPii
.L31:
	call	cudaDeviceSynchronize@PLT
	movq	8(%rsp), %rdi
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	movl	%ebp, %edx
	leaq	_Z26VectorMultiplicationKernelPii(%rip), %rsi
	call	cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags@PLT
	leaq	84(%rsp), %rdi
	call	cudaGetDevice@PLT
	movl	84(%rsp), %esi
	movq	16(%rsp), %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movl	72(%rsp), %eax
	movl	$2, %edi
	movl	404(%rsp), %ecx
	leaq	.LC3(%rip), %rsi
	imull	%ebp, %eax
	cltd
	idivl	%ecx
	cvtsi2ssl	%eax, %xmm0
	movl	720(%rsp), %eax
	cltd
	idivl	%ecx
	movl	720(%rsp), %edx
	cvtsi2ssl	%eax, %xmm1
	xorl	%eax, %eax
	divss	%xmm1, %xmm0
	movss	%xmm0, 8(%rsp)
	call	__printf_chk@PLT
	movl	404(%rsp), %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movss	8(%rsp), %xmm0
	movl	%ebp, %edx
	movb	$1, %al
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movq	1128(%rsp), %rax
	subq	%fs:40, %rax
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	addq	$1144, %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
.LFE2027:
	.size	_Z24launchMaxOccupancyKernelPii, .-_Z24launchMaxOccupancyKernelPii
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$4000000, %edi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	_Znam@PLT
	movl	$1000000, %esi
	movq	%rax, %rdi
	movq	%rax, %rbx
	call	_Z14initializeDataPii
	movq	%rsp, %rdi
	movl	$4000000, %esi
	call	cudaMalloc@PLT
	movq	(%rsp), %rdi
	movl	$4000000, %edx
	movq	%rbx, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	$1000000, %esi
	movq	%rbx, %rdi
	call	_Z9resetDataPii
	movq	(%rsp), %rdi
	call	_Z24launchMaxOccupancyKernelPii
	movq	(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	movl	$4000000, %edx
	call	cudaMemcpy@PLT
	movl	$1000000, %esi
	movq	%rbx, %rdi
	call	_Z10verifyDataPii
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	main, .-main
	.section	.rodata.str1.1
.LC6:
	.string	"_Z26VectorMultiplicationKernelPii"
	.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	.LC6(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z26VectorMultiplicationKernelPii(%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
	.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:

/**  
  This example is based on the article titled "CUDA Pro Tip: Occupancy API Simplifies Launch Configuration".
  More info on https://devblogs.nvidia.com/parallelforall/cuda-pro-tip-occupancy-api-simplifies-launch-configuration/
*/


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

__global__ void VectorMultiplicationKernel(int *array, int arrayCount)
{
    int idx = threadIdx.x + blockIdx.x * blockDim.x;
    if (idx < arrayCount)
    {
        array[idx] *= array[idx];
    }
}

void launchMaxOccupancyKernel(int *array, int arrayCount)
{
    int blockSize;   // The launch configurator returned block size
    int minGridSize; // The minimum grid size needed to achieve the
    int gridSize;    // The actual grid size needed, based on input size

    hipOccupancyMaxPotentialBlockSize( &minGridSize, &blockSize, VectorMultiplicationKernel, 0, 0);
    // Round up according to array size
    gridSize = (arrayCount + blockSize - 1) / blockSize;
    printf("Grid size is %d, array count is %d, min grid size is %d\n", gridSize, arrayCount, minGridSize);

    VectorMultiplicationKernel<<< gridSize, blockSize >>>(array, arrayCount);

    hipDeviceSynchronize();

    // calculate theoretical occupancy
    int maxActiveBlocks;
    hipOccupancyMaxActiveBlocksPerMultiprocessor( &maxActiveBlocks,
                                                   VectorMultiplicationKernel,
                                                   blockSize, 0);

    int device;
    hipDeviceProp_t props;
    hipGetDevice(&device);
    hipGetDeviceProperties(&props, device);

    float occupancy = (float) (maxActiveBlocks * blockSize / props.warpSize) /
            (float)(props.maxThreadsPerMultiProcessor / props.warpSize);

    printf("Device maxThreadsPerMultiProcessor %d\n", props.maxThreadsPerMultiProcessor);
    printf("Device warpSize %d\n", props.warpSize);

    printf("Launched blocks of size %d. Theoretical occupancy: %f\n", blockSize, occupancy);
}

void initializeData(int *array, int count){
    for (int i = 0; i < count; i += 1) {
        array[i] = i;
    }
}

void resetData(int *array, int count){
    for (int i = 0; i < count; i += 1) {
        array[i] = 0;
    }
}

void verifyData(int *array, int count){
    bool isDataCorrect = true;

    for (int i = 0; i < count; i += 1) {
        if (array[i] != i * i) {
            printf("Element %d expected: %d actual %d", i, i *i, array[i]);
            isDataCorrect = false;
        }
    }
    if (isDataCorrect) printf("Data is correct\n");
}

int main()
{
    const int count = 1000000;
    int *hostArray;
    int *deviceArray;
    int size = count * sizeof(int);

    hostArray = new int[count];

    initializeData(hostArray, count);

    hipMalloc(&deviceArray, size);
    hipMemcpy(deviceArray, hostArray, size, hipMemcpyHostToDevice);

    resetData(hostArray, count);

    launchMaxOccupancyKernel(deviceArray, count);

    hipMemcpy(hostArray, deviceArray, size, hipMemcpyDeviceToHost);
    verifyData(hostArray, count);

    hipFree(deviceArray);

    delete[] hostArray;

    return 0;
}

	.text
	.file	"vector_multi.hip"
	.globl	_Z41__device_stub__VectorMultiplicationKernelPii # -- Begin function _Z41__device_stub__VectorMultiplicationKernelPii
	.type	_Z41__device_stub__VectorMultiplicationKernelPii,@function
_Z41__device_stub__VectorMultiplicationKernelPii: # @_Z41__device_stub__VectorMultiplicationKernelPii
	.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	$_Z26VectorMultiplicationKernelPii, %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_end0:
	.size	_Z41__device_stub__VectorMultiplicationKernelPii, .Lfunc_end0-_Z41__device_stub__VectorMultiplicationKernelPii
	.cfi_endproc
                                        # -- End function
	.globl	_Z24launchMaxOccupancyKernelPii # -- Begin function _Z24launchMaxOccupancyKernelPii
	.type	_Z24launchMaxOccupancyKernelPii,@function
_Z24launchMaxOccupancyKernelPii:        # @_Z24launchMaxOccupancyKernelPii
	.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	$1504, %rsp                     # imm = 0x5E0
	.cfi_def_cfa_offset 1552
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	%esi, %ebx
	movq	%rdi, %r14
	leaq	28(%rsp), %r12
	leaq	12(%rsp), %r15
	movl	$_Z26VectorMultiplicationKernelPii, %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	hipOccupancyMaxPotentialBlockSize
	movl	(%r15), %ecx
	leal	(%rbx,%rcx), %eax
	decl	%eax
	cltd
	idivl	%ecx
	movl	%eax, %r13d
	movl	(%r12), %ecx
	movl	$.L.str, %edi
	movl	%eax, %esi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	printf
	movl	(%r15), %edx
	btsq	$32, %r13
	btsq	$32, %rdx
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_2
# %bb.1:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_Z41__device_stub__VectorMultiplicationKernelPii
.LBB1_2:
	callq	hipDeviceSynchronize
	movl	12(%rsp), %edx
	leaq	24(%rsp), %r14
	movl	$_Z26VectorMultiplicationKernelPii, %esi
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	hipOccupancyMaxActiveBlocksPerMultiprocessor
	leaq	20(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDevice
	movl	(%rbx), %esi
	leaq	32(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDevicePropertiesR0600
	movl	12(%rsp), %eax
	imull	(%r14), %eax
	movl	308(%rbx), %ecx
	movl	624(%rbx), %esi
	cltd
	idivl	%ecx
	cvtsi2ss	%eax, %xmm1
	movl	%esi, %eax
	cltd
	idivl	%ecx
	cvtsi2ss	%eax, %xmm0
	divss	%xmm0, %xmm1
	movss	%xmm1, 16(%rsp)                 # 4-byte Spill
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	movl	308(%rbx), %esi
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	movl	12(%rsp), %esi
	xorps	%xmm0, %xmm0
	cvtss2sd	16(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$.L.str.3, %edi
	movb	$1, %al
	callq	printf
	addq	$1504, %rsp                     # imm = 0x5E0
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z24launchMaxOccupancyKernelPii, .Lfunc_end1-_Z24launchMaxOccupancyKernelPii
	.cfi_endproc
                                        # -- End function
	.globl	_Z14initializeDataPii           # -- Begin function _Z14initializeDataPii
	.type	_Z14initializeDataPii,@function
_Z14initializeDataPii:                  # @_Z14initializeDataPii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB2_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%esi, %eax
	xorl	%ecx, %ecx
.LBB2_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	%ecx, (%rdi,%rcx,4)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB2_2
.LBB2_3:                                # %._crit_edge
	retq
.Lfunc_end2:
	.size	_Z14initializeDataPii, .Lfunc_end2-_Z14initializeDataPii
	.cfi_endproc
                                        # -- End function
	.globl	_Z9resetDataPii                 # -- Begin function _Z9resetDataPii
	.type	_Z9resetDataPii,@function
_Z9resetDataPii:                        # @_Z9resetDataPii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB3_1
# %bb.2:                                # %.lr.ph.preheader
	movl	%esi, %edx
	shlq	$2, %rdx
	xorl	%esi, %esi
	jmp	memset@PLT                      # TAILCALL
.LBB3_1:                                # %._crit_edge
	retq
.Lfunc_end3:
	.size	_Z9resetDataPii, .Lfunc_end3-_Z9resetDataPii
	.cfi_endproc
                                        # -- End function
	.globl	_Z10verifyDataPii               # -- Begin function _Z10verifyDataPii
	.type	_Z10verifyDataPii,@function
_Z10verifyDataPii:                      # @_Z10verifyDataPii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB4_7
# %bb.1:                                # %.lr.ph.preheader
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, %rbx
	movl	%esi, %r15d
	movb	$1, %bpl
	xorl	%r14d, %r14d
.LBB4_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r14,4), %ecx
	movl	%r14d, %eax
	imull	%r14d, %eax
	cmpl	%eax, %ecx
	je	.LBB4_4
# %bb.3:                                #   in Loop: Header=BB4_2 Depth=1
	movl	%r14d, %edx
	imull	%r14d, %edx
	xorl	%ebp, %ebp
	movl	$.L.str.4, %edi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	printf
.LBB4_4:                                #   in Loop: Header=BB4_2 Depth=1
	incq	%r14
	cmpq	%r14, %r15
	jne	.LBB4_2
# %bb.5:                                # %._crit_edge
	testb	$1, %bpl
	leaq	8(%rsp), %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
	jne	.LBB4_7
# %bb.6:
	retq
.LBB4_7:                                # %._crit_edge.thread
	movl	$.Lstr, %edi
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end4:
	.size	_Z10verifyDataPii, .Lfunc_end4-_Z10verifyDataPii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	$4000000, %edi                  # imm = 0x3D0900
	callq	_Znam
	movq	%rax, %rbx
	xorl	%eax, %eax
.LBB5_1:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movl	%eax, (%rbx,%rax,4)
	incq	%rax
	cmpq	$1000000, %rax                  # imm = 0xF4240
	jne	.LBB5_1
# %bb.2:                                # %_Z14initializeDataPii.exit
	movq	%rsp, %r14
	movl	$4000000, %esi                  # imm = 0x3D0900
	movq	%r14, %rdi
	callq	hipMalloc
	movq	(%r14), %rdi
	movl	$4000000, %edx                  # imm = 0x3D0900
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$4000000, %edx                  # imm = 0x3D0900
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movq	(%r14), %rdi
	movl	$1000000, %esi                  # imm = 0xF4240
	callq	_Z24launchMaxOccupancyKernelPii
	movq	(%r14), %rsi
	movl	$4000000, %edx                  # imm = 0x3D0900
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	%rbx, %rdi
	movl	$1000000, %esi                  # imm = 0xF4240
	callq	_Z10verifyDataPii
	movq	(%r14), %rdi
	callq	hipFree
	movq	%rbx, %rdi
	callq	_ZdaPv
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	main, .Lfunc_end5-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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z26VectorMultiplicationKernelPii, %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_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z26VectorMultiplicationKernelPii,@object # @_Z26VectorMultiplicationKernelPii
	.section	.rodata,"a",@progbits
	.globl	_Z26VectorMultiplicationKernelPii
	.p2align	3, 0x0
_Z26VectorMultiplicationKernelPii:
	.quad	_Z41__device_stub__VectorMultiplicationKernelPii
	.size	_Z26VectorMultiplicationKernelPii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Grid size is %d, array count is %d, min grid size is %d\n"
	.size	.L.str, 57

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Device maxThreadsPerMultiProcessor %d\n"
	.size	.L.str.1, 39

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Device warpSize %d\n"
	.size	.L.str.2, 20

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Launched blocks of size %d. Theoretical occupancy: %f\n"
	.size	.L.str.3, 55

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Element %d expected: %d actual %d"
	.size	.L.str.4, 34

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z26VectorMultiplicationKernelPii"
	.size	.L__unnamed_1, 34

	.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	"Data is correct"
	.size	.Lstr, 16

	.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 _Z41__device_stub__VectorMultiplicationKernelPii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z26VectorMultiplicationKernelPii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z26VectorMultiplicationKernelPii ; -- Begin function _Z26VectorMultiplicationKernelPii
	.globl	_Z26VectorMultiplicationKernelPii
	.p2align	8
	.type	_Z26VectorMultiplicationKernelPii,@function
_Z26VectorMultiplicationKernelPii:      ; @_Z26VectorMultiplicationKernelPii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x1c
	s_load_b32 s3, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_load_b32 v2, v[0:1], off
	s_waitcnt vmcnt(0)
	v_mul_lo_u32 v2, v2, v2
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z26VectorMultiplicationKernelPii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 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	_Z26VectorMultiplicationKernelPii, .Lfunc_end0-_Z26VectorMultiplicationKernelPii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 144
; NumSgprs: 18
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; 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
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z26VectorMultiplicationKernelPii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z26VectorMultiplicationKernelPii.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
