#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
// CUDA runtime
#include <cuda_runtime.h>

/* Problem size */
#define NI 4096
#define NJ 4096

__global__ void Convolution(double* A, double* B)
{
	int i, j;
	double c11, c12, c13, c21, c22, c23, c31, c32, c33;

	c11 = +0.2;  c21 = +0.5;  c31 = -0.8;
	c12 = -0.3;  c22 = +0.6;  c32 = -0.9;
	c13 = +0.4;  c23 = +0.7;  c33 = +0.10;

	i = blockIdx.y*blockDim.y + threadIdx.y + 1;
    j = blockIdx.x*blockDim.x + threadIdx.x + 1;
    if (i < NI - 1 && j < NJ - 1) {
        B[i*NJ + j] = c11 * A[(i - 1)*NJ + (j - 1)]  +  c12 * A[(i + 0)*NJ + (j - 1)]  +  c13 * A[(i + 1)*NJ + (j - 1)]
				    + c21 * A[(i - 1)*NJ + (j + 0)]  +  c22 * A[(i + 0)*NJ + (j + 0)]  +  c23 * A[(i + 1)*NJ + (j + 0)] 
				    + c31 * A[(i - 1)*NJ + (j + 1)]  +  c32 * A[(i + 0)*NJ + (j + 1)]  +  c33 * A[(i + 1)*NJ + (j + 1)];
		
    }
}

void init(double* A)
{
	int i, j;

	for (i = 0; i < NI; ++i) {
		for (j = 0; j < NJ; ++j) {
			A[i*NJ + j] = (double)rand()/RAND_MAX;
        	}
    	}
}

int main(int argc, char *argv[])
{
	double		*A_h, *B_h;
	double		*A_d, *B_d;
	struct timeval	cpu_start, cpu_end;

	
	A_h = (double*)malloc(NI*NJ*sizeof(double));
	B_h = (double*)malloc(NI*NJ*sizeof(double));

	// Δέσμευση μνήμης στο device για τα διανύσματα
	cudaMalloc((void **) &A_d, NI*NJ*sizeof(double));
	cudaMalloc((void **) &B_d, NI*NJ*sizeof(double));

	//initialize the arrays
	init(A_h);

	// Αντιγραφή A στο device
	cudaMemcpy(A_d, A_h, NI*NJ*sizeof(double), cudaMemcpyHostToDevice);
	
	//----------------------------------------------------------------------

	// Κάθε block θα έχει διάσταση 32×32
	unsigned int BLOCK_SIZE_PER_DIM = 32;

	// Στρογγυλοποίηση προς τα πάνω για το πλήθος των block σε κάθε διάσταση
	unsigned int numBlocksX = (NI - 1) / BLOCK_SIZE_PER_DIM + 1;
	unsigned int numBlocksY = (NJ - 1) / BLOCK_SIZE_PER_DIM + 1;

	// Ορισμός διαστάσεων πλέγματος
	dim3 dimGrid(numBlocksX, numBlocksY, 1);

	// Ορισμός διαστάσεων block
	dim3 dimBlock(BLOCK_SIZE_PER_DIM, BLOCK_SIZE_PER_DIM, 1);

	//----------------------------------------------------------------------
	
	gettimeofday(&cpu_start, NULL);
	
	// Κλήση υπολογιστικού πυρήνα
	Convolution<<<dimGrid, dimBlock>>>(A_d, B_d);

	cudaMemcpy(B_h, B_d, NI*NJ*sizeof(double), cudaMemcpyDeviceToHost);

	gettimeofday(&cpu_end, NULL);
	fprintf(stdout, "GPU Runtime: %0.6lfs\n", ((cpu_end.tv_sec - cpu_start.tv_sec) * 1000000.0 + (cpu_end.tv_usec - cpu_start.tv_usec)) / 1000000.0);

	// Αντιγραφή του αποτελέσματος στον host

	printf("================================\n");

	FILE *f = fopen("ask1_cuda_output.txt", "w+");
	if (f == NULL)
	{
	    printf("Error opening ask1_cuda_output.txt!\n");
	    exit(1);
	}

	for (int i = 1; i < NI - 1; ++i) {
		for (int j = 1; j < NJ - 1; ++j) {
			fprintf(f, "%f\n", B_h[i*NJ + j]);
			}
	}

	if(f) { printf("Results saved in ask1_cuda_output.txt!\n"); }

	fclose(f);

	// Αποδέσμευση μνήμης στον host
	free(A_h);
	free(B_h);
	
	// Αποδέσμευση μνήμης στο device
	cudaFree(A_d);
	cudaFree(B_d);
	
	return 0;
}

	.file	"tmpxft_00380905_00000000-6_ask1_cuda.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2044:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2044:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z4initPd
	.type	_Z4initPd, @function
