#include <iostream>
#include <cuda_runtime.h>
#include <cooperative_groups.h>
#include <cuda_fp16.h>

namespace cg = cooperative_groups;

#define BLOCK_SIZE 256
#define NUM_ELEMENTS 1024
#define NUM_GPUS 2

__global__ void fluidStructureInteraction(float* boundaryElements, float* forces, int numElements) {
    cg::grid_group grid = cg::this_grid();
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (idx >= numElements) return;

    // Simulate force calculation for boundary element interaction
    float force = 0.0f;
    for (int i = 0; i < numElements; ++i) {
        force += boundaryElements[i] * boundaryElements[idx];
    }

    // Use cooperative groups to synchronize across blocks
    cg::thread_block block = cg::this_thread_block();
    float sharedForce;
    __shared__ float sharedForces[BLOCK_SIZE];

    sharedForces[threadIdx.x] = force;
    cg::sync(block);

    // Perform reduction within a block
    for (int stride = blockDim.x / 2; stride > 0; stride >>= 1) {
        if (threadIdx.x < stride) {
            sharedForces[threadIdx.x] += sharedForces[threadIdx.x + stride];
        }
        cg::sync(block);
    }

    if (threadIdx.x == 0) {
        sharedForce = sharedForces[0];
    }
    cg::sync(block);

    // Use grid-wide reduction to find the total force
    if (blockIdx.x == 0 && threadIdx.x == 0) {
        float totalForce = 0.0f;
        for (int i = 0; i < grid.size(); ++i) {
            if (i == grid.thread_rank()) {
                totalForce = sharedForce;
            }
            cg::sync(grid);
            if (threadIdx.x == 0) {
                forces[0] += totalForce;
            }
            cg::sync(grid);
        }
    }
}

void checkCudaError(cudaError_t err, const char* msg) {
    if (err != cudaSuccess) {
        std::cerr << "CUDA error: " << msg << " (" << cudaGetErrorString(err) << ")" << std::endl;
        exit(EXIT_FAILURE);
    }
}

void runOnGPU(int gpuId, float* d_boundaryElements, float* d_forces, int numElements) {
    cudaSetDevice(gpuId);
    checkCudaError(cudaGetLastError(), "Failed to set device");

    int numBlocks = (numElements + BLOCK_SIZE - 1) / BLOCK_SIZE;
    fluidStructureInteraction<<<numBlocks, BLOCK_SIZE>>>(d_boundaryElements, d_forces, numElements);
    checkCudaError(cudaGetLastError(), "Kernel launch failed");
}

int main() {
    float* h_boundaryElements = new float[NUM_ELEMENTS];
    float* h_forces = new float[NUM_GPUS];
    for (int i = 0; i < NUM_ELEMENTS; ++i) {
        h_boundaryElements[i] = 1.0f; // Initialize boundary elements
    }
    for (int i = 0; i < NUM_GPUS; ++i) {
        h_forces[i] = 0.0f; // Initialize forces
    }

    float* d_boundaryElements[NUM_GPUS];
    float* d_forces[NUM_GPUS];
    int elementsPerGPU = NUM_ELEMENTS / NUM_GPUS;

    for (int i = 0; i < NUM_GPUS; ++i) {
        cudaSetDevice(i);
        checkCudaError(cudaMalloc(&d_boundaryElements[i], elementsPerGPU * sizeof(float)), "Failed to allocate memory for boundary elements");
        checkCudaError(cudaMalloc(&d_forces[i], sizeof(float)), "Failed to allocate memory for forces");
        checkCudaError(cudaMemcpy(d_boundaryElements[i], h_boundaryElements + i * elementsPerGPU, elementsPerGPU * sizeof(float), cudaMemcpyHostToDevice), "Failed to copy boundary elements to device");
        checkCudaError(cudaMemcpy(d_forces[i], h_forces + i, sizeof(float), cudaMemcpyHostToDevice), "Failed to copy forces to device");
    }

    cudaDeviceSynchronize();

    for (int i = 0; i < NUM_GPUS; ++i) {
        runOnGPU(i, d_boundaryElements[i], d_forces[i], elementsPerGPU);
    }

    cudaDeviceSynchronize();

    for (int i = 0; i < NUM_GPUS; ++i) {
        cudaSetDevice(i);
        checkCudaError(cudaMemcpy(h_forces + i, d_forces[i], sizeof(float), cudaMemcpyDeviceToHost), "Failed to copy forces from device");
    }

    // Sum up the forces from all GPUs
    float totalForce = 0.0f;
    for (int i = 0; i < NUM_GPUS; ++i) {
        totalForce += h_forces[i];
    }

    std::cout << "Total Force: " << totalForce << std::endl;

    for (int i = 0; i < NUM_GPUS; ++i) {
        cudaSetDevice(i);
        checkCudaError(cudaFree(d_boundaryElements[i]), "Failed to free boundary elements");
        checkCudaError(cudaFree(d_forces[i]), "Failed to free forces");
    }

    delete[] h_boundaryElements;
    delete[] h_forces;

    return 0;
}
	.file	"tmpxft_001d73b5_00000000-6_cuda_code_003291.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB6837:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE6837:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"CUDA error: "
