﻿#include "NeuralNetGPUFunctions.cuh"

__device__ double activationFunctionHidden(double x)
{
	// Relu
	return fmax(0.0, x);
}
__device__ double activationFunctionDerivativeHidden(double x)
{
	return x >= 0.0 ? 1.0 : 0.0;
}

__device__ double activationFunctionOutput(double x)
{
	// Sigmoid

	// As expected, exp() gives slightly different 
	// results when comparing CUDA exp() and std::exp()
	return 1.0 / (1.0 + exp(-x));
}
__device__ double activationFunctionDerivativeOutput(double x)
{
	double s = activationFunctionOutput(x);

	return s * (1.0 - s);
}

#define MAX_BLOCKING_SIZE 1024

__global__ void cudaForwardProp(
	double* neuronOutputs,
	double* neuronWeights,
	int* neuronsPerLayer,
	int numLayers
)
{
	__shared__ double shared_lastLayerOutputs[MAX_BLOCKING_SIZE];

	int id = blockIdx.x * blockDim.x + threadIdx.x;

	int layerIndexStride = 0;
	int lastLayerIndexStride = 0;
	int lastLayerWeightStride = 0;

	// Go through each layer
	for (int l = 1; l < numLayers; ++l)
	{
		layerIndexStride += neuronsPerLayer[l - 1];

		// Load last layer output values
		// into shared memory
		if (id < neuronsPerLayer[l - 1])
		{
			shared_lastLayerOutputs[id] =
				neuronOutputs[lastLayerIndexStride + id];
		}
		__syncthreads();

		// Don't calculate output for bias neurons
		if (id < neuronsPerLayer[l] - 1)
		{
			neuronOutputs[layerIndexStride + id] = 0;

			// Go through each neuron from the last layer
			for (int n = 0; n < neuronsPerLayer[l - 1]; ++n)
			{
				double outVal = shared_lastLayerOutputs[n];
				double weightVal = 
					neuronWeights[
						lastLayerWeightStride +
						(neuronsPerLayer[l] - 1) * n + // Ignore bias neuron
						id
					];

				neuronOutputs[layerIndexStride + id] += outVal * weightVal;
			}

			// Activation function for hidden layers
			if (l < numLayers - 1)
			{
				neuronOutputs[layerIndexStride + id] =
					activationFunctionHidden(neuronOutputs[layerIndexStride + id]);
			}
			// Activation function for output layer
			// (Let the CPU do it to keep precision,
			// only takes <100 ms for 5000 training sets)
			/*else
			{
				neuronOutputs[layerIndexStride + id] =
					activationFunctionOutput(neuronOutputs[layerIndexStride + id]);
			}*/
		}
		// Bias neuron
		else if (id == neuronsPerLayer[l] - 1)
		{
			neuronOutputs[layerIndexStride + id] = 1.0;
		}

		lastLayerWeightStride += (neuronsPerLayer[l - 1]) * (neuronsPerLayer[l] - 1);
		lastLayerIndexStride = layerIndexStride;

		__syncthreads();
	}
}

__global__ void cudaCalcGradients(
	double* neuronOutputs,
	double* neuronWeights,
	double* neuronGradients,
	int* neuronsPerLayer,
	int numLayers
)
{
	__shared__ double shared_nextLayerGradients[MAX_BLOCKING_SIZE];

	int id = blockIdx.x * blockDim.x + threadIdx.x;

	// ----- Calculate gradients in hidden layers -----

	// Stride points to last hidden layer
	int layerStride = 0;
	int nextLayerStride = 0;
	for (int i = 0; i < numLayers - 1 - 1; ++i)
		layerStride += neuronsPerLayer[i];
	nextLayerStride = layerStride + neuronsPerLayer[numLayers - 1 - 1];

	// Stride points to last hidden layer weights
	int weightStride = 0;
	for (int i = 0; i < numLayers - 1 - 1; ++i)
	{
		// += <number of neurons> * <number of weights for each neuron>
		weightStride += neuronsPerLayer[i] * (neuronsPerLayer[i + 1] - 1);
	}

	// Loop through each hidden layer, back to front, 
	// starting from the last hidden layer
	for (int i = numLayers - 1 - 1; i > 0; --i)
	{
		// Load gradients into shared memory
		if (id < neuronsPerLayer[i + 1] - 1)
		{
			shared_nextLayerGradients[id] = neuronGradients[nextLayerStride + id];
		}
		__syncthreads();

		// Make sure this thread can work
		if (id < neuronsPerLayer[i])
		{
			// Sum weight gradients
			double swg = 0.0;

			// Loop through each weight
			for (int j = 0; j < neuronsPerLayer[i + 1] - 1; ++j)
			{
				// += <weight to next neuron> * <next neuron gradient>
				swg +=
					neuronWeights[weightStride + (neuronsPerLayer[i + 1] - 1) * id + j] *
					shared_nextLayerGradients[j];
			}

			neuronGradients[layerStride + id] =
				swg *
				activationFunctionDerivativeHidden(neuronOutputs[layerStride + id]);
		}

		nextLayerStride = layerStride;
		layerStride -= neuronsPerLayer[i - 1];
		weightStride -= neuronsPerLayer[i - 1] * (neuronsPerLayer[i] - 1);

		__syncthreads();
	}
}

