#include <stdio.h>
#include <cuda.h>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

#define BLOCKSIZE_X 16
#define BLOCKSIZE_Y 18
#define FILTER_LENGTH 9
#define FILTER_RADIUS 1



__constant__ unsigned char c_Filter[FILTER_LENGTH];

extern "C" void setFilter(unsigned char *h_Filter)
{
    cudaMemcpyToSymbol(c_Filter, h_Filter, FILTER_LENGTH * sizeof(unsigned char));
}

__device__ int dOffset(int x, int y,int imageW) {
	return x*imageW + y;
}

__device__ int fOffset(int x, int y) {
	return x*(2*FILTER_RADIUS + 1) + y;
}

__global__ void filter(unsigned char* d_data,unsigned char* d_results,int imageW,int imageH)
{
	int k,l;
	const int gi = blockIdx.y * blockDim.y + threadIdx.y;
	const int gj = blockIdx.x * blockDim.x + threadIdx.x;

	int outPixel = 0;

	if(gi < imageH && gj < imageW)
	{
		for(k=-1;k<=1;k++)
		{
			for(l=-1;l<=1;l++)
			{
				if ( (gi+k)>=0 && (gi+k)<imageH && (gj+l)>=0 && (gj+l)<imageW )
				{
					outPixel += d_data[dOffset(gi+k,gj+l,imageW)] * c_Filter[fOffset(k+1,l+1)];
				}
				else
				{
					outPixel += d_data[dOffset(gi,gj,imageW)] * c_Filter[fOffset(k+1,l+1)];
				}
			}
		}

		d_results[dOffset(gi,gj,imageW)] = (unsigned char)(outPixel/16);
	}
}

void swap(unsigned char **d_data,unsigned char **d_results)
{
	unsigned char* temp = *d_data;
	*d_data = *d_results;
	*d_results = temp;
}

int main()
{
	int size,i,imageW,imageH;
	unsigned char *h_data;
	unsigned char *h_results;

	unsigned char *d_data;
	unsigned char *d_results;

	unsigned char h_filter[9];
	h_filter[0] = 1;
	h_filter[1] = 2;
	h_filter[2] = 1;
	h_filter[3] = 2;
	h_filter[4] = 4;
	h_filter[5] = 2;
	h_filter[6] = 1;
	h_filter[7] = 2;
	h_filter[8] = 1;

	imageW = 1920;
	imageH = 2520;
	size = imageW* imageH;

	cudaEvent_t start, stop;
	float time;
	cudaEventCreate(&start);
	cudaEventCreate(&stop);

	h_data =(unsigned char*)malloc(size);
	h_results =(unsigned char*)malloc(size);

	FILE* inputImage;
	inputImage = fopen("../image.raw","rb");
	fread(h_data,size,1,inputImage);
	fclose(inputImage);


	dim3 blockSize(BLOCKSIZE_X, BLOCKSIZE_Y);
	int numBlocks_X = imageW / BLOCKSIZE_X;
	int numBlocks_Y = imageH / BLOCKSIZE_Y;
	printf("blocks x %d blocks y %d\n",numBlocks_X,numBlocks_Y );
	dim3 gridSize(numBlocks_X, numBlocks_Y);

	cudaEventRecord(start, 0);

	cudaMalloc(&d_data, size);
	cudaMemcpy(d_data, h_data, size, cudaMemcpyHostToDevice);
	cudaMalloc(&d_results, size);
	setFilter(h_filter);


	for(i = 0; i < 100; i++ )
	{
		filter<<<gridSize,blockSize>>>(d_data,d_results,imageW,imageH);
		swap(&d_data,&d_results);
	}

	cudaEventRecord(stop, 0);
	cudaEventSynchronize(stop);

	cudaMemcpy(h_results, d_results, size, cudaMemcpyDeviceToHost);
	cudaFree(d_results);
	cudaFree(d_data);


	FILE* outputImage;
	outputImage = fopen("out.raw","w+");
	fwrite(h_results,size,1,outputImage);
	fclose(outputImage);

	cudaEventElapsedTime(&time, start, stop);
	printf ("Time for the kernel: %f ms\n", time);

	return 0;
} 
	.file	"tmpxft_00216368_00000000-6_cudacannon.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	setFilter
	.type	setFilter, @function
setFilter:
.LFB2027:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$9, %edx
	leaq	_ZL8c_Filter(%rip), %rdi
	jmp	cudaMemcpyToSymbol@PLT
	.cfi_endproc
.LFE2027:
	.size	setFilter, .-setFilter
	.globl	_Z7dOffsetiii
	.type	_Z7dOffsetiii, @function
