#include <cuda.h>
#include <cuda_runtime_api.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdlib.h>

//#define N 4
#define BLOCK_SIZE 4
#define GRID_SIZE 2


// threadfence();

using namespace std;

__device__ volatile int Arrayin[100];
__device__ volatile int Arrayout[100];


void cuda_error_check(cudaError_t err , const char *msg )
{
    if(err != cudaSuccess)
    {
      printf("The error is %s, %s \n", cudaGetErrorString(err), msg );
      exit(1);
    }
}

__device__ void __gpu_sync(int goalVal , volatile int *Arrayin , volatile int *Arrayout)
{
    // thread ID in a block
    int tid_in_blk = threadIdx.x * blockDim.y  + threadIdx.y;
    int nBlockNum = gridDim.x * gridDim.y;
    int bid = blockIdx.x * gridDim.y + blockIdx.y;


    // only thread 0 is used for synchronization
    if (tid_in_blk == 0)
    {
        Arrayin[bid] = goalVal;
    }
    
    if (bid == 1)
    {
        if (tid_in_blk < nBlockNum)
        {
            while (Arrayin[tid_in_blk] != goalVal){
            //Do nothing here
            }
        }

        __syncthreads();
        __threadfence();

        if (tid_in_blk < nBlockNum)
        {
            Arrayout[tid_in_blk] = goalVal;
        }
    }
    if (tid_in_blk == 0)
    {
            while (Arrayout[bid] != goalVal){
            //Do nothing here
            }
    }

    __syncthreads();
    __threadfence();

}

