#include <iostream>

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

#include "parallel.cuh"

#define ELEMENTS 5

#define errCheck(code) { errorCheck((code), __FILE__, __LINE__); }
void addWithCuda(const int* a, const int* b, int* c, int elements);

using std::cout;
using std::flush;
using std::endl;

inline void errorCheck(cudaError_t code, const char* file, int line) {
    if (cudaSuccess != code) {
        std::cout << "[" << file << ", line " << line << "]" << std::flush;
        std::cout << " CUDA error <" << cudaGetErrorString(code) << "> received." << std::endl << std::flush;
        exit(EXIT_FAILURE);
    }
}

__global__ void addKernel(const int* a, const int* b, int* c, int elements) {
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    printf("x = %d, BlockIdx = %d, BlockDimx = %d, threadIdx = %d\n", x, blockIdx.x, blockDim.x, threadIdx.x);
    if (x < elements) {
        c[x] = a[x] + b[x];
    }
}

void solvePar(int rows, int cols, int iterations, double td, double h, double** matrix) {
    cout << "Do cuda related stuff here!" << endl << flush;

    // Example.
    // int elements = 5;
    const int a[ELEMENTS] = { 1, 2, 3, 4, 5 };
    const int b[ELEMENTS] = { 5, 4, 3, 2, 1 };
    int c[ELEMENTS] = { 0 };

    addWithCuda(a, b, c, ELEMENTS);
}


// before in lab 3 (too complex in the end)
    // get initial totalMatrix
    // extract partialMatrix
    // in the main calculation method
    //      for each iteration
    //          ||calculate the heatmap of partialMatrix||
    //      end for loop
    // copy/paste the values back to totalMatrix

// AFTER in lab 3 (this final method)
    // in the main calculation method
    //      for each iteration
    //          get initial totalMatrix
    //          extract partialMatrix
    //              ||calculate the heatmap of partialMatrix||
    //              sync
    //          copy/paste the values back to totalMatrix
    //      end for loop

// for lab 4
// for each iteration
//      get totalMatrix
//      extract partialMatrix
//              || parallel calculate partialMatrix ||
//      copy paste partial to total
// end for
void addWithCuda(const int* a, const int* b, int* c, int elements) {
    int* dev_a = nullptr;
    int* dev_b = nullptr;
    int* dev_c = nullptr;

    dim3 dimGrid(1, 1, 1);
    dim3 dimBlock(5, 1, 1);

    errCheck(cudaSetDevice(0));

    errCheck(cudaMalloc((void**)&dev_c, elements * sizeof(int)));
    errCheck(cudaMalloc((void**)&dev_a, elements * sizeof(int)));
    errCheck(cudaMalloc((void**)&dev_b, elements * sizeof(int)));

    errCheck(cudaMemcpy(dev_a, a, elements * sizeof(int), cudaMemcpyHostToDevice));
    errCheck(cudaMemcpy(dev_b, b, elements * sizeof(int), cudaMemcpyHostToDevice));
    
    // for should be here
    // extract partial matrix from total matrix

    // in our addKernel, arguments should be
    // totalInputMatrix, partialMatrix, totalOutputMatrix
    addKernel << <dimGrid, dimBlock >> > (dev_a, dev_b, dev_c, elements);

    errCheck(cudaGetLastError());
    errCheck(cudaDeviceSynchronize());
    errCheck(cudaMemcpy(c, dev_c, elements * sizeof(int), cudaMemcpyDeviceToHost));
    errCheck(cudaFree(dev_a));
    errCheck(cudaFree(dev_b));
    errCheck(cudaFree(dev_c));
    errCheck(cudaDeviceReset());

    cout << "c = { " << c[0] << flush;
    for (int i = 1; i < elements; i++) {
        cout << ", " << c[i] << flush;
    }

    cout << " }" << endl << flush;
}

	.file	"tmpxft_0023ec06_00000000-6_parallel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3640:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3640:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata._Z10errorCheck9cudaErrorPKci.str1.1,"aMS",@progbits,1
.LC0:
	.string	"["
.LC1:
	.string	", line "
.LC2:
	.string	"]"
.LC3:
	.string	" CUDA error <"
.LC4:
	.string	"> received."
	.section	.text._Z10errorCheck9cudaErrorPKci,"axG",@progbits,_Z10errorCheck9cudaErrorPKci,comdat
	.weak	_Z10errorCheck9cudaErrorPKci
	.type	_Z10errorCheck9cudaErrorPKci, @function