__global__ void cudaUpdateWeights(
	double* neuronOutputs,
	double* neuronWeights,
	double* neuronDeltaWeights,
	double* neuronGradients,
	int* thisNeuronIndex,
	int* nextNeuronIndex,
	int numWeights,
	float eta,
	float alpha
)
{
	int id = blockIdx.x * blockDim.x + threadIdx.x;

	if (id < numWeights)
	{
		double oldDeltaWeight = neuronDeltaWeights[id];
		double newDeltaWeight =
			eta * neuronOutputs[thisNeuronIndex[id]] * neuronGradients[nextNeuronIndex[id]] +
			alpha * oldDeltaWeight;

		// Apply weight and delta weight
		neuronDeltaWeights[id] = newDeltaWeight;
		neuronWeights[id] += newDeltaWeight;
	}

	__syncthreads();
}
	.file	"tmpxft_002b8a97_00000000-6_NeuralNetGPUFunctions.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2014:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2014:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z24activationFunctionHiddend
	.type	_Z24activationFunctionHiddend, @function
_Z24activationFunctionHiddend:
.LFB2008:
	.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
.LFE2008:
	.size	_Z24activationFunctionHiddend, .-_Z24activationFunctionHiddend
	.globl	_Z34activationFunctionDerivativeHiddend
	.type	_Z34activationFunctionDerivativeHiddend, @function
_Z34activationFunctionDerivativeHiddend:
.LFB2160:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z24activationFunctionHiddend
	.cfi_endproc
.LFE2160:
	.size	_Z34activationFunctionDerivativeHiddend, .-_Z34activationFunctionDerivativeHiddend
	.globl	_Z24activationFunctionOutputd
	.type	_Z24activationFunctionOutputd, @function
_Z24activationFunctionOutputd:
.LFB2162:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z24activationFunctionHiddend
	.cfi_endproc
.LFE2162:
	.size	_Z24activationFunctionOutputd, .-_Z24activationFunctionOutputd
	.globl	_Z34activationFunctionDerivativeOutputd
	.type	_Z34activationFunctionDerivativeOutputd, @function
_Z34activationFunctionDerivativeOutputd:
.LFB2164:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z24activationFunctionHiddend
	.cfi_endproc
.LFE2164:
	.size	_Z34activationFunctionDerivativeOutputd, .-_Z34activationFunctionDerivativeOutputd
	.globl	_Z40__device_stub__Z15cudaForwardPropPdS_PiiPdS_Pii
	.type	_Z40__device_stub__Z15cudaForwardPropPdS_PiiPdS_Pii, @function