__global__ void matrix(int *d_a)
{

    int row = (blockIdx.y * blockDim.y) + threadIdx.y ; 
    int col = (blockIdx.x * blockDim.x) + threadIdx.x ;
    //int L1  = blockDim.x ;
    //int L2  = blockDim.y ;
      
    int offset = col + row * blockDim.x * gridDim.x ;

    int blockid = blockIdx.y * gridDim.x + blockIdx.x ;
    int off = col + row * gridDim.x  - blockDim.x*blockid ;

    off += (blockDim.x - gridDim.x ) * threadIdx.y;

    int off_x = off - (threadIdx.y * blockDim.x) ;
    int off_y = (off - threadIdx.x) / blockDim.x ;



    //while(blockid!=g_mutex ){}
    __gpu_sync(4, Arrayin , Arrayout) ;

    d_a[offset] = 0 ;  

    /*if(blockid == g_mutex && off==0)
    {   atomicAdd((int *)&g_mutex, 1);
    }*/

}

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

    int a[(GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE];
    int i,j;
    //int m,n;
     
    for(j=0;j<(GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE;j++)
    {
        a[j]=0;
    }

    int *d_a ;

    cuda_error_check(cudaSetDevice(0) , "cudaSetDevice failed!" );

    cudaDeviceReset();

    cuda_error_check(cudaMalloc((void **)&d_a , (GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE* sizeof(int)),"cudaMalloc Failed!");
    cuda_error_check(cudaMemcpy(d_a , a , (GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE * sizeof(int) , cudaMemcpyHostToDevice),"cudaMemcpy H-D failed!");

    dim3 dimBlock(BLOCK_SIZE , BLOCK_SIZE );
    dim3 dimGrid(GRID_SIZE , GRID_SIZE);

    matrix<<< dimGrid , dimBlock >>>(d_a);

    cuda_error_check(cudaMemcpy(a , d_a , (GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE * sizeof(int) , cudaMemcpyDeviceToHost),"cudaMemcpy D-H failed!");


for(j=0;j<(GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE;j++)
{
    if(j%(BLOCK_SIZE*GRID_SIZE) == 0)
        cout<<endl;
    if(j%(GRID_SIZE*BLOCK_SIZE*BLOCK_SIZE)==0)
        cout<<endl;
    if(j%BLOCK_SIZE ==0)
        cout<<"  ";
        
    cout.width( 3 );
    cout<<a[j]<<" ";
}
            printf("\n\n");

 /*for(m=0;m<2;m++)
 {
    for(n=0;n<2;n++)
    {*/
   /*
         for(i=0;i<2*BLOCK_SIZE;i++)
         {
            for(j=0;j<2*BLOCK_SIZE;j++)
            {                  // [m*2+n]
                //printf("%d\t",a[i*BLOCK_SIZE + j]);
                cout.width( 3 );
                //cout<<a[(m*2+n)*16 + i*BLOCK_SIZE + j]<<" ";
                cout<<a[i*(2*BLOCK_SIZE) + j]<<" ";

            }
            printf("\n");
         }

         */
        /*    printf("\n");
    }
}
*/
return 0;
}


	.file	"tmpxft_002fc0d0_00000000-6_test3.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3894:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3894:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"The error is %s, %s \n"
	.text
	.globl	_Z16cuda_error_check9cudaErrorPKc
	.type	_Z16cuda_error_check9cudaErrorPKc, @function
_Z16cuda_error_check9cudaErrorPKc:
.LFB3889:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L2
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rsi, %rbx
	call	cudaGetErrorString@PLT
	movl	$2, %edi
	movq	%rbx, %rcx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	ret
	.cfi_endproc
.LFE3889:
	.size	_Z16cuda_error_check9cudaErrorPKc, .-_Z16cuda_error_check9cudaErrorPKc
	.globl	_Z10__gpu_synciPViS0_
	.type	_Z10__gpu_synciPViS0_, @function
_Z10__gpu_synciPViS0_:
.LFB3890:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3890:
	.size	_Z10__gpu_synciPViS0_, .-_Z10__gpu_synciPViS0_
	.globl	_Z25__device_stub__Z6matrixPiPi
	.type	_Z25__device_stub__Z6matrixPiPi, @function
_Z25__device_stub__Z6matrixPiPi:
.LFB3916:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z6matrixPi(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L10:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3916:
	.size	_Z25__device_stub__Z6matrixPiPi, .-_Z25__device_stub__Z6matrixPiPi
	.globl	_Z6matrixPi
	.type	_Z6matrixPi, @function
_Z6matrixPi:
.LFB3917:
	.cfi_startproc
	endbr64
	jmp	_Z25__device_stub__Z6matrixPiPi
	.cfi_endproc
.LFE3917:
	.size	_Z6matrixPi, .-_Z6matrixPi
	.section	.rodata.str1.1
.LC1:
	.string	"cudaSetDevice failed!"
.LC2:
	.string	"cudaMalloc Failed!"
.LC3:
	.string	"cudaMemcpy H-D failed!"
.LC4:
	.string	"cudaMemcpy D-H failed!"
.LC5:
	.string	"  "
.LC6:
	.string	" "
.LC7:
	.string	"\n\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3891:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$64, %ecx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$312, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rbp
	movq	%rbp, %rdi
	rep stosl
	xorl	%edi, %edi
	call	cudaSetDevice@PLT
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z16cuda_error_check9cudaErrorPKc
	call	cudaDeviceReset@PLT
	leaq	8(%rsp), %rdi
	movl	$256, %esi
	call	cudaMalloc@PLT
	leaq	.LC2(%rip), %rsi
	movl	%eax, %edi
	call	_Z16cuda_error_check9cudaErrorPKc
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$256, %edx
	call	cudaMemcpy@PLT
	leaq	.LC3(%rip), %rsi
	movl	%eax, %edi
	call	_Z16cuda_error_check9cudaErrorPKc
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$17179869188, %rdx
	movl	$1, %esi
	movabsq	$8589934594, %rdi
	movl	$1, 24(%rsp)
	movq	%rdx, 16(%rsp)
	movq	%rdi, 28(%rsp)
	movl	$1, 36(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	movq	8(%rsp), %rdi
	call	_Z25__device_stub__Z6matrixPiPi
.L16:
	movq	8(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbp, %rdi
	xorl	%ebx, %ebx
	movl	$256, %edx
	leaq	_ZSt4cout(%rip), %r12
	call	cudaMemcpy@PLT
	leaq	.LC4(%rip), %rsi
	movl	%eax, %edi
	call	_Z16cuda_error_check9cudaErrorPKc
.L21:
	movl	%ebx, %r13d
	testb	$7, %bl
	jne	.L17
	movq	%r12, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.L17:
	testl	$31, %r13d
	jne	.L18
	movq	%r12, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	jmp	.L19
.L18:
	andl	$3, %r13d
	jne	.L20
.L19:
	movl	$2, %edx
	leaq	.LC5(%rip), %rsi
	movq	%r12, %rdi
	call	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
.L20:
	movl	0(%rbp,%rbx,4), %esi
	movq	%r12, %rdi
	movq	$3, 24+_ZSt4cout(%rip)
	incq	%rbx
	call	_ZNSolsEi@PLT
	movl	$1, %edx
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
	cmpq	$64, %rbx
	jne	.L21
	xorl	%eax, %eax
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$312, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.LFE3891:
	.size	main, .-main
	.section	.rodata.str1.1
.LC8:
	.string	"_Z6matrixPi"
.LC9:
	.string	"Arrayin"
.LC10:
	.string	"Arrayout"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3919:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC8(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z6matrixPi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC9(%rip), %rdx
	movl	$400, %r9d
	leaq	_ZL7Arrayin(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC10(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$400, %r9d
	leaq	_ZL8Arrayout(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3919:
	.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
	.local	_ZL8Arrayout
	.comm	_ZL8Arrayout,400,32
	.local	_ZL7Arrayin
	.comm	_ZL7Arrayin,400,32
	.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 <hip/hip_runtime_api.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdlib.h>

//#define N 4
#define BLOCK_SIZE 4
#define GRID_SIZE 2


// threadfence();

using namespace std;

__device__ volatile int Arrayin[100];
__device__ volatile int Arrayout[100];


void cuda_error_check(hipError_t err , const char *msg )
{
    if(err != hipSuccess)
    {
      printf("The error is %s, %s \n", hipGetErrorString(err), msg );
      exit(1);
    }
}

__device__ void __gpu_sync(int goalVal , volatile int *Arrayin , volatile int *Arrayout)
{
    // thread ID in a block
    int tid_in_blk = threadIdx.x * blockDim.y  + threadIdx.y;
    int nBlockNum = gridDim.x * gridDim.y;
    int bid = blockIdx.x * gridDim.y + blockIdx.y;


    // only thread 0 is used for synchronization
    if (tid_in_blk == 0)
    {
        Arrayin[bid] = goalVal;
    }
    
    if (bid == 1)
    {
        if (tid_in_blk < nBlockNum)
        {
            while (Arrayin[tid_in_blk] != goalVal){
            //Do nothing here
            }
        }

        __syncthreads();
        __threadfence();

        if (tid_in_blk < nBlockNum)
        {
            Arrayout[tid_in_blk] = goalVal;
        }
    }
    if (tid_in_blk == 0)
    {
            while (Arrayout[bid] != goalVal){
            //Do nothing here
            }
    }

    __syncthreads();
    __threadfence();

}

__global__ void matrix(int *d_a)
{

    int row = (blockIdx.y * blockDim.y) + threadIdx.y ; 
    int col = (blockIdx.x * blockDim.x) + threadIdx.x ;
    //int L1  = blockDim.x ;
    //int L2  = blockDim.y ;
      
    int offset = col + row * blockDim.x * gridDim.x ;

    int blockid = blockIdx.y * gridDim.x + blockIdx.x ;
    int off = col + row * gridDim.x  - blockDim.x*blockid ;

    off += (blockDim.x - gridDim.x ) * threadIdx.y;

    int off_x = off - (threadIdx.y * blockDim.x) ;
    int off_y = (off - threadIdx.x) / blockDim.x ;



    //while(blockid!=g_mutex ){}
    __gpu_sync(4, Arrayin , Arrayout) ;

    d_a[offset] = 0 ;  

    /*if(blockid == g_mutex && off==0)
    {   atomicAdd((int *)&g_mutex, 1);
    }*/

}

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

    int a[(GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE];
    int i,j;
    //int m,n;
     
    for(j=0;j<(GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE;j++)
    {
        a[j]=0;
    }

    int *d_a ;

    cuda_error_check(hipSetDevice(0) , "hipSetDevice failed!" );

    hipDeviceReset();

    cuda_error_check(hipMalloc((void **)&d_a , (GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE* sizeof(int)),"hipMalloc Failed!");
    cuda_error_check(hipMemcpy(d_a , a , (GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE * sizeof(int) , hipMemcpyHostToDevice),"hipMemcpy H-D failed!");

    dim3 dimBlock(BLOCK_SIZE , BLOCK_SIZE );
    dim3 dimGrid(GRID_SIZE , GRID_SIZE);

    matrix<<< dimGrid , dimBlock >>>(d_a);

    cuda_error_check(hipMemcpy(a , d_a , (GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE * sizeof(int) , hipMemcpyDeviceToHost),"hipMemcpy D-H failed!");


for(j=0;j<(GRID_SIZE*GRID_SIZE)*BLOCK_SIZE*BLOCK_SIZE;j++)
{
    if(j%(BLOCK_SIZE*GRID_SIZE) == 0)
        cout<<endl;
    if(j%(GRID_SIZE*BLOCK_SIZE*BLOCK_SIZE)==0)
        cout<<endl;
    if(j%BLOCK_SIZE ==0)
        cout<<"  ";
        
    cout.width( 3 );
    cout<<a[j]<<" ";
}
            printf("\n\n");

 /*for(m=0;m<2;m++)
 {
    for(n=0;n<2;n++)
    {*/
   /*
         for(i=0;i<2*BLOCK_SIZE;i++)
         {
            for(j=0;j<2*BLOCK_SIZE;j++)
            {                  // [m*2+n]
                //printf("%d\t",a[i*BLOCK_SIZE + j]);
                cout.width( 3 );
                //cout<<a[(m*2+n)*16 + i*BLOCK_SIZE + j]<<" ";
                cout<<a[i*(2*BLOCK_SIZE) + j]<<" ";

            }
            printf("\n");
         }

         */
        /*    printf("\n");
    }
}
*/
return 0;
}


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

                                        # End of file scope inline assembly
	.globl	_Z16cuda_error_check10hipError_tPKc # -- Begin function _Z16cuda_error_check10hipError_tPKc
	.type	_Z16cuda_error_check10hipError_tPKc,@function
_Z16cuda_error_check10hipError_tPKc:    # @_Z16cuda_error_check10hipError_tPKc
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB0_2
# %bb.1:
	retq
.LBB0_2:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rsi, %rbx
	callq	hipGetErrorString
	movl	$.L.str, %edi
	movq	%rax, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end0:
	.size	_Z16cuda_error_check10hipError_tPKc, .Lfunc_end0-_Z16cuda_error_check10hipError_tPKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z21__device_stub__matrixPi     # -- Begin function _Z21__device_stub__matrixPi
	.type	_Z21__device_stub__matrixPi,@function
_Z21__device_stub__matrixPi:            # @_Z21__device_stub__matrixPi
	.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	$64, %rsp
	.cfi_def_cfa_offset 112
	.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)
	movq	%rsp, %rbx
	movq	%rax, (%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	$_Z6matrixPi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$80, %rsp
	.cfi_adjust_cfa_offset -80
	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	_Z21__device_stub__matrixPi, .Lfunc_end1-_Z21__device_stub__matrixPi
	.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
	subq	$280, %rsp                      # imm = 0x118
	.cfi_def_cfa_offset 304
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	leaq	16(%rsp), %rbx
	movl	$256, %edx                      # imm = 0x100
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	xorl	%edi, %edi
	callq	hipSetDevice
	movl	$.L.str.1, %esi
	movl	%eax, %edi
	callq	_Z16cuda_error_check10hipError_tPKc
	callq	hipDeviceReset
	leaq	8(%rsp), %r14
	movl	$256, %esi                      # imm = 0x100
	movq	%r14, %rdi
	callq	hipMalloc
	movl	$.L.str.2, %esi
	movl	%eax, %edi
	callq	_Z16cuda_error_check10hipError_tPKc
	movq	(%r14), %rdi
	movl	$256, %edx                      # imm = 0x100
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$.L.str.3, %esi
	movl	%eax, %edi
	callq	_Z16cuda_error_check10hipError_tPKc
	movabsq	$8589934594, %rdi               # imm = 0x200000002
	movabsq	$17179869188, %rdx              # imm = 0x400000004
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_2
# %bb.1:
	movq	8(%rsp), %rdi
	callq	_Z21__device_stub__matrixPi
.LBB2_2:
	movq	8(%rsp), %rsi
	leaq	16(%rsp), %rdi
	movl	$256, %edx                      # imm = 0x100
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.L.str.4, %esi
	movl	%eax, %edi
	callq	_Z16cuda_error_check10hipError_tPKc
	xorl	%ebx, %ebx
	movl	$_ZSt4cout, %r14d
.LBB2_3:                                # =>This Inner Loop Header: Depth=1
	testb	$7, %bl
	jne	.LBB2_5
# %bb.4:                                #   in Loop: Header=BB2_3 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB2_5:                                #   in Loop: Header=BB2_3 Depth=1
	testb	$31, %bl
	jne	.LBB2_7
# %bb.6:                                #   in Loop: Header=BB2_3 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB2_7:                                #   in Loop: Header=BB2_3 Depth=1
	testb	$3, %bl
	jne	.LBB2_9
# %bb.8:                                #   in Loop: Header=BB2_3 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$2, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB2_9:                                #   in Loop: Header=BB2_3 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	movq	$3, _ZSt4cout+16(%rax)
	movl	16(%rsp,%rbx,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.6, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%rbx
	cmpq	$64, %rbx
	jne	.LBB2_3
# %bb.10:
	movl	$.Lstr, %edi
	callq	puts@PLT
	xorl	%eax, %eax
	addq	$280, %rsp                      # imm = 0x118
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	subq	$32, %rsp
	.cfi_adjust_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z6matrixPi, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movl	$Arrayin, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$400, %r9d                      # imm = 0x190
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$Arrayout, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$400, %r9d                      # imm = 0x190
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$__hip_module_dtor, %edi
	popq	%rbx
	.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	Arrayin,@object                 # @Arrayin
	.local	Arrayin
	.comm	Arrayin,400,16
	.type	Arrayout,@object                # @Arrayout
	.local	Arrayout
	.comm	Arrayout,400,16
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"The error is %s, %s \n"
	.size	.L.str, 22

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

	.type	.L.str.1,@object                # @.str.1
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.1:
	.asciz	"hipSetDevice failed!"
	.size	.L.str.1, 21

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"hipMalloc Failed!"
	.size	.L.str.2, 18

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"hipMemcpy H-D failed!"
	.size	.L.str.3, 22

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"hipMemcpy D-H failed!"
	.size	.L.str.4, 22

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"  "
	.size	.L.str.5, 3

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	" "
	.size	.L.str.6, 2

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z6matrixPi"
	.size	.L__unnamed_1, 12

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"Arrayin"
	.size	.L__unnamed_2, 8

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"Arrayout"
	.size	.L__unnamed_3, 9

	.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	"\n"
	.size	.Lstr, 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 _Z21__device_stub__matrixPi
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym Arrayin
	.addrsig_sym Arrayout
	.addrsig_sym _Z6matrixPi
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z6matrixPi             ; -- Begin function _Z6matrixPi
	.globl	_Z6matrixPi
	.p2align	8
	.type	_Z6matrixPi,@function
_Z6matrixPi:                            ; @_Z6matrixPi
; %bb.0:
	s_clause 0x1
	s_load_b32 s8, s[0:1], 0x14
	s_load_b64 s[4:5], s[0:1], 0x8
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s9, s8, 16
	s_mul_i32 s2, s5, s14
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u32_u24 v2, v0, s9, v1
	s_add_i32 s6, s2, s15
	v_cmp_eq_u32_e32 vcc_lo, 0, v2
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, Arrayin@rel32@lo+4
	s_addc_u32 s11, s11, Arrayin@rel32@hi+12
	s_ashr_i32 s7, s6, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[12:13], s[6:7], 2
	s_add_u32 s10, s12, s10
	s_addc_u32 s11, s13, s11
	v_mov_b32_e32 v3, s10
	v_dual_mov_b32 v5, 4 :: v_dual_mov_b32 v4, s11
	flat_store_b32 v[3:4], v5 dlc
	s_waitcnt_vscnt null, 0x0
.LBB0_2:
	s_or_b32 exec_lo, exec_lo, s2
	s_cmp_lg_u32 s6, 1
	s_cbranch_scc1 .LBB0_9
; %bb.3:
	s_mul_i32 s2, s4, s5
	v_lshlrev_b32_e32 v4, 2, v2
	v_cmp_gt_i32_e64 s2, s2, v2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_saveexec_b32 s5, s2
	s_cbranch_execz .LBB0_6
; %bb.4:                                ; %.preheader23.i
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, Arrayin@rel32@lo+4
	s_addc_u32 s11, s11, Arrayin@rel32@hi+12
	v_add_co_u32 v2, s3, v4, s10
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, 0, s11, s3
	s_mov_b32 s7, 0
.LBB0_5:                                ; =>This Inner Loop Header: Depth=1
	flat_load_b32 v5, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_cmp_eq_u32_e64 s3, 4, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s7, s3, s7
	s_and_not1_b32 exec_lo, exec_lo, s7
	s_cbranch_execnz .LBB0_5
.LBB0_6:                                ; %Flow28
	s_or_b32 exec_lo, exec_lo, s5
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	buffer_gl1_inv
	buffer_gl0_inv
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_8
; %bb.7:
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, Arrayout@rel32@lo+4
	s_addc_u32 s11, s11, Arrayout@rel32@hi+12
	v_add_co_u32 v2, s2, v4, s10
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, 0, s11, s2
	v_mov_b32_e32 v4, 4
	flat_store_b32 v[2:3], v4 dlc
	s_waitcnt_vscnt null, 0x0
.LBB0_8:                                ; %Flow26
	s_or_b32 exec_lo, exec_lo, s3
.LBB0_9:
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB0_12
; %bb.10:                               ; %.preheader.i
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, Arrayout@rel32@lo+4
	s_addc_u32 s11, s11, Arrayout@rel32@hi+12
	s_ashr_i32 s7, s6, 31
	s_mov_b32 s3, 0
	s_lshl_b64 s[6:7], s[6:7], 2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_add_u32 s6, s6, s10
	s_addc_u32 s7, s7, s11
	v_dual_mov_b32 v2, s6 :: v_dual_mov_b32 v3, s7
.LBB0_11:                               ; =>This Inner Loop Header: Depth=1
	flat_load_b32 v4, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, 4, v4
	s_or_b32 s3, vcc_lo, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB0_11
.LBB0_12:                               ; %Flow25
	s_or_b32 exec_lo, exec_lo, s2
	v_mad_u64_u32 v[2:3], null, s15, s9, v[1:2]
	s_and_b32 s2, s8, 0xffff
	s_load_b64 s[0:1], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	buffer_gl1_inv
	buffer_gl0_inv
	v_mad_u64_u32 v[3:4], null, v2, s4, s[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, v3, s2, v[0:1]
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_mov_b32_e32 v2, 0
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z6matrixPi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 264
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 6
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z6matrixPi, .Lfunc_end0-_Z6matrixPi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 600
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	Arrayin                 ; @Arrayin
	.type	Arrayin,@object
	.section	.bss,"aw",@nobits
	.globl	Arrayin
	.p2align	4, 0x0
Arrayin:
	.zero	400
	.size	Arrayin, 400

	.protected	Arrayout                ; @Arrayout
	.type	Arrayout,@object
	.globl	Arrayout
	.p2align	4, 0x0
Arrayout:
	.zero	400
	.size	Arrayout, 400

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.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 Arrayin
	.addrsig_sym Arrayout
	.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:     hidden_block_count_x
      - .offset:         12
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         20
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         22
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         24
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         26
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         28
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         30
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         48
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         72
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 264
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z6matrixPi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z6matrixPi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