_Z7dOffsetiii:
.LFB2028:
	.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
.LFE2028:
	.size	_Z7dOffsetiii, .-_Z7dOffsetiii
	.globl	_Z7fOffsetii
	.type	_Z7fOffsetii, @function
_Z7fOffsetii:
.LFB2029:
	.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
.LFE2029:
	.size	_Z7fOffsetii, .-_Z7fOffsetii
	.globl	_Z4swapPPhS0_
	.type	_Z4swapPPhS0_, @function
_Z4swapPPhS0_:
.LFB2030:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	(%rsi), %rdx
	movq	%rdx, (%rdi)
	movq	%rax, (%rsi)
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z4swapPPhS0_, .-_Z4swapPPhS0_
	.globl	_Z29__device_stub__Z6filterPhS_iiPhS_ii
	.type	_Z29__device_stub__Z6filterPhS_iiPhS_ii, @function
_Z29__device_stub__Z6filterPhS_iiPhS_ii:
.LFB2056:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z6filterPhS_ii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L8:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z29__device_stub__Z6filterPhS_iiPhS_ii, .-_Z29__device_stub__Z6filterPhS_iiPhS_ii
	.globl	_Z6filterPhS_ii
	.type	_Z6filterPhS_ii, @function
_Z6filterPhS_ii:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z29__device_stub__Z6filterPhS_iiPhS_ii
	.cfi_endproc
.LFE2057:
	.size	_Z6filterPhS_ii, .-_Z6filterPhS_ii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"rb"
.LC1:
	.string	"../image.raw"
.LC2:
	.string	"blocks x %d blocks y %d\n"
.LC3:
	.string	"w+"
.LC4:
	.string	"out.raw"