_Z4initPd:
.LFB2040:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rdx
	.cfi_def_cfa_offset 48
.L3:
	movq	%rbp, %r12
	xorl	%ebx, %ebx
	salq	$15, %r12
	addq	%r13, %r12
.L4:
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC0(%rip), %xmm0
	movsd	%xmm0, (%r12,%rbx,8)
	incq	%rbx
	cmpq	$4096, %rbx
	jne	.L4
	incq	%rbp
	cmpq	$4096, %rbp
	jne	.L3
	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
.LFE2040:
	.size	_Z4initPd, .-_Z4initPd
	.globl	_Z33__device_stub__Z11ConvolutionPdS_PdS_
	.type	_Z33__device_stub__Z11ConvolutionPdS_PdS_, @function
_Z33__device_stub__Z11ConvolutionPdS_PdS_:
.LFB2066:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%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)
	movq	%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	.L9
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z11ConvolutionPdS_(%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
.L9:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2066:
	.size	_Z33__device_stub__Z11ConvolutionPdS_PdS_, .-_Z33__device_stub__Z11ConvolutionPdS_PdS_
	.globl	_Z11ConvolutionPdS_
	.type	_Z11ConvolutionPdS_, @function
_Z11ConvolutionPdS_:
.LFB2067:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z11ConvolutionPdS_PdS_
	.cfi_endproc
.LFE2067:
	.size	_Z11ConvolutionPdS_, .-_Z11ConvolutionPdS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"GPU Runtime: %0.6lfs\n"
.LC3:
	.string	"================================\n"
.LC4:
	.string	"w+"
.LC5:
	.string	"ask1_cuda_output.txt"
.LC6:
	.string	"Error opening ask1_cuda_output.txt!\n"
.LC7:
	.string	"%f\n"
.LC8:
	.string	"Results saved in ask1_cuda_output.txt!\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2041:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$134217728, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	movl	$134217728, %edi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	leaq	16(%rsp), %rdi
	movl	$134217728, %esi
	movq	%rax, %rbx
	call	cudaMalloc@PLT
	movl	$134217728, %esi
	leaq	24(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	call	_Z4initPd
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movl	$134217728, %edx
	call	cudaMemcpy@PLT
	xorl	%esi, %esi
	movabsq	$549755814016, %rax
	leaq	56(%rsp), %rdi
	movq	%rax, 32(%rsp)
	movabsq	$137438953504, %rax
	movl	$1, 40(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	gettimeofday@PLT
	movl	52(%rsp), %ecx
	movl	40(%rsp), %esi
	xorl	%r9d, %r9d
	movq	44(%rsp), %rdx
	movq	32(%rsp), %rdi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L15
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	call	_Z33__device_stub__Z11ConvolutionPdS_PdS_
.L15:
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movl	$134217728, %edx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	leaq	72(%rsp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movq	72(%rsp), %rax
	subq	56(%rsp), %rax
	leaq	.LC2(%rip), %rdx
	cvtsi2sdq	%rax, %xmm0
	movq	80(%rsp), %rax
	subq	64(%rsp), %rax
	movl	$2, %esi
	movsd	.LC1(%rip), %xmm1
	cvtsi2sdq	%rax, %xmm2
	movb	$1, %al
	movq	stdout(%rip), %rdi
	mulsd	%xmm1, %xmm0
	addsd	%xmm2, %xmm0
	divsd	%xmm1, %xmm0
	call	__fprintf_chk@PLT
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC4(%rip), %rsi
	leaq	.LC5(%rip), %rdi
	call	fopen@PLT
	movq	%rax, %r12
	testq	%rax, %rax
	je	.L16
	leaq	32768(%rbx), %r14
	movl	$4096, %ebp
	leaq	.LC7(%rip), %r15
	jmp	.L17
.L16:
	movl	$2, %edi
	leaq	.LC6(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L18:
	movsd	(%r14,%r13,8), %xmm0
	movq	%r15, %rdx
	movl	$2, %esi
	movb	$1, %al
	movq	%r12, %rdi
	incq	%r13
	call	__fprintf_chk@PLT
	cmpq	$4095, %r13
	jne	.L18
	addl	$4096, %ebp
	addq	$32768, %r14
	cmpl	$16773120, %ebp
	je	.L19
.L17:
	movl	$1, %r13d
	jmp	.L18
.L19:
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rdi
	call	fclose@PLT
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2041:
	.size	main, .-main
	.section	.rodata.str1.1
.LC9:
	.string	"_Z11ConvolutionPdS_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2069:
	.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	.LC9(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z11ConvolutionPdS_(%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
.LFE2069:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	-4194304
	.long	1105199103
	.align 8
.LC1:
	.long	0
	.long	1093567616
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
// CUDA runtime
#include <hip/hip_runtime.h>

/* Problem size */
#define NI 4096
#define NJ 4096

__global__ void Convolution(double* A, double* B)
{
	int i, j;
	double c11, c12, c13, c21, c22, c23, c31, c32, c33;

	c11 = +0.2;  c21 = +0.5;  c31 = -0.8;
	c12 = -0.3;  c22 = +0.6;  c32 = -0.9;
	c13 = +0.4;  c23 = +0.7;  c33 = +0.10;

	i = blockIdx.y*blockDim.y + threadIdx.y + 1;
    j = blockIdx.x*blockDim.x + threadIdx.x + 1;
    if (i < NI - 1 && j < NJ - 1) {
        B[i*NJ + j] = c11 * A[(i - 1)*NJ + (j - 1)]  +  c12 * A[(i + 0)*NJ + (j - 1)]  +  c13 * A[(i + 1)*NJ + (j - 1)]
				    + c21 * A[(i - 1)*NJ + (j + 0)]  +  c22 * A[(i + 0)*NJ + (j + 0)]  +  c23 * A[(i + 1)*NJ + (j + 0)] 
				    + c31 * A[(i - 1)*NJ + (j + 1)]  +  c32 * A[(i + 0)*NJ + (j + 1)]  +  c33 * A[(i + 1)*NJ + (j + 1)];
		
    }
}

void init(double* A)
{
	int i, j;

	for (i = 0; i < NI; ++i) {
		for (j = 0; j < NJ; ++j) {
			A[i*NJ + j] = (double)rand()/RAND_MAX;
        	}
    	}
}

int main(int argc, char *argv[])
{
	double		*A_h, *B_h;
	double		*A_d, *B_d;
	struct timeval	cpu_start, cpu_end;

	
	A_h = (double*)malloc(NI*NJ*sizeof(double));
	B_h = (double*)malloc(NI*NJ*sizeof(double));

	// Δέσμευση μνήμης στο device για τα διανύσματα
	hipMalloc((void **) &A_d, NI*NJ*sizeof(double));
	hipMalloc((void **) &B_d, NI*NJ*sizeof(double));

	//initialize the arrays
	init(A_h);

	// Αντιγραφή A στο device
	hipMemcpy(A_d, A_h, NI*NJ*sizeof(double), hipMemcpyHostToDevice);
	
	//----------------------------------------------------------------------

	// Κάθε block θα έχει διάσταση 32×32
	unsigned int BLOCK_SIZE_PER_DIM = 32;

	// Στρογγυλοποίηση προς τα πάνω για το πλήθος των block σε κάθε διάσταση
	unsigned int numBlocksX = (NI - 1) / BLOCK_SIZE_PER_DIM + 1;
	unsigned int numBlocksY = (NJ - 1) / BLOCK_SIZE_PER_DIM + 1;

	// Ορισμός διαστάσεων πλέγματος
	dim3 dimGrid(numBlocksX, numBlocksY, 1);

	// Ορισμός διαστάσεων block
	dim3 dimBlock(BLOCK_SIZE_PER_DIM, BLOCK_SIZE_PER_DIM, 1);

	//----------------------------------------------------------------------
	
	gettimeofday(&cpu_start, NULL);
	
	// Κλήση υπολογιστικού πυρήνα
	Convolution<<<dimGrid, dimBlock>>>(A_d, B_d);

	hipMemcpy(B_h, B_d, NI*NJ*sizeof(double), hipMemcpyDeviceToHost);

	gettimeofday(&cpu_end, NULL);
	fprintf(stdout, "GPU Runtime: %0.6lfs\n", ((cpu_end.tv_sec - cpu_start.tv_sec) * 1000000.0 + (cpu_end.tv_usec - cpu_start.tv_usec)) / 1000000.0);

	// Αντιγραφή του αποτελέσματος στον host

	printf("================================\n");

	FILE *f = fopen("ask1_cuda_output.txt", "w+");
	if (f == NULL)
	{
	    printf("Error opening ask1_cuda_output.txt!\n");
	    exit(1);
	}

	for (int i = 1; i < NI - 1; ++i) {
		for (int j = 1; j < NJ - 1; ++j) {
			fprintf(f, "%f\n", B_h[i*NJ + j]);
			}
	}

	if(f) { printf("Results saved in ask1_cuda_output.txt!\n"); }

	fclose(f);

	// Αποδέσμευση μνήμης στον host
	free(A_h);
	free(B_h);
	
	// Αποδέσμευση μνήμης στο device
	hipFree(A_d);
	hipFree(B_d);
	
	return 0;
}

	.text
	.file	"ask1_cuda.hip"
	.globl	_Z26__device_stub__ConvolutionPdS_ # -- Begin function _Z26__device_stub__ConvolutionPdS_
	.type	_Z26__device_stub__ConvolutionPdS_,@function
_Z26__device_stub__ConvolutionPdS_:     # @_Z26__device_stub__ConvolutionPdS_
	.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	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z11ConvolutionPdS_, %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	_Z26__device_stub__ConvolutionPdS_, .Lfunc_end0-_Z26__device_stub__ConvolutionPdS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z4initPd
.LCPI1_0:
	.quad	0x41dfffffffc00000              # double 2147483647
	.text
	.globl	_Z4initPd
	.type	_Z4initPd,@function
_Z4initPd:                              # @_Z4initPd
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	xorl	%r14d, %r14d
.LBB1_1:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_2 Depth 2
	xorl	%r15d, %r15d
.LBB1_2:                                #   Parent Loop BB1_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	movsd	.LCPI1_0(%rip), %xmm1           # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx,%r15,8)
	incq	%r15
	cmpq	$4096, %r15                     # imm = 0x1000
	jne	.LBB1_2
# %bb.3:                                #   in Loop: Header=BB1_1 Depth=1
	incq	%r14
	addq	$32768, %rbx                    # imm = 0x8000
	cmpq	$4096, %r14                     # imm = 0x1000
	jne	.LBB1_1
# %bb.4:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z4initPd, .Lfunc_end1-_Z4initPd
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI2_0:
	.quad	0x41dfffffffc00000              # double 2147483647
.LCPI2_1:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	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
	movl	$134217728, %edi                # imm = 0x8000000
	callq	malloc
	movq	%rax, %rbx
	movl	$134217728, %edi                # imm = 0x8000000
	callq	malloc
	movq	%rax, %r14
	leaq	16(%rsp), %rdi
	movl	$134217728, %esi                # imm = 0x8000000
	callq	hipMalloc
	leaq	8(%rsp), %rdi
	movl	$134217728, %esi                # imm = 0x8000000
	callq	hipMalloc
	xorl	%r15d, %r15d
	movq	%rbx, %r12
.LBB2_1:                                # %.preheader.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_2 Depth 2
	xorl	%r13d, %r13d
.LBB2_2:                                #   Parent Loop BB2_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	movsd	.LCPI2_0(%rip), %xmm1           # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%r12,%r13,8)
	incq	%r13
	cmpq	$4096, %r13                     # imm = 0x1000
	jne	.LBB2_2
# %bb.3:                                #   in Loop: Header=BB2_1 Depth=1
	incq	%r15
	addq	$32768, %r12                    # imm = 0x8000
	cmpq	$4096, %r15                     # imm = 0x1000
	jne	.LBB2_1
# %bb.4:                                # %_Z4initPd.exit
	movq	16(%rsp), %rdi
	movl	$134217728, %edx                # imm = 0x8000000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movabsq	$549755814016, %rdi             # imm = 0x8000000080
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_6
# %bb.5:
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rsi
	callq	_Z26__device_stub__ConvolutionPdS_
.LBB2_6:
	movq	8(%rsp), %rsi
	movl	$134217728, %edx                # imm = 0x8000000
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	leaq	40(%rsp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	stdout(%rip), %rdi
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	subq	24(%rsp), %rax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rax, %xmm1
	movsd	.LCPI2_1(%rip), %xmm2           # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm1
	subq	32(%rsp), %rcx
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rcx, %xmm0
	addsd	%xmm1, %xmm0
	divsd	%xmm2, %xmm0
	movl	$.L.str, %esi
	movb	$1, %al
	callq	fprintf
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$.L.str.2, %edi
	movl	$.L.str.3, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB2_12
# %bb.7:                                # %.preheader.preheader
	movq	%rax, %r15
	movq	%r14, %r12
	addq	$32776, %r12                    # imm = 0x8008
	movl	$1, %r13d
.LBB2_8:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_9 Depth 2
	xorl	%ebp, %ebp
.LBB2_9:                                #   Parent Loop BB2_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%r12,%rbp,8), %xmm0            # xmm0 = mem[0],zero
	movl	$.L.str.5, %esi
	movq	%r15, %rdi
	movb	$1, %al
	callq	fprintf
	incq	%rbp
	cmpq	$4094, %rbp                     # imm = 0xFFE
	jne	.LBB2_9
# %bb.10:                               #   in Loop: Header=BB2_8 Depth=1
	incq	%r13
	addq	$32768, %r12                    # imm = 0x8000
	cmpq	$4095, %r13                     # imm = 0xFFF
	jne	.LBB2_8
# %bb.11:
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movq	%r15, %rdi
	callq	fclose
	movq	%rbx, %rdi
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	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
.LBB2_12:
	.cfi_def_cfa_offset 112
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11ConvolutionPdS_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB4_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z11ConvolutionPdS_,@object     # @_Z11ConvolutionPdS_
	.section	.rodata,"a",@progbits
	.globl	_Z11ConvolutionPdS_
	.p2align	3, 0x0
_Z11ConvolutionPdS_:
	.quad	_Z26__device_stub__ConvolutionPdS_
	.size	_Z11ConvolutionPdS_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"GPU Runtime: %0.6lfs\n"
	.size	.L.str, 22

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"ask1_cuda_output.txt"
	.size	.L.str.2, 21

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%f\n"
	.size	.L.str.5, 4

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z11ConvolutionPdS_"
	.size	.L__unnamed_1, 20

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"================================"
	.size	.Lstr, 33

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Results saved in ask1_cuda_output.txt!"
	.size	.Lstr.1, 39

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"Error opening ask1_cuda_output.txt!"
	.size	.Lstr.2, 36

	.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 _Z26__device_stub__ConvolutionPdS_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z11ConvolutionPdS_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11ConvolutionPdS_     ; -- Begin function _Z11ConvolutionPdS_
	.globl	_Z11ConvolutionPdS_
	.p2align	8
	.type	_Z11ConvolutionPdS_,@function
_Z11ConvolutionPdS_:                    ; @_Z11ConvolutionPdS_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x1c
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v4, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	v_mad_u64_u32 v[2:3], null, s15, s3, v[1:2]
	v_mad_u64_u32 v[0:1], null, s14, s2, v[4:5]
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v3, 1, v2
	v_add_nc_u32_e32 v1, 1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_i32_e32 v4, v3, v1
	v_cmpx_gt_i32_e32 0xfff, v4
	s_cbranch_execz .LBB0_2
; %bb.1:
	v_lshlrev_b32_e32 v17, 12, v3
	s_load_b128 s[0:3], s[0:1], 0x0
	v_lshlrev_b32_e32 v15, 12, v2
	s_mov_b32 s5, 0x3fc99999
	s_mov_b32 s4, 0x9999999a
	v_add_nc_u32_e32 v3, v17, v0
	v_add_nc_u32_e32 v11, v17, v1
	v_add_nc_u32_e32 v5, v15, v0
	v_add_nc_u32_e32 v19, 0x2000, v15
	v_add_nc_u32_e32 v9, v1, v15
	v_ashrrev_i32_e32 v4, 31, v3
	v_ashrrev_i32_e32 v12, 31, v11
	v_ashrrev_i32_e32 v6, 31, v5
	v_add_nc_u32_e32 v7, v19, v0
	v_ashrrev_i32_e32 v10, 31, v9
	v_lshlrev_b64 v[3:4], 3, v[3:4]
	v_lshlrev_b64 v[11:12], 3, v[11:12]
	v_lshlrev_b64 v[5:6], 3, v[5:6]
	v_ashrrev_i32_e32 v8, 31, v7
	v_lshlrev_b64 v[9:10], 3, v[9:10]
	v_add_nc_u32_e32 v1, v19, v1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s0, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s1, v4, vcc_lo
	v_add_co_u32 v5, vcc_lo, s0, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v6, vcc_lo
	global_load_b64 v[3:4], v[3:4], off
	v_lshlrev_b64 v[7:8], 3, v[7:8]
	v_ashrrev_i32_e32 v2, 31, v1
	global_load_b64 v[5:6], v[5:6], off
	v_add_nc_u32_e32 v0, 2, v0
	v_add_co_u32 v7, vcc_lo, s0, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s1, v8, vcc_lo
	v_add_co_u32 v9, vcc_lo, s0, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, s1, v10, vcc_lo
	global_load_b64 v[7:8], v[7:8], off
	v_add_co_u32 v13, vcc_lo, s0, v11
	global_load_b64 v[9:10], v[9:10], off
	v_add_co_ci_u32_e32 v14, vcc_lo, s1, v12, vcc_lo
	v_lshlrev_b64 v[1:2], 3, v[1:2]
	v_add_nc_u32_e32 v15, v0, v15
	v_add_nc_u32_e32 v17, v17, v0
	global_load_b64 v[13:14], v[13:14], off
	v_add_nc_u32_e32 v19, v19, v0
	v_add_co_u32 v1, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	v_ashrrev_i32_e32 v16, 31, v15
	v_ashrrev_i32_e32 v18, 31, v17
	v_ashrrev_i32_e32 v20, 31, v19
	global_load_b64 v[1:2], v[1:2], off
	v_lshlrev_b64 v[15:16], 3, v[15:16]
	v_lshlrev_b64 v[17:18], 3, v[17:18]
	v_lshlrev_b64 v[19:20], 3, v[19:20]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v15, vcc_lo, s0, v15
	v_add_co_ci_u32_e32 v16, vcc_lo, s1, v16, vcc_lo
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_u32 v17, vcc_lo, s0, v17
	v_add_co_ci_u32_e32 v18, vcc_lo, s1, v18, vcc_lo
	global_load_b64 v[15:16], v[15:16], off
	v_add_co_u32 v19, vcc_lo, s0, v19
	global_load_b64 v[17:18], v[17:18], off
	v_add_co_ci_u32_e32 v20, vcc_lo, s1, v20, vcc_lo
	s_mov_b32 s1, 0xbfd33333
	s_mov_b32 s0, 0x33333333
	global_load_b64 v[19:20], v[19:20], off
	s_waitcnt vmcnt(8)
	v_mul_f64 v[3:4], v[3:4], s[0:1]
	s_mov_b32 s1, 0x3fe33333
	s_waitcnt vmcnt(7)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_fma_f64 v[3:4], v[5:6], s[4:5], v[3:4]
	s_mov_b32 s5, 0x3fd99999
	s_waitcnt vmcnt(6)
	v_fma_f64 v[3:4], v[7:8], s[4:5], v[3:4]
	s_mov_b32 s5, 0xbfe99999
	s_waitcnt vmcnt(5)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[3:4], v[9:10], 0.5, v[3:4]
	s_waitcnt vmcnt(4)
	v_fma_f64 v[3:4], v[13:14], s[0:1], v[3:4]
	s_mov_b32 s0, 0x66666666
	s_mov_b32 s1, 0x3fe66666
	s_waitcnt vmcnt(3)
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[0:1], v[1:2], s[0:1], v[3:4]
	s_mov_b32 s0, 0xcccccccd
	s_mov_b32 s1, 0xbfeccccc
	v_add_co_u32 v2, vcc_lo, s2, v11
	v_add_co_ci_u32_e32 v3, vcc_lo, s3, v12, vcc_lo
	s_waitcnt vmcnt(2)
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_fma_f64 v[0:1], v[15:16], s[4:5], v[0:1]
	s_mov_b32 s5, 0x3fb99999
	s_waitcnt vmcnt(1)
	v_fma_f64 v[0:1], v[17:18], s[0:1], v[0:1]
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[0:1], v[19:20], s[4:5], v[0:1]
	global_store_b64 v[2:3], v[0:1], off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11ConvolutionPdS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 21
		.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	_Z11ConvolutionPdS_, .Lfunc_end0-_Z11ConvolutionPdS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 712
; NumSgprs: 18
; NumVgprs: 21
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 21
; 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
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z11ConvolutionPdS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11ConvolutionPdS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     21
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