.LC1:
	.string	" ("
.LC2:
	.string	")"
	.text
	.globl	_Z14checkCudaError9cudaErrorPKc
	.type	_Z14checkCudaError9cudaErrorPKc, @function
_Z14checkCudaError9cudaErrorPKc:
.LFB6832:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L2
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	leaq	.LC0(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	leaq	_ZSt4cerr(%rip), %rdi
	pushq	%rax
	.cfi_def_cfa_offset 32
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rbp, %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	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE6832:
	.size	_Z14checkCudaError9cudaErrorPKc, .-_Z14checkCudaError9cudaErrorPKc
	.globl	_Z48__device_stub__Z25fluidStructureInteractionPfS_iPfS_i
	.type	_Z48__device_stub__Z25fluidStructureInteractionPfS_iPfS_i, @function
_Z48__device_stub__Z25fluidStructureInteractionPfS_iPfS_i:
.LFB6859:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z25fluidStructureInteractionPfS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L8:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE6859:
	.size	_Z48__device_stub__Z25fluidStructureInteractionPfS_iPfS_i, .-_Z48__device_stub__Z25fluidStructureInteractionPfS_iPfS_i
	.globl	_Z25fluidStructureInteractionPfS_i
	.type	_Z25fluidStructureInteractionPfS_i, @function
_Z25fluidStructureInteractionPfS_i:
.LFB6860:
	.cfi_startproc
	endbr64
	jmp	_Z48__device_stub__Z25fluidStructureInteractionPfS_iPfS_i
	.cfi_endproc
.LFE6860:
	.size	_Z25fluidStructureInteractionPfS_i, .-_Z25fluidStructureInteractionPfS_i
	.section	.rodata.str1.1
.LC3:
	.string	"Failed to set device"
.LC4:
	.string	"Kernel launch failed"
	.text
	.globl	_Z8runOnGPUiPfS_i
	.type	_Z8runOnGPUiPfS_i, @function
_Z8runOnGPUiPfS_i:
.LFB6833:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%ecx, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	call	cudaSetDevice@PLT
	call	cudaGetLastError@PLT
	leaq	.LC3(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movl	$256, %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leal	255(%rbx), %eax
	cltd
	idivl	%ecx
	movl	$16777217, %edx
	movl	$1, %ecx
	salq	$8, %rdx
	movl	%eax, 8(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 12(%rsp)
	movq	8(%rsp), %rdi
	movl	16(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L14
	movl	%ebx, %edx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	_Z48__device_stub__Z25fluidStructureInteractionPfS_iPfS_i
.L14:
	call	cudaGetLastError@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC4(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	%eax, %edi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	_Z14checkCudaError9cudaErrorPKc
	.cfi_endproc
.LFE6833:
	.size	_Z8runOnGPUiPfS_i, .-_Z8runOnGPUiPfS_i
	.section	.rodata.str1.1
.LC6:
	.string	"Failed to allocate memory for boundary elements"
.LC7:
	.string	"Failed to allocate memory for forces"
.LC8:
	.string	"Failed to copy boundary elements to device"
.LC9:
	.string	"Failed to copy forces to device"
.LC10:
	.string	"Failed to copy forces from device"
.LC12:
	.string	"Total Force: "
.LC13:
	.string	"Failed to free boundary elements"
.LC14:
	.string	"Failed to free forces"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB6834:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$4096, %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	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	_Znam@PLT
	movl	$8, %edi
	movq	%rax, %rbp
	call	_Znam@PLT
	movss	.LC5(%rip), %xmm0
	movq	%rax, %rbx
	xorl	%eax, %eax
.L17:
	movss	%xmm0, 0(%rbp,%rax,4)
	incq	%rax
	cmpq	$1024, %rax
	jne	.L17
	leaq	4(%rbx), %rax
	movq	%rbx, (%rsp)
	leaq	40(%rsp), %r13
	xorl	%r8d, %r8d
	movq	%rax, 16(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %r12
	movq	%r13, %r15
	movq	%rax, (%rbx)
	movq	%r12, %r14
	movq	%rbp, 8(%rsp)
.L18:
	movl	%r8d, %edi
	movl	%r8d, 28(%rsp)
	call	cudaSetDevice@PLT
	movq	%r13, %rdi
	movl	$2048, %esi
	addq	$8, %r13
	call	cudaMalloc@PLT
	leaq	.LC6(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movq	%r12, %rdi
	movl	$4, %esi
	addq	$8, %r12
	call	cudaMalloc@PLT
	leaq	.LC7(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movq	-8(%r13), %rdi
	movq	8(%rsp), %rsi
	movl	$1, %ecx
	movl	$2048, %edx
	call	cudaMemcpy@PLT
	leaq	.LC8(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movq	-8(%r12), %rdi
	movq	(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	leaq	.LC9(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movl	28(%rsp), %r8d
	addq	$4, (%rsp)
	addq	$2048, 8(%rsp)
	testl	%r8d, %r8d
	jne	.L25
	movl	$1, %r8d
	jmp	.L18
.L25:
	call	cudaDeviceSynchronize@PLT
	movq	56(%rsp), %rdx
	movq	40(%rsp), %rsi
	xorl	%edi, %edi
	movl	$512, %ecx
	leaq	.LC10(%rip), %r12
	leaq	.LC13(%rip), %r13
	call	_Z8runOnGPUiPfS_i
	movq	64(%rsp), %rdx
	movq	48(%rsp), %rsi
	movl	$512, %ecx
	movl	$1, %edi
	call	_Z8runOnGPUiPfS_i
	call	cudaDeviceSynchronize@PLT
	xorl	%edi, %edi
	call	cudaSetDevice@PLT
	movq	56(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	%r12, %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movl	$1, %edi
	call	cudaSetDevice@PLT
	movq	64(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	%r12, %rsi
	xorl	%r12d, %r12d
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	xorps	%xmm0, %xmm0
	addss	(%rbx), %xmm0
	addss	4(%rbx), %xmm0
	leaq	.LC12(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movss	%xmm0, (%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	(%rsp), %xmm0
	movq	%rax, %rdi
	cvtss2sd	%xmm0, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.L19:
	movl	%r12d, %edi
	call	cudaSetDevice@PLT
	movq	(%r15,%r12,8), %rdi
	call	cudaFree@PLT
	movq	%r13, %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	movq	(%r14,%r12,8), %rdi
	call	cudaFree@PLT
	leaq	.LC14(%rip), %rsi
	movl	%eax, %edi
	call	_Z14checkCudaError9cudaErrorPKc
	testq	%r12, %r12
	jne	.L26
	movl	$1, %r12d
	jmp	.L19
.L26:
	movq	%rbp, %rdi
	call	_ZdaPv@PLT
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$88, %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
.LFE6834:
	.size	main, .-main
	.section	.rodata.str1.1
.LC15:
	.string	"_Z25fluidStructureInteractionPfS_i"
.LC16:
	.string	"_ZN50_INTERNAL_978f2dcd_19_cuda_code_003291_cu_f1197eb34cuda3std3__419piecewise_constructE"
.LC17:
	.string	"_ZN50_INTERNAL_978f2dcd_19_cuda_code_003291_cu_f1197eb34cuda3std6ranges3__45__cpo4swapE"
.LC18:
	.string	"_ZN50_INTERNAL_978f2dcd_19_cuda_code_003291_cu_f1197eb34cuda3std6ranges3__45__cpo9iter_moveE"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB6862:
	.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	.LC15(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z25fluidStructureInteractionPfS_i(%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	.LC16(%rip), %rdx
	movl	$1, %r9d
	leaq	_ZN4cuda3std3__419piecewise_constructE(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC17(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$1, %r9d
	leaq	_ZN4cuda3std6ranges3__45__cpo4swapE(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC18(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$1, %r9d
	movq	%rdx, %rcx
	leaq	_ZN4cuda3std6ranges3__45__cpo9iter_moveE(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r8
	.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
.LFE6862:
	.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
	.weak	_ZN4cuda3std3__419piecewise_constructE
	.section	.rodata._ZN4cuda3std3__419piecewise_constructE,"aG",@progbits,_ZN4cuda3std3__419piecewise_constructE,comdat
	.type	_ZN4cuda3std3__419piecewise_constructE, @gnu_unique_object
	.size	_ZN4cuda3std3__419piecewise_constructE, 1
_ZN4cuda3std3__419piecewise_constructE:
	.zero	1
	.weak	_ZN4cuda3std6ranges3__45__cpo9iter_moveE
	.section	.rodata._ZN4cuda3std6ranges3__45__cpo9iter_moveE,"aG",@progbits,_ZN4cuda3std6ranges3__45__cpo9iter_moveE,comdat
	.type	_ZN4cuda3std6ranges3__45__cpo9iter_moveE, @gnu_unique_object
	.size	_ZN4cuda3std6ranges3__45__cpo9iter_moveE, 1
_ZN4cuda3std6ranges3__45__cpo9iter_moveE:
	.zero	1
	.weak	_ZN4cuda3std6ranges3__45__cpo4swapE
	.section	.rodata._ZN4cuda3std6ranges3__45__cpo4swapE,"aG",@progbits,_ZN4cuda3std6ranges3__45__cpo4swapE,comdat
	.type	_ZN4cuda3std6ranges3__45__cpo4swapE, @gnu_unique_object
	.size	_ZN4cuda3std6ranges3__45__cpo4swapE, 1
_ZN4cuda3std6ranges3__45__cpo4swapE:
	.zero	1
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC5:
	.long	1065353216
	.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 <iostream>
#include <hip/hip_runtime.h>
#include <hip/hip_cooperative_groups.h>
#include <hip/hip_fp16.h>

namespace cg = cooperative_groups;

#define BLOCK_SIZE 256
#define NUM_ELEMENTS 1024
#define NUM_GPUS 2

__global__ void fluidStructureInteraction(float* boundaryElements, float* forces, int numElements) {
    cg::grid_group grid = cg::this_grid();
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (idx >= numElements) return;

    // Simulate force calculation for boundary element interaction
    float force = 0.0f;
    for (int i = 0; i < numElements; ++i) {
        force += boundaryElements[i] * boundaryElements[idx];
    }

    // Use cooperative groups to synchronize across blocks
    cg::thread_block block = cg::this_thread_block();
    float sharedForce;
    __shared__ float sharedForces[BLOCK_SIZE];

    sharedForces[threadIdx.x] = force;
    cg::sync(block);

    // Perform reduction within a block
    for (int stride = blockDim.x / 2; stride > 0; stride >>= 1) {
        if (threadIdx.x < stride) {
            sharedForces[threadIdx.x] += sharedForces[threadIdx.x + stride];
        }
        cg::sync(block);
    }

    if (threadIdx.x == 0) {
        sharedForce = sharedForces[0];
    }
    cg::sync(block);

    // Use grid-wide reduction to find the total force
    if (blockIdx.x == 0 && threadIdx.x == 0) {
        float totalForce = 0.0f;
        for (int i = 0; i < grid.size(); ++i) {
            if (i == grid.thread_rank()) {
                totalForce = sharedForce;
            }
            cg::sync(grid);
            if (threadIdx.x == 0) {
                forces[0] += totalForce;
            }
            cg::sync(grid);
        }
    }
}

void checkCudaError(hipError_t err, const char* msg) {
    if (err != hipSuccess) {
        std::cerr << "CUDA error: " << msg << " (" << hipGetErrorString(err) << ")" << std::endl;
        exit(EXIT_FAILURE);
    }
}

void runOnGPU(int gpuId, float* d_boundaryElements, float* d_forces, int numElements) {
    hipSetDevice(gpuId);
    checkCudaError(hipGetLastError(), "Failed to set device");

    int numBlocks = (numElements + BLOCK_SIZE - 1) / BLOCK_SIZE;
    fluidStructureInteraction<<<numBlocks, BLOCK_SIZE>>>(d_boundaryElements, d_forces, numElements);
    checkCudaError(hipGetLastError(), "Kernel launch failed");
}

int main() {
    float* h_boundaryElements = new float[NUM_ELEMENTS];
    float* h_forces = new float[NUM_GPUS];
    for (int i = 0; i < NUM_ELEMENTS; ++i) {
        h_boundaryElements[i] = 1.0f; // Initialize boundary elements
    }
    for (int i = 0; i < NUM_GPUS; ++i) {
        h_forces[i] = 0.0f; // Initialize forces
    }

    float* d_boundaryElements[NUM_GPUS];
    float* d_forces[NUM_GPUS];
    int elementsPerGPU = NUM_ELEMENTS / NUM_GPUS;

    for (int i = 0; i < NUM_GPUS; ++i) {
        hipSetDevice(i);
        checkCudaError(hipMalloc(&d_boundaryElements[i], elementsPerGPU * sizeof(float)), "Failed to allocate memory for boundary elements");
        checkCudaError(hipMalloc(&d_forces[i], sizeof(float)), "Failed to allocate memory for forces");
        checkCudaError(hipMemcpy(d_boundaryElements[i], h_boundaryElements + i * elementsPerGPU, elementsPerGPU * sizeof(float), hipMemcpyHostToDevice), "Failed to copy boundary elements to device");
        checkCudaError(hipMemcpy(d_forces[i], h_forces + i, sizeof(float), hipMemcpyHostToDevice), "Failed to copy forces to device");
    }

    hipDeviceSynchronize();

    for (int i = 0; i < NUM_GPUS; ++i) {
        runOnGPU(i, d_boundaryElements[i], d_forces[i], elementsPerGPU);
    }

    hipDeviceSynchronize();

    for (int i = 0; i < NUM_GPUS; ++i) {
        hipSetDevice(i);
        checkCudaError(hipMemcpy(h_forces + i, d_forces[i], sizeof(float), hipMemcpyDeviceToHost), "Failed to copy forces from device");
    }

    // Sum up the forces from all GPUs
    float totalForce = 0.0f;
    for (int i = 0; i < NUM_GPUS; ++i) {
        totalForce += h_forces[i];
    }

    std::cout << "Total Force: " << totalForce << std::endl;

    for (int i = 0; i < NUM_GPUS; ++i) {
        hipSetDevice(i);
        checkCudaError(hipFree(d_boundaryElements[i]), "Failed to free boundary elements");
        checkCudaError(hipFree(d_forces[i]), "Failed to free forces");
    }

    delete[] h_boundaryElements;
    delete[] h_forces;

    return 0;
}
	.text
	.file	"cuda_code_003291.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z40__device_stub__fluidStructureInteractionPfS_i # -- Begin function _Z40__device_stub__fluidStructureInteractionPfS_i
	.type	_Z40__device_stub__fluidStructureInteractionPfS_i,@function
_Z40__device_stub__fluidStructureInteractionPfS_i: # @_Z40__device_stub__fluidStructureInteractionPfS_i
	.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), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%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	$_Z25fluidStructureInteractionPfS_i, %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_end0:
	.size	_Z40__device_stub__fluidStructureInteractionPfS_i, .Lfunc_end0-_Z40__device_stub__fluidStructureInteractionPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z14checkCudaError10hipError_tPKc # -- Begin function _Z14checkCudaError10hipError_tPKc
	.type	_Z14checkCudaError10hipError_tPKc,@function
_Z14checkCudaError10hipError_tPKc:      # @_Z14checkCudaError10hipError_tPKc
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB1_2
# %bb.1:
	retq
.LBB1_2:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rsi, %r14
	movl	%edi, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.1, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	hipGetErrorString
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	$1, %edi
	callq	exit
.Lfunc_end1:
	.size	_Z14checkCudaError10hipError_tPKc, .Lfunc_end1-_Z14checkCudaError10hipError_tPKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z8runOnGPUiPfS_i               # -- Begin function _Z8runOnGPUiPfS_i
	.type	_Z8runOnGPUiPfS_i,@function
_Z8runOnGPUiPfS_i:                      # @_Z8runOnGPUiPfS_i
	.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
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movq	%rsi, %r15
	callq	hipSetDevice
	callq	hipGetLastError
	movl	$.L.str.3, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	leal	255(%rbx), %eax
	leal	510(%rbx), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$8, %edi
	btsq	$32, %rdi
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$256, %rdx                      # imm = 0x100
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_2
# %bb.1:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_Z40__device_stub__fluidStructureInteractionPfS_i
.LBB2_2:
	callq	hipGetLastError
	movl	$.L.str.4, %esi
	movl	%eax, %edi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_Z14checkCudaError10hipError_tPKc # TAILCALL
.Lfunc_end2:
	.size	_Z8runOnGPUiPfS_i, .Lfunc_end2-_Z8runOnGPUiPfS_i
	.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
	movl	$4096, %edi                     # imm = 0x1000
	callq	_Znam
	movq	%rax, %rbx
	movl	$8, %edi
	callq	_Znam
	movq	%rax, %r14
	xorl	%eax, %eax
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	movl	$1065353216, (%rbx,%rax,4)      # imm = 0x3F800000
	incq	%rax
	cmpq	$1024, %rax                     # imm = 0x400
	jne	.LBB3_1
# %bb.2:                                # %.preheader53.preheader
	movq	$0, (%r14)
	movb	$1, %bpl
	xorl	%r15d, %r15d
.LBB3_3:                                # =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	callq	hipSetDevice
	leaq	(%rsp,%r15,8), %r13
	addq	$32, %r13
	movl	$2048, %esi                     # imm = 0x800
	movq	%r13, %rdi
	callq	hipMalloc
	movl	$.L.str.5, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	leaq	(%rsp,%r15,8), %r12
	addq	$16, %r12
	movl	$4, %esi
	movq	%r12, %rdi
	callq	hipMalloc
	movl	$.L.str.6, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	movq	(%r13), %rdi
	movq	%r15, %rsi
	shlq	$11, %rsi
	addq	%rbx, %rsi
	movl	$2048, %edx                     # imm = 0x800
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$.L.str.7, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	movq	(%r12), %rdi
	leaq	(%r14,%r15,4), %rsi
	movl	$4, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$.L.str.8, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	movl	$1, %r15d
	testb	$1, %bpl
	movl	$0, %ebp
	jne	.LBB3_3
# %bb.4:                                # %.critedge
	callq	hipDeviceSynchronize
	movq	32(%rsp), %rsi
	movq	16(%rsp), %rdx
	xorl	%edi, %edi
	movl	$512, %ecx                      # imm = 0x200
	callq	_Z8runOnGPUiPfS_i
	movq	40(%rsp), %rsi
	movq	24(%rsp), %rdx
	movl	$1, %edi
	movl	$512, %ecx                      # imm = 0x200
	callq	_Z8runOnGPUiPfS_i
	callq	hipDeviceSynchronize
	xorl	%edi, %edi
	callq	hipSetDevice
	movq	16(%rsp), %rsi
	movl	$4, %edx
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.L.str.9, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	movl	$1, %edi
	callq	hipSetDevice
	movq	%r14, %rdi
	addq	$4, %rdi
	movq	24(%rsp), %rsi
	movl	$4, %edx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.L.str.9, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	xorps	%xmm0, %xmm0
	addss	(%r14), %xmm0
	addss	4(%r14), %xmm0
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%edi, %edi
	callq	hipSetDevice
	movq	32(%rsp), %rdi
	callq	hipFree
	movl	$.L.str.11, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	movq	16(%rsp), %rdi
	callq	hipFree
	movl	$.L.str.12, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	movl	$1, %edi
	callq	hipSetDevice
	movq	40(%rsp), %rdi
	callq	hipFree
	movl	$.L.str.11, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	movq	24(%rsp), %rdi
	callq	hipFree
	movl	$.L.str.12, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
	movq	%rbx, %rdi
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_ZdaPv
	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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z25fluidStructureInteractionPfS_i, %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_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	_Z25fluidStructureInteractionPfS_i,@object # @_Z25fluidStructureInteractionPfS_i
	.section	.rodata,"a",@progbits
	.globl	_Z25fluidStructureInteractionPfS_i
	.p2align	3, 0x0
_Z25fluidStructureInteractionPfS_i:
	.quad	_Z40__device_stub__fluidStructureInteractionPfS_i
	.size	_Z25fluidStructureInteractionPfS_i, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"CUDA error: "
	.size	.L.str, 13

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

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Failed to set device"
	.size	.L.str.3, 21

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Kernel launch failed"
	.size	.L.str.4, 21

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Failed to allocate memory for boundary elements"
	.size	.L.str.5, 48

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Failed to allocate memory for forces"
	.size	.L.str.6, 37

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Failed to copy boundary elements to device"
	.size	.L.str.7, 43

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Failed to copy forces to device"
	.size	.L.str.8, 32

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Failed to copy forces from device"
	.size	.L.str.9, 34

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Total Force: "
	.size	.L.str.10, 14

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Failed to free boundary elements"
	.size	.L.str.11, 33

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Failed to free forces"
	.size	.L.str.12, 22

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z25fluidStructureInteractionPfS_i"
	.size	.L__unnamed_1, 35

	.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 _Z40__device_stub__fluidStructureInteractionPfS_i
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z25fluidStructureInteractionPfS_i
	.addrsig_sym _ZSt4cerr
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z25fluidStructureInteractionPfS_i ; -- Begin function _Z25fluidStructureInteractionPfS_i
	.globl	_Z25fluidStructureInteractionPfS_i
	.p2align	8
	.type	_Z25fluidStructureInteractionPfS_i,@function
_Z25fluidStructureInteractionPfS_i:     ; @_Z25fluidStructureInteractionPfS_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s8, s[0:1], 0x24
	s_load_b32 s16, s[0:1], 0x10
	v_and_b32_e32 v2, 0x3ff, v0
	s_add_u32 s4, s0, 24
	s_addc_u32 s5, s1, 0
	s_mov_b32 s2, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s9, s8, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[3:4], null, s13, s9, v[2:3]
	v_cmpx_gt_i32_e64 s16, v3
	s_cbranch_execz .LBB0_35
; %bb.1:                                ; %.preheader78
	s_clause 0x1
	s_load_b32 s10, s[0:1], 0x28
	s_load_b64 s[6:7], s[4:5], 0x0
	s_load_b128 s[0:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s11, s10, 0xffff
	s_cmp_lt_u32 s13, s6
	s_load_b32 s10, s[4:5], 0x8
	s_cselect_b32 s12, 12, 18
	s_cmp_lt_i32 s16, 1
	v_mov_b32_e32 v1, s12
	global_load_u16 v1, v1, s[4:5]
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s12, v1
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph
	v_ashrrev_i32_e32 v4, 31, v3
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	v_add_co_u32 v3, vcc_lo, s0, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s1, v4, vcc_lo
	global_load_b32 v3, v[3:4], off
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	s_load_b32 s17, s[0:1], 0x0
	s_add_i32 s16, s16, -1
	s_add_u32 s0, s0, 4
	s_addc_u32 s1, s1, 0
	s_cmp_eq_u32 s16, 0
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fmac_f32_e32 v1, s17, v3
	s_cbranch_scc0 .LBB0_3
	s_branch .LBB0_5
.LBB0_4:
	v_mov_b32_e32 v1, 0
.LBB0_5:                                ; %._crit_edge
	v_lshlrev_b32_e32 v3, 2, v2
	s_cmp_lt_u32 s9, 2
	ds_store_b32 v3, v1
	s_waitcnt lgkmcnt(0)
	s_barrier
.LBB0_6:                                ; %._crit_edge
                                        ; =>This Inner Loop Header: Depth=1
	buffer_gl0_inv
	s_cbranch_scc1 .LBB0_10
; %bb.7:                                ; %.lr.ph85
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_lshr_b32 s0, s9, 1
	s_mov_b32 s1, exec_lo
	v_cmpx_gt_u32_e64 s0, v2
	s_cbranch_execz .LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	v_lshl_add_u32 v1, s0, 2, v3
	ds_load_b32 v1, v1
	ds_load_b32 v4, v3
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v1, v1, v4
	ds_store_b32 v3, v1
.LBB0_9:                                ;   in Loop: Header=BB0_6 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_cmp_lt_u32 s9, 4
	s_mov_b32 s9, s0
	s_branch .LBB0_6
.LBB0_10:                               ; %._crit_edge86
	v_mov_b32_e32 v3, 0
	s_and_b32 s11, s11, 0xffff
	s_lshr_b32 s1, s8, 16
	s_mul_i32 s0, s10, s11
	v_or_b32_e32 v1, s13, v2
	ds_load_b32 v4, v3
	s_mul_i32 s8, s0, s7
	s_and_b32 s0, 0xffff, s12
	s_mul_i32 s8, s8, s1
	v_cmp_eq_u32_e32 vcc_lo, 0, v1
	s_mul_i32 s8, s8, s6
	s_mov_b32 s9, 0
	s_mul_i32 s8, s8, s0
	s_waitcnt lgkmcnt(0)
	s_cmp_lg_u32 s8, 0
	s_barrier
	s_cselect_b32 s10, -1, 0
	buffer_gl0_inv
	s_and_b32 s10, vcc_lo, s10
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 exec_lo, exec_lo, s10
	s_cbranch_execz .LBB0_35
; %bb.11:                               ; %.lr.ph89
	s_mul_i32 s7, s7, s15
	v_bfe_u32 v1, v0, 20, 10
	s_add_i32 s7, s7, s14
	v_bfe_u32 v0, v0, 10, 10
	s_mul_i32 s6, s7, s6
	v_cmp_eq_u32_e32 vcc_lo, 0, v2
	s_add_i32 s6, s6, s13
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[5:6], null, s6, s11, v[1:2]
	v_mad_u64_u32 v[6:7], null, v5, s1, v[0:1]
	v_or3_b32 v5, v2, v0, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, v6, s0, v[2:3]
	v_cmp_eq_u32_e64 s0, 0, v5
	v_mov_b32_e32 v1, 0
.LBB0_12:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
                                        ;     Child Loop BB0_29 Depth 2
	buffer_gl1_inv
	buffer_gl0_inv
	s_barrier
	s_and_saveexec_b32 s10, s0
	s_cbranch_execz .LBB0_22
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	s_load_b64 s[6:7], s[4:5], 0x58
	s_mov_b32 s11, exec_lo
                                        ; implicit-def: $vgpr6
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mbcnt_lo_u32_b32 v5, s11, 0
	v_cmp_eq_u32_e64 s1, 0, v5
	s_waitcnt lgkmcnt(0)
	global_load_b32 v2, v3, s[6:7] offset:40
	s_and_saveexec_b32 s12, s1
	s_cbranch_execz .LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	s_bcnt1_i32_b32 s1, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v6, s1
	global_atomic_add_u32 v6, v3, v6, s[6:7] offset:32 glc
.LBB0_15:                               ;   in Loop: Header=BB0_12 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s1, v6
	v_add_nc_u32_e32 v7, -1, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v5, s1, v5
	v_and_b32_e32 v6, 0xffff, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ne_u32_e64 s1, v6, v7
	s_and_saveexec_b32 s11, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s11, exec_lo, s11
	s_cbranch_execz .LBB0_19
; %bb.16:                               ; %.preheader.i.i.i.i.preheader
                                        ;   in Loop: Header=BB0_12 Depth=1
	s_mov_b32 s12, 0
.LBB0_17:                               ; %.preheader.i.i.i.i
                                        ;   Parent Loop BB0_12 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_sleep 1
	global_load_b32 v2, v3, s[6:7] offset:32 glc
	s_waitcnt vmcnt(0)
	v_xor_b32_e32 v2, v2, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_u32_e64 s1, 0xffff, v2
	s_or_b32 s12, s1, s12
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s12
	s_cbranch_execnz .LBB0_17
; %bb.18:                               ; %Flow119
                                        ;   in Loop: Header=BB0_12 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
                                        ; implicit-def: $vgpr2
.LBB0_19:                               ; %Flow121
                                        ;   in Loop: Header=BB0_12 Depth=1
	s_and_not1_saveexec_b32 s1, s11
	s_cbranch_execz .LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_12 Depth=1
	s_mov_b32 s11, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mbcnt_lo_u32_b32 v5, s11, 0
	v_cmp_eq_u32_e64 s1, 0, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, exec_lo, s1
	s_mov_b32 exec_lo, s1
	s_cbranch_execz .LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_12 Depth=1
	v_sub_nc_u32_e32 v2, 0x10000, v2
	s_bcnt1_i32_b32 s1, s11
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mul_lo_u32 v2, v2, s1
	global_atomic_add_u32 v3, v2, s[6:7] offset:32
.LBB0_22:                               ; %Flow123
                                        ;   in Loop: Header=BB0_12 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	v_cmp_eq_u32_e64 s1, s9, v0
	s_waitcnt_vscnt null, 0x0
	s_barrier
	s_delay_alu instid0(VALU_DEP_1)
	v_cndmask_b32_e64 v1, v1, v4, s1
	s_and_saveexec_b32 s1, vcc_lo
	s_cbranch_execz .LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_12 Depth=1
	global_load_b32 v2, v3, s[2:3]
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v2, v1, v2
	global_store_b32 v3, v2, s[2:3]
.LBB0_24:                               ;   in Loop: Header=BB0_12 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt_vscnt null, 0x0
	buffer_gl1_inv
	buffer_gl0_inv
	s_barrier
	s_and_saveexec_b32 s10, s0
	s_cbranch_execz .LBB0_34
; %bb.25:                               ;   in Loop: Header=BB0_12 Depth=1
	s_load_b64 s[6:7], s[4:5], 0x58
	s_mov_b32 s11, exec_lo
                                        ; implicit-def: $vgpr6
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mbcnt_lo_u32_b32 v5, s11, 0
	v_cmp_eq_u32_e64 s1, 0, v5
	s_waitcnt lgkmcnt(0)
	global_load_b32 v2, v3, s[6:7] offset:40
	s_and_saveexec_b32 s12, s1
	s_cbranch_execz .LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_12 Depth=1
	s_bcnt1_i32_b32 s1, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v6, s1
	global_atomic_add_u32 v6, v3, v6, s[6:7] offset:32 glc
.LBB0_27:                               ;   in Loop: Header=BB0_12 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s1, v6
	v_add_nc_u32_e32 v7, -1, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v5, s1, v5
	v_and_b32_e32 v6, 0xffff, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ne_u32_e64 s1, v6, v7
	s_and_saveexec_b32 s11, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s11, exec_lo, s11
	s_cbranch_execz .LBB0_31
; %bb.28:                               ; %.preheader.i.i.i.i63.preheader
                                        ;   in Loop: Header=BB0_12 Depth=1
	s_mov_b32 s12, 0
.LBB0_29:                               ; %.preheader.i.i.i.i63
                                        ;   Parent Loop BB0_12 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_sleep 1
	global_load_b32 v2, v3, s[6:7] offset:32 glc
	s_waitcnt vmcnt(0)
	v_xor_b32_e32 v2, v2, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_u32_e64 s1, 0xffff, v2
	s_or_b32 s12, s1, s12
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s12
	s_cbranch_execnz .LBB0_29
; %bb.30:                               ; %Flow
                                        ;   in Loop: Header=BB0_12 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
                                        ; implicit-def: $vgpr2
.LBB0_31:                               ; %Flow116
                                        ;   in Loop: Header=BB0_12 Depth=1
	s_and_not1_saveexec_b32 s1, s11
	s_cbranch_execz .LBB0_34
; %bb.32:                               ;   in Loop: Header=BB0_12 Depth=1
	s_mov_b32 s11, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mbcnt_lo_u32_b32 v5, s11, 0
	v_cmp_eq_u32_e64 s1, 0, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, exec_lo, s1
	s_mov_b32 exec_lo, s1
	s_cbranch_execz .LBB0_34
; %bb.33:                               ;   in Loop: Header=BB0_12 Depth=1
	v_sub_nc_u32_e32 v2, 0x10000, v2
	s_bcnt1_i32_b32 s1, s11
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mul_lo_u32 v2, v2, s1
	global_atomic_add_u32 v3, v2, s[6:7] offset:32
.LBB0_34:                               ; %Flow118
                                        ;   in Loop: Header=BB0_12 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	s_add_i32 s9, s9, 1
	s_waitcnt_vscnt null, 0x0
	s_barrier
	s_cmp_lg_u32 s9, s8
	s_cbranch_scc1 .LBB0_12
.LBB0_35:                               ; %.loopexit
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z25fluidStructureInteractionPfS_i
		.amdhsa_group_segment_fixed_size 1024
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 13
		.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 1
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 2
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 18
		.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	_Z25fluidStructureInteractionPfS_i, .Lfunc_end0-_Z25fluidStructureInteractionPfS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1260
; NumSgprs: 20
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 1024 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 20
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 13
; 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: 1
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 2
	.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:     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
      - .offset:         112
        .size:           8
        .value_kind:     hidden_multigrid_sync_arg
    .group_segment_fixed_size: 1024
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z25fluidStructureInteractionPfS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _Z25fluidStructureInteractionPfS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