_Z10errorCheck9cudaErrorPKci:
.LFB3635:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L2
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rsi, %r13
	leaq	.LC0(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	_ZSt4cout(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edi, %ebx
	movq	%rbp, %rdi
	pushq	%rax
	.cfi_def_cfa_offset 48
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt5flushIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	_ZSt5flushIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	ret
	.cfi_endproc
.LFE3635:
	.size	_Z10errorCheck9cudaErrorPKci, .-_Z10errorCheck9cudaErrorPKci
	.text
	.globl	_Z35__device_stub__Z9addKernelPKiS0_PiiPKiS0_Pii
	.type	_Z35__device_stub__Z9addKernelPKiS0_PiiPKiS0_Pii, @function
_Z35__device_stub__Z9addKernelPKiS0_PiiPKiS0_Pii:
.LFB3662:
	.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	.L8
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9addKernelPKiS0_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
.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
.LFE3662:
	.size	_Z35__device_stub__Z9addKernelPKiS0_PiiPKiS0_Pii, .-_Z35__device_stub__Z9addKernelPKiS0_PiiPKiS0_Pii
	.globl	_Z9addKernelPKiS0_Pii
	.type	_Z9addKernelPKiS0_Pii, @function
_Z9addKernelPKiS0_Pii:
.LFB3663:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z9addKernelPKiS0_PiiPKiS0_Pii
	.cfi_endproc
.LFE3663:
	.size	_Z9addKernelPKiS0_Pii, .-_Z9addKernelPKiS0_Pii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/smartshader/LOG645-E2020/master/l4/Labo4CUDA/src/solver/parallel.cu"
.LC6:
	.string	"c = { "
.LC7:
	.string	", "
.LC8:
	.string	" }"
	.text
	.globl	_Z11addWithCudaPKiS0_Pii
	.type	_Z11addWithCudaPKiS0_Pii, @function
_Z11addWithCudaPKiS0_Pii:
.LFB3637:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	xorl	%edi, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%ecx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC5(%rip), %rbx
	movq	%rbp, %r12
	salq	$2, %rbp
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	xorl	%eax, %eax
	movl	$1, 40(%rsp)
	movq	%rax, 8(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 24(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	addq	$4, %rax
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	cudaSetDevice@PLT
	movl	$81, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	leaq	24(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	movl	$83, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	leaq	8(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	movl	$84, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	leaq	16(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	movl	$85, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	movq	8(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%r15, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	$87, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	movq	16(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	$88, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	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	.L14
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movl	%r12d, %ecx
	movq	8(%rsp), %rdi
	call	_Z35__device_stub__Z9addKernelPKiS0_PiiPKiS0_Pii
.L14:
	call	cudaGetLastError@PLT
	movq	%rbx, %rsi
	movl	$97, %edx
	leaq	.LC7(%rip), %r14
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	call	cudaDeviceSynchronize@PLT
	movq	%rbx, %rsi
	movl	$98, %edx
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	movq	24(%rsp), %rsi
	movq	%rbp, %rdx
	movq	%r13, %rdi
	movl	$2, %ecx
	leaq	_ZSt4cout(%rip), %rbp
	call	cudaMemcpy@PLT
	movq	%rbx, %rsi
	movl	$99, %edx
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbx, %rsi
	movl	$100, %edx
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbx, %rsi
	movl	$101, %edx
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbx, %rsi
	movl	$102, %edx
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	call	cudaDeviceReset@PLT
	movl	$103, %edx
	movq	%rbx, %rsi
	xorl	%ebx, %ebx
	movl	%eax, %edi
	call	_Z10errorCheck9cudaErrorPKci
	leaq	.LC6(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	0(%r13), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt5flushIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
.L15:
	incq	%rbx
	cmpl	%ebx, %r12d
	jle	.L19
	movq	%r14, %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	0(%r13,%rbx,4), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt5flushIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	jmp	.L15
.L19:
	leaq	.LC8(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	_ZSt5flushIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3637:
	.size	_Z11addWithCudaPKiS0_Pii, .-_Z11addWithCudaPKiS0_Pii
	.section	.rodata.str1.1
.LC9:
	.string	"Do cuda related stuff here!"
	.text
	.globl	_Z8solvePariiiddPPd
	.type	_Z8solvePariiiddPPd, @function
_Z8solvePariiiddPPd:
.LFB3636:
	.cfi_startproc
	endbr64
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	leaq	.LC9(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	_ZSt5flushIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	52(%rsp), %rdi
	movl	$5, %ecx
	movabsq	$8589934593, %rax
	movq	%rax, 12(%rsp)
	leaq	52(%rsp), %rdx
	movabsq	$17179869187, %rax
	leaq	32(%rsp), %rsi
	movq	%rax, 20(%rsp)
	addq	$2, %rax
	movq	%rax, 32(%rsp)
	movabsq	$8589934595, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	rep stosl
	leaq	12(%rsp), %rdi
	movl	$5, %ecx
	movl	$5, 28(%rsp)
	movl	$1, 48(%rsp)
	call	_Z11addWithCudaPKiS0_Pii
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	addq	$88, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3636:
	.size	_Z8solvePariiiddPPd, .-_Z8solvePariiiddPPd
	.section	.rodata.str1.1
.LC10:
	.string	"_Z9addKernelPKiS0_Pii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3665:
	.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	.LC10(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z9addKernelPKiS0_Pii(%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
.LFE3665:
	.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:

#ifndef PARALLEL_CUH
#define PARALLEL_CUH

void solvePar(int rows, int cols, int iterations, double td, double h, double** matrix);

#endif

	.text
	.file	"parallel.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