.LC5:
	.string	"Time for the kernel: %f ms\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$96, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	movabsq	$144398879289311745, %rax
	leaq	32(%rsp), %rdi
	movb	$1, 87(%rsp)
	movq	%rax, 79(%rsp)
	call	cudaEventCreate@PLT
	leaq	40(%rsp), %rdi
	call	cudaEventCreate@PLT
	movl	$4838400, %edi
	call	malloc@PLT
	movl	$4838400, %edi
	movq	%rax, %rbx
	call	malloc@PLT
	leaq	.LC0(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	movq	%rax, %rbp
	call	fopen@PLT
	movl	$1, %ecx
	movl	$4838400, %edx
	movq	%rbx, %rdi
	movq	%rax, %r8
	movl	$4838400, %esi
	movq	%rax, %r12
	call	__fread_chk@PLT
	movq	%r12, %rdi
	call	fclose@PLT
	movl	$140, %ecx
	movl	$120, %edx
	movabsq	$77309411344, %rax
	movq	%rax, 52(%rsp)
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, 60(%rsp)
	call	__printf_chk@PLT
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	movabsq	$601295421560, %rax
	movq	%rax, 64(%rsp)
	movl	$1, 72(%rsp)
	call	cudaEventRecord@PLT
	leaq	16(%rsp), %rdi
	movl	$4838400, %esi
	call	cudaMalloc@PLT
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	movl	$4838400, %edx
	movl	$100, %ebx
	call	cudaMemcpy@PLT
	leaq	24(%rsp), %rdi
	movl	$4838400, %esi
	call	cudaMalloc@PLT
	leaq	79(%rsp), %rdi
	call	setFilter
.L16:
	movl	60(%rsp), %ecx
	movq	52(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	64(%rsp), %rdi
	movl	72(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L15
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$2520, %ecx
	movl	$1920, %edx
	call	_Z29__device_stub__Z6filterPhS_iiPhS_ii
.L15:
	movq	16(%rsp), %rax
	movq	24(%rsp), %rdx
	movq	%rax, 24(%rsp)
	movq	%rdx, 16(%rsp)
	decl	%ebx
	jne	.L16
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	40(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbp, %rdi
	movl	$4838400, %edx
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	leaq	.LC3(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	call	fopen@PLT
	movl	$1, %edx
	movl	$4838400, %esi
	movq	%rbp, %rdi
	movq	%rax, %rcx
	movq	%rax, %rbx
	call	fwrite@PLT
	movq	%rbx, %rdi
	call	fclose@PLT
	movq	32(%rsp), %rsi
	movq	40(%rsp), %rdx
	leaq	12(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	12(%rsp), %xmm0
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$96, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	main, .-main
	.section	.rodata.str1.1
.LC6:
	.string	"_Z6filterPhS_ii"
.LC7:
	.string	"c_Filter"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2059:
	.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	.LC6(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z6filterPhS_ii(%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	.LC7(%rip), %rdx
	movl	$9, %r9d
	leaq	_ZL8c_Filter(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.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
.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
	.local	_ZL8c_Filter
	.comm	_ZL8c_Filter,9,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:

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



#define BLOCKSIZE_X 16
#define BLOCKSIZE_Y 18
#define FILTER_LENGTH 9
#define FILTER_RADIUS 1



__constant__ unsigned char c_Filter[FILTER_LENGTH];

extern "C" void setFilter(unsigned char *h_Filter)
{
    hipMemcpyToSymbol(HIP_SYMBOL(c_Filter), h_Filter, FILTER_LENGTH * sizeof(unsigned char));
}

__device__ int dOffset(int x, int y,int imageW) {
	return x*imageW + y;
}

__device__ int fOffset(int x, int y) {
	return x*(2*FILTER_RADIUS + 1) + y;
}

__global__ void filter(unsigned char* d_data,unsigned char* d_results,int imageW,int imageH)
{
	int k,l;
	const int gi = blockIdx.y * blockDim.y + threadIdx.y;
	const int gj = blockIdx.x * blockDim.x + threadIdx.x;

	int outPixel = 0;

	if(gi < imageH && gj < imageW)
	{
		for(k=-1;k<=1;k++)
		{
			for(l=-1;l<=1;l++)
			{
				if ( (gi+k)>=0 && (gi+k)<imageH && (gj+l)>=0 && (gj+l)<imageW )
				{
					outPixel += d_data[dOffset(gi+k,gj+l,imageW)] * c_Filter[fOffset(k+1,l+1)];
				}
				else
				{
					outPixel += d_data[dOffset(gi,gj,imageW)] * c_Filter[fOffset(k+1,l+1)];
				}
			}
		}

		d_results[dOffset(gi,gj,imageW)] = (unsigned char)(outPixel/16);
	}
}

void swap(unsigned char **d_data,unsigned char **d_results)
{
	unsigned char* temp = *d_data;
	*d_data = *d_results;
	*d_results = temp;
}

int main()
{
	int size,i,imageW,imageH;
	unsigned char *h_data;
	unsigned char *h_results;

	unsigned char *d_data;
	unsigned char *d_results;

	unsigned char h_filter[9];
	h_filter[0] = 1;
	h_filter[1] = 2;
	h_filter[2] = 1;
	h_filter[3] = 2;
	h_filter[4] = 4;
	h_filter[5] = 2;
	h_filter[6] = 1;
	h_filter[7] = 2;
	h_filter[8] = 1;

	imageW = 1920;
	imageH = 2520;
	size = imageW* imageH;

	hipEvent_t start, stop;
	float time;
	hipEventCreate(&start);
	hipEventCreate(&stop);

	h_data =(unsigned char*)malloc(size);
	h_results =(unsigned char*)malloc(size);

	FILE* inputImage;
	inputImage = fopen("../image.raw","rb");
	fread(h_data,size,1,inputImage);
	fclose(inputImage);


	dim3 blockSize(BLOCKSIZE_X, BLOCKSIZE_Y);
	int numBlocks_X = imageW / BLOCKSIZE_X;
	int numBlocks_Y = imageH / BLOCKSIZE_Y;
	printf("blocks x %d blocks y %d\n",numBlocks_X,numBlocks_Y );
	dim3 gridSize(numBlocks_X, numBlocks_Y);

	hipEventRecord(start, 0);

	hipMalloc(&d_data, size);
	hipMemcpy(d_data, h_data, size, hipMemcpyHostToDevice);
	hipMalloc(&d_results, size);
	setFilter(h_filter);


	for(i = 0; i < 100; i++ )
	{
		filter<<<gridSize,blockSize>>>(d_data,d_results,imageW,imageH);
		swap(&d_data,&d_results);
	}

	hipEventRecord(stop, 0);
	hipEventSynchronize(stop);

	hipMemcpy(h_results, d_results, size, hipMemcpyDeviceToHost);
	hipFree(d_results);
	hipFree(d_data);


	FILE* outputImage;
	outputImage = fopen("out.raw","w+");
	fwrite(h_results,size,1,outputImage);
	fclose(outputImage);

	hipEventElapsedTime(&time, start, stop);
	printf ("Time for the kernel: %f ms\n", time);

	return 0;
} 
	.text
	.file	"cudacannon.hip"
	.globl	setFilter                       # -- Begin function setFilter
	.type	setFilter,@function
setFilter:                              # @setFilter
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$c_Filter, %edi
	movl	$9, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end0:
	.size	setFilter, .Lfunc_end0-setFilter
	.cfi_endproc
                                        # -- End function
	.globl	_Z21__device_stub__filterPhS_ii # -- Begin function _Z21__device_stub__filterPhS_ii
	.type	_Z21__device_stub__filterPhS_ii,@function
_Z21__device_stub__filterPhS_ii:        # @_Z21__device_stub__filterPhS_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z6filterPhS_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z21__device_stub__filterPhS_ii, .Lfunc_end1-_Z21__device_stub__filterPhS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z4swapPPhS0_                   # -- Begin function _Z4swapPPhS0_
	.type	_Z4swapPPhS0_,@function
_Z4swapPPhS0_:                          # @_Z4swapPPhS0_
	.cfi_startproc
# %bb.0:
	movq	(%rdi), %rax
	movq	(%rsi), %rcx
	movq	%rcx, (%rdi)
	movq	%rax, (%rsi)
	retq
.Lfunc_end2:
	.size	_Z4swapPPhS0_, .Lfunc_end2-_Z4swapPPhS0_
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$144398879289311745, %rax       # imm = 0x201020402010201
	leaq	47(%rsp), %r14
	movq	%rax, (%r14)
	movb	$1, 8(%r14)
	leaq	32(%rsp), %r12
	movq	%r12, %rdi
	callq	hipEventCreate
	leaq	24(%rsp), %rdi
	callq	hipEventCreate
	movl	$4838400, %edi                  # imm = 0x49D400
	callq	malloc
	movq	%rax, %r15
	movl	$4838400, %edi                  # imm = 0x49D400
	callq	malloc
	movq	%rax, %rbx
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r13
	movl	$4838400, %esi                  # imm = 0x49D400
	movl	$1, %edx
	movq	%r15, %rdi
	movq	%rax, %rcx
	callq	fread
	movq	%r13, %rdi
	callq	fclose
	movl	$.L.str.2, %edi
	movl	$120, %esi
	movl	$140, %edx
	xorl	%eax, %eax
	callq	printf
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	leaq	16(%rsp), %r12
	movl	$4838400, %esi                  # imm = 0x49D400
	movq	%r12, %rdi
	callq	hipMalloc
	movq	(%r12), %rdi
	movl	$4838400, %edx                  # imm = 0x49D400
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	8(%rsp), %rdi
	movl	$4838400, %esi                  # imm = 0x49D400
	callq	hipMalloc
	movl	$c_Filter, %edi
	movl	$9, %edx
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$100, %ebp
	movabsq	$601295421560, %r14             # imm = 0x8C00000078
	movabsq	$77309411344, %r15              # imm = 0x1200000010
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_3
# %bb.2:                                #   in Loop: Header=BB3_1 Depth=1
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$1920, %edx                     # imm = 0x780
	movl	$2520, %ecx                     # imm = 0x9D8
	callq	_Z21__device_stub__filterPhS_ii
.LBB3_3:                                #   in Loop: Header=BB3_1 Depth=1
	movq	16(%rsp), %rax
	movq	8(%rsp), %rcx
	movq	%rcx, 16(%rsp)
	movq	%rax, 8(%rsp)
	decl	%ebp
	jne	.LBB3_1
# %bb.4:
	movq	24(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	24(%rsp), %rdi
	callq	hipEventSynchronize
	movq	8(%rsp), %rsi
	movl	$4838400, %edx                  # imm = 0x49D400
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	callq	fopen
	movq	%rax, %r14
	movl	$4838400, %esi                  # imm = 0x49D400
	movl	$1, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	callq	fwrite
	movq	%r14, %rdi
	callq	fclose
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	leaq	40(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	cvtss2sd	(%rbx), %xmm0
	movl	$.L.str.5, %edi
	movb	$1, %al
	callq	printf
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z6filterPhS_ii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$1, (%rsp)
	movl	$c_Filter, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$9, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__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	.LBB5_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
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	c_Filter,@object                # @c_Filter
	.local	c_Filter
	.comm	c_Filter,9,1
	.type	_Z6filterPhS_ii,@object         # @_Z6filterPhS_ii
	.section	.rodata,"a",@progbits
	.globl	_Z6filterPhS_ii
	.p2align	3, 0x0
_Z6filterPhS_ii:
	.quad	_Z21__device_stub__filterPhS_ii
	.size	_Z6filterPhS_ii, 8

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

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"blocks x %d blocks y %d\n"
	.size	.L.str.2, 25

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"out.raw"
	.size	.L.str.3, 8

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"w+"
	.size	.L.str.4, 3

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Time for the kernel: %f ms\n"
	.size	.L.str.5, 28

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z6filterPhS_ii"
	.size	.L__unnamed_1, 16

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"c_Filter"
	.size	.L__unnamed_2, 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

	.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__filterPhS_ii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym c_Filter
	.addrsig_sym _Z6filterPhS_ii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z6filterPhS_ii         ; -- Begin function _Z6filterPhS_ii
	.globl	_Z6filterPhS_ii
	.p2align	8
	.type	_Z6filterPhS_ii,@function
_Z6filterPhS_ii:                        ; @_Z6filterPhS_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[8:9], s[0:1], 0x10
	v_bfe_u32 v3, v0, 10, 10
	v_and_b32_e32 v2, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	v_mad_u64_u32 v[0:1], null, s15, s3, v[3:4]
	s_mul_i32 s14, s14, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v4, s14, v2
	v_cmp_gt_i32_e32 vcc_lo, s9, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s8, v4
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_10
; %bb.1:                                ; %.preheader51
	v_add_nc_u32_e32 v1, -1, v0
	s_load_b128 s[4:7], s[0:1], 0x0
	v_add_nc_u32_e32 v11, -1, v4
	s_mov_b32 s1, -1
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, c_Filter@rel32@lo+4
	s_addc_u32 s3, s3, c_Filter@rel32@hi+12
	v_mad_u64_u32 v[5:6], null, s8, v1, v[2:3]
	v_mov_b32_e32 v3, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, v0, s8, v[4:5]
	v_add3_u32 v2, v5, s14, -1
	v_dual_mov_b32 v5, v3 :: v_dual_mov_b32 v4, v2
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v10, 31, v1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v6, vcc_lo, s4, v1
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v10, vcc_lo
.LBB0_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	v_add_nc_u32_e32 v8, s1, v0
	s_mov_b64 s[10:11], 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_lt_i32_e32 vcc_lo, -1, v8
	v_cmp_gt_i32_e64 s0, s9, v8
	s_and_b32 s12, vcc_lo, s0
.LBB0_3:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_dual_mov_b32 v9, v7 :: v_dual_mov_b32 v8, v6
	s_and_saveexec_b32 s13, s12
	s_cbranch_execz .LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	v_add_nc_u32_e32 v8, s10, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_cmp_lt_i32_e32 vcc_lo, -1, v8
	v_cmp_gt_i32_e64 s0, s8, v8
	v_dual_mov_b32 v9, v7 :: v_dual_mov_b32 v8, v6
	s_and_b32 s14, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s0, s14
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=2
	v_add_nc_u32_e32 v8, s10, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v9, 31, v8
	v_add_co_u32 v8, vcc_lo, s4, v8
	v_add_co_ci_u32_e32 v9, vcc_lo, s5, v9, vcc_lo
; %bb.6:                                ; %Flow
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s0
.LBB0_7:                                ;   in Loop: Header=BB0_3 Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s13
	s_add_u32 s14, s2, s10
	s_addc_u32 s15, s3, s11
	global_load_u8 v8, v[8:9], off
	global_load_u8 v9, v3, s[14:15]
	s_add_u32 s10, s10, 1
	s_addc_u32 s11, s11, 0
	s_cmp_lg_u32 s10, 3
	s_waitcnt vmcnt(0)
	v_mad_u32_u24 v2, v9, v8, v2
	s_cbranch_scc1 .LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	v_add_co_u32 v4, vcc_lo, v4, s8
	s_add_i32 s1, s1, 1
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_add_u32 s2, s2, 3
	s_addc_u32 s3, s3, 0
	s_cmp_lg_u32 s1, 2
	s_cbranch_scc1 .LBB0_2
; %bb.9:
	v_ashrrev_i32_e32 v0, 31, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshrrev_b32_e32 v0, 28, v0
	v_add_nc_u32_e32 v0, v2, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_lshrrev_b32_e32 v2, 4, v0
	v_add_co_u32 v0, vcc_lo, s6, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v10, vcc_lo
	global_store_b8 v[0:1], v2, off
.LBB0_10:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z6filterPhS_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.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 12
		.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	_Z6filterPhS_ii, .Lfunc_end0-_Z6filterPhS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 472
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; 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	c_Filter                ; @c_Filter
	.type	c_Filter,@object
	.section	.bss,"aw",@nobits
	.globl	c_Filter
c_Filter:
	.zero	9
	.size	c_Filter, 9

	.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 c_Filter
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z6filterPhS_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z6filterPhS_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     12
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