_Z40__device_stub__Z15cudaForwardPropPdS_PiiPdS_Pii:
.LFB2036:
	.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
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%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	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%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	.L10
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z15cudaForwardPropPdS_Pii(%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
.L10:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z40__device_stub__Z15cudaForwardPropPdS_PiiPdS_Pii, .-_Z40__device_stub__Z15cudaForwardPropPdS_PiiPdS_Pii
	.globl	_Z15cudaForwardPropPdS_Pii
	.type	_Z15cudaForwardPropPdS_Pii, @function
_Z15cudaForwardPropPdS_Pii:
.LFB2037:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z15cudaForwardPropPdS_PiiPdS_Pii
	.cfi_endproc
.LFE2037:
	.size	_Z15cudaForwardPropPdS_Pii, .-_Z15cudaForwardPropPdS_Pii
	.globl	_Z44__device_stub__Z17cudaCalcGradientsPdS_S_PiiPdS_S_Pii
	.type	_Z44__device_stub__Z17cudaCalcGradientsPdS_S_PiiPdS_S_Pii, @function
_Z44__device_stub__Z17cudaCalcGradientsPdS_S_PiiPdS_S_Pii:
.LFB2038:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z17cudaCalcGradientsPdS_S_Pii(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L16:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2038:
	.size	_Z44__device_stub__Z17cudaCalcGradientsPdS_S_PiiPdS_S_Pii, .-_Z44__device_stub__Z17cudaCalcGradientsPdS_S_PiiPdS_S_Pii
	.globl	_Z17cudaCalcGradientsPdS_S_Pii
	.type	_Z17cudaCalcGradientsPdS_S_Pii, @function
_Z17cudaCalcGradientsPdS_S_Pii:
.LFB2039:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z17cudaCalcGradientsPdS_S_PiiPdS_S_Pii
	.cfi_endproc
.LFE2039:
	.size	_Z17cudaCalcGradientsPdS_S_Pii, .-_Z17cudaCalcGradientsPdS_S_Pii
	.globl	_Z51__device_stub__Z17cudaUpdateWeightsPdS_S_S_PiS0_iffPdS_S_S_PiS0_iff
	.type	_Z51__device_stub__Z17cudaUpdateWeightsPdS_S_S_PiS0_iffPdS_S_S_PiS0_iff, @function
_Z51__device_stub__Z17cudaUpdateWeightsPdS_S_S_PiS0_iffPdS_S_S_PiS0_iff:
.LFB2040:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	%rdi, 56(%rsp)
	leaq	80(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rdx, 40(%rsp)
	leaq	64(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	72(%rsp), %rcx
	movq	%r8, 24(%rsp)
	movq	%r9, 16(%rsp)
	movss	%xmm0, 12(%rsp)
	movss	%xmm1, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 128(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	224(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L21
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z17cudaUpdateWeightsPdS_S_S_PiS0_iff(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	144(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L21:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2040:
	.size	_Z51__device_stub__Z17cudaUpdateWeightsPdS_S_S_PiS0_iffPdS_S_S_PiS0_iff, .-_Z51__device_stub__Z17cudaUpdateWeightsPdS_S_S_PiS0_iffPdS_S_S_PiS0_iff
	.globl	_Z17cudaUpdateWeightsPdS_S_S_PiS0_iff
	.type	_Z17cudaUpdateWeightsPdS_S_S_PiS0_iff, @function
_Z17cudaUpdateWeightsPdS_S_S_PiS0_iff:
.LFB2041:
	.cfi_startproc
	endbr64
	jmp	_Z51__device_stub__Z17cudaUpdateWeightsPdS_S_S_PiS0_iffPdS_S_S_PiS0_iff
	.cfi_endproc
.LFE2041:
	.size	_Z17cudaUpdateWeightsPdS_S_S_PiS0_iff, .-_Z17cudaUpdateWeightsPdS_S_S_PiS0_iff
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z17cudaUpdateWeightsPdS_S_S_PiS0_iff"
.LC1:
	.string	"_Z17cudaCalcGradientsPdS_S_Pii"
.LC2:
	.string	"_Z15cudaForwardPropPdS_Pii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2043:
	.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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z17cudaUpdateWeightsPdS_S_S_PiS0_iff(%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	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17cudaCalcGradientsPdS_S_Pii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z15cudaForwardPropPdS_Pii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	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	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2043:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

﻿#pragma once

#include <hip/hip_runtime.h>



__global__ void cudaForwardProp(
	double* neuronOutputs,
	double* neuronWeights,
	int* neuronsPerLayer,
	int numLayers
);

__global__ void cudaCalcGradients(
	double* neuronOutputs,
	double* neuronWeights,
	double* neuronGradients,
	int* neuronsPerLayer,
	int numLayers
);

__global__ void cudaUpdateWeights(
	double* neuronOutputs,
	double* neuronWeights,
	double* neuronDeltaWeights,
	double* neuronGradients,
	int* thisNeuronIndex,
	int* nextNeuronIndex,
	int numWeights,
	float eta,
	float alpha
);
	.text
	.file	"NeuralNetGPUFunctions.hip"
	.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 __hip_cuid_

	.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_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
