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

namespace cg = cooperative_groups;

// Constants
#define NUM_BOUNDARY_ELEMENTS 64
#define NUM_GPUS 2

// Kernel to simulate fluid-structure interaction
__global__ void fluidStructureInteraction(float* boundaryForces, float* boundaryPositions) {
    cg::grid_group grid = cg::this_grid();
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    // Ensure we do not access out of bounds
    if (idx < NUM_BOUNDARY_ELEMENTS) {
        // Simulate some basic interaction (e.g., simple force application)
        boundaryForces[idx] += boundaryPositions[idx] * 0.1f;

        // Synchronize to ensure all threads have updated forces
        cg::sync(grid);
    }
}

// Function to initialize boundary positions and forces
void initializeData(float* boundaryForces, float* boundaryPositions, int size) {
    for (int i = 0; i < size; ++i) {
        boundaryForces[i] = 0.0f;
        boundaryPositions[i] = static_cast<float>(i) / static_cast<float>(size);
    }
}

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

int main() {
    int numDevices;
    cudaGetDeviceCount(&numDevices);
    if (numDevices < NUM_GPUS) {
        std::cerr << "Not enough CUDA devices available." << std::endl;
        return EXIT_FAILURE;
    }

    // Allocate memory and initialize data on each GPU
    std::vector<float*> boundaryForces(NUM_GPUS);
    std::vector<float*> boundaryPositions(NUM_GPUS);
    std::vector<cudaStream_t> streams(NUM_GPUS);

    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        cudaSetDevice(gpu);
        cudaStreamCreate(&streams[gpu]);
        cudaMalloc(&boundaryForces[gpu], NUM_BOUNDARY_ELEMENTS * sizeof(float));
        cudaMalloc(&boundaryPositions[gpu], NUM_BOUNDARY_ELEMENTS * sizeof(float));
        initializeData(boundaryForces[gpu], boundaryPositions[gpu], NUM_BOUNDARY_ELEMENTS);
    }

    // Launch kernels on each GPU
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        cudaSetDevice(gpu);
        int blockSize = 32;
        int numBlocks = (NUM_BOUNDARY_ELEMENTS + blockSize - 1) / blockSize;
        fluidStructureInteraction<<<numBlocks, blockSize, 0, streams[gpu]>>>(boundaryForces[gpu], boundaryPositions[gpu]);
        checkCudaError(cudaGetLastError(), "Kernel launch failed");
    }

    // Synchronize all streams and copy results back to host
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        cudaSetDevice(gpu);
        cudaStreamSynchronize(streams[gpu]);
        float* h_boundaryForces = new float[NUM_BOUNDARY_ELEMENTS];
        cudaMemcpy(h_boundaryForces, boundaryForces[gpu], NUM_BOUNDARY_ELEMENTS * sizeof(float), cudaMemcpyDeviceToHost);
        checkCudaError(cudaGetLastError(), "Memcpy failed");

        // Print results (first 10 elements for brevity)
        std::cout << "GPU " << gpu << " results: ";
        for (int i = 0; i < 10; ++i) {
            std::cout << h_boundaryForces[i] << " ";
        }
        std::cout << std::endl;

        delete[] h_boundaryForces;
        cudaFree(boundaryForces[gpu]);
        cudaFree(boundaryPositions[gpu]);
        cudaStreamDestroy(streams[gpu]);
    }

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB7200:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE7200:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z14initializeDataPfS_i
	.type	_Z14initializeDataPfS_i, @function
_Z14initializeDataPfS_i:
.LFB7195:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L3:
	cmpl	%eax, %edx
	jle	.L6
	cvtsi2ssl	%eax, %xmm0
	movl	$0x00000000, (%rdi,%rax,4)
	cvtsi2ssl	%edx, %xmm1
	divss	%xmm1, %xmm0
	movss	%xmm0, (%rsi,%rax,4)
	incq	%rax
	jmp	.L3
.L6:
	ret
	.cfi_endproc
.LFE7195:
	.size	_Z14initializeDataPfS_i, .-_Z14initializeDataPfS_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"CUDA error: "
.LC2:
	.string	" ("
.LC3:
	.string	")"
	.text
	.globl	_Z14checkCudaError9cudaErrorPKc
	.type	_Z14checkCudaError9cudaErrorPKc, @function
_Z14checkCudaError9cudaErrorPKc:
.LFB7196:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L7
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	leaq	.LC1(%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	.LC2(%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	.LC3(%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
.L7:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE7196:
	.size	_Z14checkCudaError9cudaErrorPKc, .-_Z14checkCudaError9cudaErrorPKc
	.globl	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_
	.type	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_, @function
_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_:
.LFB7222:
	.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	.L12
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z25fluidStructureInteractionPfS_(%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
.L12:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE7222:
	.size	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_, .-_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_
	.globl	_Z25fluidStructureInteractionPfS_
	.type	_Z25fluidStructureInteractionPfS_, @function
_Z25fluidStructureInteractionPfS_:
.LFB7223:
	.cfi_startproc
	endbr64
	jmp	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_
	.cfi_endproc
.LFE7223:
	.size	_Z25fluidStructureInteractionPfS_, .-_Z25fluidStructureInteractionPfS_
	.section	.rodata.str1.1
.LC4:
	.string	"_Z25fluidStructureInteractionPfS_"
.LC5:
	.string	"_ZN50_INTERNAL_31655a89_19_cuda_code_015139_cu_c2f6819e4cuda3std3__419piecewise_constructE"
.LC6:
	.string	"_ZN50_INTERNAL_31655a89_19_cuda_code_015139_cu_c2f6819e4cuda3std6ranges3__45__cpo4swapE"
.LC7:
	.string	"_ZN50_INTERNAL_31655a89_19_cuda_code_015139_cu_c2f6819e4cuda3std6ranges3__45__cpo9iter_moveE"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB7225:
	.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	.LC4(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z25fluidStructureInteractionPfS_(%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	.LC5(%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	.LC6(%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	.LC7(%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
.LFE7225:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIPfSaIS0_EED2Ev,"axG",@progbits,_ZNSt6vectorIPfSaIS0_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIPfSaIS0_EED2Ev
	.type	_ZNSt6vectorIPfSaIS0_EED2Ev, @function
_ZNSt6vectorIPfSaIS0_EED2Ev:
.LFB7677:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L19
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L19:
	ret
	.cfi_endproc
.LFE7677:
	.size	_ZNSt6vectorIPfSaIS0_EED2Ev, .-_ZNSt6vectorIPfSaIS0_EED2Ev
	.weak	_ZNSt6vectorIPfSaIS0_EED1Ev
	.set	_ZNSt6vectorIPfSaIS0_EED1Ev,_ZNSt6vectorIPfSaIS0_EED2Ev
	.section	.text._ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev,"axG",@progbits,_ZNSt6vectorIP11CUstream_stSaIS1_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev
	.type	_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev, @function
_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev:
.LFB7689:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L21
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L21:
	ret
	.cfi_endproc
.LFE7689:
	.size	_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev, .-_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev
	.weak	_ZNSt6vectorIP11CUstream_stSaIS1_EED1Ev
	.set	_ZNSt6vectorIP11CUstream_stSaIS1_EED1Ev,_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev
	.section	.rodata.str1.1
.LC8:
	.string	"Not enough CUDA devices available."
.LC9:
	.string	"Kernel launch failed"
.LC10:
	.string	"Memcpy failed"
.LC11:
	.string	"GPU "
.LC12:
	.string	" results: "
.LC13:
	.string	" "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB7197:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA7197
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rdi
.LEHB0:
	call	cudaGetDeviceCount@PLT
	cmpl	$1, 20(%rsp)
	jg	.L24
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movl	$1, %eax
	jmp	.L23
.L24:
	movl	$16, %edi
	call	_Znwm@PLT
.LEHE0:
	xorl	%edi, %edi
	xorl	%r8d, %r8d
	movq	%rax, %rbx
	movq	%rax, 48(%rsp)
	leaq	16(%rax), %rax
	movq	%rdi, (%rbx)
	movq	%rdi, 8(%rbx)
	movl	$16, %edi
	movq	%rax, 64(%rsp)
	movq	%rax, 56(%rsp)
	movq	%r8, 80(%rsp)
	movq	%r8, 88(%rsp)
.LEHB1:
	call	_Znwm@PLT
.LEHE1:
	movq	%rax, %rbp
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	movq	%rax, 72(%rsp)
	movq	%rcx, 0(%rbp)
	leaq	16(%rax), %rax
	movl	$16, %edi
	movq	%rcx, 8(%rbp)
	movq	%rax, 88(%rsp)
	movq	%rax, 80(%rsp)
	movq	%rsi, 104(%rsp)
	movq	%rsi, 112(%rsp)
.LEHB2:
	call	_Znwm@PLT
.LEHE2:
	movq	%rax, %r12
	xorl	%edx, %edx
	movq	%rax, 96(%rsp)
	leaq	16(%rax), %rax
	movq	%rax, 112(%rsp)
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	movq	%rdx, (%r12)
	movq	%rdx, 8(%r12)
	movq	%rax, 104(%rsp)
.L26:
	movl	%r14d, %edi
.LEHB3:
	call	cudaSetDevice@PLT
	leaq	(%r12,%r13), %rdi
	call	cudaStreamCreate@PLT
	leaq	(%rbx,%r13), %rdi
	movl	$256, %esi
	call	cudaMalloc@PLT
	leaq	0(%rbp,%r13), %rdi
	movl	$256, %esi
	call	cudaMalloc@PLT
	movq	0(%rbp,%r13), %rsi
	movq	(%rbx,%r13), %rdi
	movl	$64, %edx
	addq	$8, %r13
	call	_Z14initializeDataPfS_i
	testl	%r14d, %r14d
	jne	.L48
	movl	$1, %r14d
	jmp	.L26
.L48:
	movabsq	$4294967328, %r13
	xorl	%r14d, %r14d
.L30:
	movl	%r14d, %edi
	call	cudaSetDevice@PLT
	movl	$2147483649, %edi
	movq	(%r12,%r14,8), %r9
	xorl	%r8d, %r8d
	movq	%r13, %rdx
	movl	$1, %ecx
	addq	%rdi, %rdi
	movl	$1, %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L27
.L29:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	leaq	.LC9(%rip), %rsi
	call	_Z14checkCudaError9cudaErrorPKc
	jmp	.L49
.L27:
	movq	0(%rbp,%r14,8), %rsi
	movq	(%rbx,%r14,8), %rdi
	call	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_
	jmp	.L29
.L49:
	testq	%r14, %r14
	jne	.L50
	movl	$1, %r14d
	jmp	.L30
.L50:
	xorl	%r13d, %r13d
.L32:
	movl	%r13d, %edi
	call	cudaSetDevice@PLT
	movq	(%r12,%r13,8), %rdi
	call	cudaStreamSynchronize@PLT
	movl	$256, %edi
	call	_Znam@PLT
	movq	(%rbx,%r13,8), %rsi
	movl	$2, %ecx
	movl	$256, %edx
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	cudaMemcpy@PLT
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	leaq	.LC10(%rip), %rsi
	call	_Z14checkCudaError9cudaErrorPKc
	leaq	.LC11(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r13d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%r15d, %r15d
.L31:
	movq	8(%rsp), %rax
	leaq	_ZSt4cout(%rip), %rdi
	cvtss2sd	(%rax,%r15,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	incq	%r15
	cmpq	$10, %r15
	jne	.L31
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movq	8(%rsp), %rdi
	call	_ZdaPv@PLT
	movq	(%rbx,%r13,8), %rdi
	call	cudaFree@PLT
	movq	0(%rbp,%r13,8), %rdi
	call	cudaFree@PLT
	movq	(%r12,%r13,8), %rdi
	call	cudaStreamDestroy@PLT
.LEHE3:
	testq	%r13, %r13
	jne	.L51
	movq	%r14, %r13
	jmp	.L32
.L51:
	leaq	96(%rsp), %rdi
	call	_ZNSt6vectorIP11CUstream_stSaIS1_EED1Ev
	leaq	72(%rsp), %rdi
	call	_ZNSt6vectorIPfSaIS0_EED1Ev
	leaq	48(%rsp), %rdi
	call	_ZNSt6vectorIPfSaIS0_EED1Ev
	xorl	%eax, %eax
	jmp	.L23
.L43:
	endbr64
	movq	%rax, %rbx
.L33:
	leaq	96(%rsp), %rdi
	call	_ZNSt6vectorIP11CUstream_stSaIS1_EED1Ev
	jmp	.L34
.L42:
	endbr64
	movq	%rax, %rbx
.L34:
	leaq	72(%rsp), %rdi
	call	_ZNSt6vectorIPfSaIS0_EED1Ev
	jmp	.L35
.L41:
	endbr64
	movq	%rax, %rbx
.L35:
	leaq	48(%rsp), %rdi
	call	_ZNSt6vectorIPfSaIS0_EED1Ev
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	movq	%rbx, %rdi
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L23:
	movq	120(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L37
.L47:
	call	__stack_chk_fail@PLT
.L37:
	addq	$136, %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
.LFE7197:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA7197:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE7197-.LLSDACSB7197
.LLSDACSB7197:
	.uleb128 .LEHB0-.LFB7197
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB7197
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L41-.LFB7197
	.uleb128 0
	.uleb128 .LEHB2-.LFB7197
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L42-.LFB7197
	.uleb128 0
	.uleb128 .LEHB3-.LFB7197
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L43-.LFB7197
	.uleb128 0
	.uleb128 .LEHB4-.LFB7197
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE7197:
	.section	.text.startup
	.size	main, .-main
	.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
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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 <vector>

namespace cg = cooperative_groups;

// Constants
#define NUM_BOUNDARY_ELEMENTS 64
#define NUM_GPUS 2

// Kernel to simulate fluid-structure interaction
__global__ void fluidStructureInteraction(float* boundaryForces, float* boundaryPositions) {
    cg::grid_group grid = cg::this_grid();
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    // Ensure we do not access out of bounds
    if (idx < NUM_BOUNDARY_ELEMENTS) {
        // Simulate some basic interaction (e.g., simple force application)
        boundaryForces[idx] += boundaryPositions[idx] * 0.1f;

        // Synchronize to ensure all threads have updated forces
        cg::sync(grid);
    }
}

// Function to initialize boundary positions and forces
void initializeData(float* boundaryForces, float* boundaryPositions, int size) {
    for (int i = 0; i < size; ++i) {
        boundaryForces[i] = 0.0f;
        boundaryPositions[i] = static_cast<float>(i) / static_cast<float>(size);
    }
}

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

int main() {
    int numDevices;
    hipGetDeviceCount(&numDevices);
    if (numDevices < NUM_GPUS) {
        std::cerr << "Not enough CUDA devices available." << std::endl;
        return EXIT_FAILURE;
    }

    // Allocate memory and initialize data on each GPU
    std::vector<float*> boundaryForces(NUM_GPUS);
    std::vector<float*> boundaryPositions(NUM_GPUS);
    std::vector<hipStream_t> streams(NUM_GPUS);

    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        hipSetDevice(gpu);
        hipStreamCreate(&streams[gpu]);
        hipMalloc(&boundaryForces[gpu], NUM_BOUNDARY_ELEMENTS * sizeof(float));
        hipMalloc(&boundaryPositions[gpu], NUM_BOUNDARY_ELEMENTS * sizeof(float));
        initializeData(boundaryForces[gpu], boundaryPositions[gpu], NUM_BOUNDARY_ELEMENTS);
    }

    // Launch kernels on each GPU
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        hipSetDevice(gpu);
        int blockSize = 32;
        int numBlocks = (NUM_BOUNDARY_ELEMENTS + blockSize - 1) / blockSize;
        fluidStructureInteraction<<<numBlocks, blockSize, 0, streams[gpu]>>>(boundaryForces[gpu], boundaryPositions[gpu]);
        checkCudaError(hipGetLastError(), "Kernel launch failed");
    }

    // Synchronize all streams and copy results back to host
    for (int gpu = 0; gpu < NUM_GPUS; ++gpu) {
        hipSetDevice(gpu);
        hipStreamSynchronize(streams[gpu]);
        float* h_boundaryForces = new float[NUM_BOUNDARY_ELEMENTS];
        hipMemcpy(h_boundaryForces, boundaryForces[gpu], NUM_BOUNDARY_ELEMENTS * sizeof(float), hipMemcpyDeviceToHost);
        checkCudaError(hipGetLastError(), "Memcpy failed");

        // Print results (first 10 elements for brevity)
        std::cout << "GPU " << gpu << " results: ";
        for (int i = 0; i < 10; ++i) {
            std::cout << h_boundaryForces[i] << " ";
        }
        std::cout << std::endl;

        delete[] h_boundaryForces;
        hipFree(boundaryForces[gpu]);
        hipFree(boundaryPositions[gpu]);
        hipStreamDestroy(streams[gpu]);
    }

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

                                        # End of file scope inline assembly
	.globl	_Z40__device_stub__fluidStructureInteractionPfS_ # -- Begin function _Z40__device_stub__fluidStructureInteractionPfS_
	.type	_Z40__device_stub__fluidStructureInteractionPfS_,@function
_Z40__device_stub__fluidStructureInteractionPfS_: # @_Z40__device_stub__fluidStructureInteractionPfS_
	.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	$_Z25fluidStructureInteractionPfS_, %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	_Z40__device_stub__fluidStructureInteractionPfS_, .Lfunc_end0-_Z40__device_stub__fluidStructureInteractionPfS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z14initializeDataPfS_i         # -- Begin function _Z14initializeDataPfS_i
	.type	_Z14initializeDataPfS_i,@function
_Z14initializeDataPfS_i:                # @_Z14initializeDataPfS_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB1_3
# %bb.1:                                # %.lr.ph
	cvtsi2ss	%edx, %xmm0
	movl	%edx, %eax
	xorl	%ecx, %ecx
.LBB1_2:                                # =>This Inner Loop Header: Depth=1
	movl	$0, (%rdi,%rcx,4)
	xorps	%xmm1, %xmm1
	cvtsi2ss	%ecx, %xmm1
	divss	%xmm0, %xmm1
	movss	%xmm1, (%rsi,%rcx,4)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB1_2
.LBB1_3:                                # %._crit_edge
	retq
.Lfunc_end1:
	.size	_Z14initializeDataPfS_i, .Lfunc_end1-_Z14initializeDataPfS_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	.LBB2_2
# %bb.1:
	retq
.LBB2_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_end2:
	.size	_Z14checkCudaError10hipError_tPKc, .Lfunc_end2-_Z14checkCudaError10hipError_tPKc
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI3_0:
	.long	0x3c800000                      # float 0.015625
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI3_1:
	.zero	16
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %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	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	20(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDeviceCount
	cmpl	$1, (%rbx)
	jg	.LBB3_2
# %bb.1:
	movl	$_ZSt4cerr, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.3, %esi
	movl	$34, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$1, %ebp
	jmp	.LBB3_42
.LBB3_2:
	movl	$16, %edi
	callq	_Znwm
	movq	%rax, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
.Ltmp0:
	movl	$16, %edi
	callq	_Znwm
.Ltmp1:
# %bb.3:
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
.Ltmp3:
	movl	$16, %edi
	callq	_Znwm
.Ltmp4:
# %bb.4:
	movq	%rax, %r15
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movb	$1, %bpl
	xorl	%r12d, %r12d
.LBB3_5:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_10 Depth 2
.Ltmp6:
	movl	%r12d, %edi
	callq	hipSetDevice
.Ltmp7:
# %bb.6:                                #   in Loop: Header=BB3_5 Depth=1
	leaq	(%r15,%r12,8), %rdi
.Ltmp8:
	callq	hipStreamCreate
.Ltmp9:
# %bb.7:                                #   in Loop: Header=BB3_5 Depth=1
	leaq	(%rbx,%r12,8), %r13
.Ltmp10:
	movl	$256, %esi                      # imm = 0x100
	movq	%r13, %rdi
	callq	hipMalloc
.Ltmp11:
# %bb.8:                                # %_ZL9hipMallocIfE10hipError_tPPT_m.exit
                                        #   in Loop: Header=BB3_5 Depth=1
	movq	8(%rsp), %rax                   # 8-byte Reload
	leaq	(%rax,%r12,8), %r12
.Ltmp12:
	movl	$256, %esi                      # imm = 0x100
	movq	%r12, %rdi
	callq	hipMalloc
.Ltmp13:
# %bb.9:                                # %_ZL9hipMallocIfE10hipError_tPPT_m.exit59
                                        #   in Loop: Header=BB3_5 Depth=1
	movq	(%r13), %rax
	movq	(%r12), %rcx
	xorl	%edx, %edx
	movss	.LCPI3_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
.LBB3_10:                               #   Parent Loop BB3_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$0, (%rax,%rdx,4)
	xorps	%xmm0, %xmm0
	cvtsi2ss	%edx, %xmm0
	mulss	%xmm1, %xmm0
	movss	%xmm0, (%rcx,%rdx,4)
	incq	%rdx
	cmpq	$64, %rdx
	jne	.LBB3_10
# %bb.11:                               # %_Z14initializeDataPfS_i.exit
                                        #   in Loop: Header=BB3_5 Depth=1
	movl	$1, %r12d
	testb	$1, %bpl
	movl	$0, %ebp
	jne	.LBB3_5
# %bb.12:                               # %.preheader102.preheader
	movb	$1, %r14b
	xorl	%ebp, %ebp
	movabsq	$4294967298, %r12               # imm = 0x100000002
	movabsq	$4294967328, %r13               # imm = 0x100000020
.LBB3_13:                               # %.preheader102
                                        # =>This Inner Loop Header: Depth=1
.Ltmp15:
	movl	%ebp, %edi
	callq	hipSetDevice
.Ltmp16:
# %bb.14:                               #   in Loop: Header=BB3_13 Depth=1
	movq	(%r15,%rbp,8), %r9
.Ltmp18:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
.Ltmp19:
# %bb.15:                               #   in Loop: Header=BB3_13 Depth=1
	testl	%eax, %eax
	jne	.LBB3_17
# %bb.16:                               #   in Loop: Header=BB3_13 Depth=1
	movq	(%rbx,%rbp,8), %rdi
	movq	8(%rsp), %rax                   # 8-byte Reload
	movq	(%rax,%rbp,8), %rsi
.Ltmp20:
	callq	_Z40__device_stub__fluidStructureInteractionPfS_
.Ltmp21:
.LBB3_17:                               #   in Loop: Header=BB3_13 Depth=1
.Ltmp22:
	callq	hipGetLastError
.Ltmp23:
# %bb.18:                               #   in Loop: Header=BB3_13 Depth=1
.Ltmp24:
	movl	$.L.str.4, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
.Ltmp25:
# %bb.19:                               #   in Loop: Header=BB3_13 Depth=1
	movl	$1, %ebp
	testb	$1, %r14b
	movl	$0, %r14d
	jne	.LBB3_13
# %bb.20:                               # %.preheader.preheader
	movb	$1, %r14b
	xorl	%r12d, %r12d
.LBB3_21:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_31 Depth 2
.Ltmp27:
	movl	%r12d, %edi
	callq	hipSetDevice
.Ltmp28:
# %bb.22:                               #   in Loop: Header=BB3_21 Depth=1
	movq	(%r15,%r12,8), %rdi
.Ltmp29:
	callq	hipStreamSynchronize
.Ltmp30:
# %bb.23:                               #   in Loop: Header=BB3_21 Depth=1
.Ltmp32:
	movl	$256, %edi                      # imm = 0x100
	callq	_Znam
.Ltmp33:
# %bb.24:                               #   in Loop: Header=BB3_21 Depth=1
	movq	%rax, %r13
	movq	(%rbx,%r12,8), %rsi
.Ltmp34:
	movl	$256, %edx                      # imm = 0x100
	movq	%rax, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp35:
# %bb.25:                               #   in Loop: Header=BB3_21 Depth=1
.Ltmp36:
	callq	hipGetLastError
.Ltmp37:
# %bb.26:                               #   in Loop: Header=BB3_21 Depth=1
.Ltmp38:
	movl	$.L.str.5, %esi
	movl	%eax, %edi
	callq	_Z14checkCudaError10hipError_tPKc
.Ltmp39:
# %bb.27:                               #   in Loop: Header=BB3_21 Depth=1
.Ltmp40:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$4, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp41:
# %bb.28:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
                                        #   in Loop: Header=BB3_21 Depth=1
.Ltmp42:
	movl	$_ZSt4cout, %edi
	movl	%r12d, %esi
	callq	_ZNSolsEi
.Ltmp43:
# %bb.29:                               #   in Loop: Header=BB3_21 Depth=1
.Ltmp44:
	movl	$.L.str.7, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp45:
# %bb.30:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit63.preheader.preheader
                                        #   in Loop: Header=BB3_21 Depth=1
	xorl	%ebp, %ebp
.LBB3_31:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit63.preheader
                                        #   Parent Loop BB3_21 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r13,%rbp,4), %xmm0
.Ltmp46:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp47:
# %bb.32:                               # %_ZNSolsEf.exit
                                        #   in Loop: Header=BB3_31 Depth=2
.Ltmp48:
	movl	$.L.str.8, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp49:
# %bb.33:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit64
                                        #   in Loop: Header=BB3_31 Depth=2
	incq	%rbp
	cmpq	$10, %rbp
	jne	.LBB3_31
# %bb.34:                               #   in Loop: Header=BB3_21 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
.Ltmp51:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp52:
# %bb.35:                               # %.noexc
                                        #   in Loop: Header=BB3_21 Depth=1
.Ltmp53:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp54:
# %bb.36:                               # %.noexc72
                                        #   in Loop: Header=BB3_21 Depth=1
.Ltmp55:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp56:
# %bb.37:                               # %_ZNSolsEPFRSoS_E.exit
                                        #   in Loop: Header=BB3_21 Depth=1
	movq	%r13, %rdi
	callq	_ZdaPv
	movq	(%rbx,%r12,8), %rdi
.Ltmp57:
	callq	hipFree
.Ltmp58:
# %bb.38:                               #   in Loop: Header=BB3_21 Depth=1
	movq	8(%rsp), %rax                   # 8-byte Reload
	movq	(%rax,%r12,8), %rdi
.Ltmp59:
	callq	hipFree
.Ltmp60:
# %bb.39:                               #   in Loop: Header=BB3_21 Depth=1
	movq	(%r15,%r12,8), %rdi
.Ltmp61:
	callq	hipStreamDestroy
.Ltmp62:
# %bb.40:                               #   in Loop: Header=BB3_21 Depth=1
	movl	$1, %r12d
	xorl	%ebp, %ebp
	testb	$1, %r14b
	movl	$0, %r14d
	jne	.LBB3_21
# %bb.41:                               # %_ZNSt6vectorIPfSaIS0_EED2Ev.exit62
	movq	%r15, %rdi
	callq	_ZdlPv
	movq	8(%rsp), %rdi                   # 8-byte Reload
	callq	_ZdlPv
	movq	%rbx, %rdi
	callq	_ZdlPv
.LBB3_42:
	movl	%ebp, %eax
	addq	$24, %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
.LBB3_44:
	.cfi_def_cfa_offset 80
.Ltmp5:
	movq	%rax, %r12
	jmp	.LBB3_52
.LBB3_43:
.Ltmp2:
	movq	%rax, %r12
	jmp	.LBB3_53
.LBB3_45:
.Ltmp17:
	jmp	.LBB3_51
.LBB3_47:
.Ltmp31:
	jmp	.LBB3_51
.LBB3_46:
.Ltmp26:
	jmp	.LBB3_51
.LBB3_50:
.Ltmp14:
	jmp	.LBB3_51
.LBB3_48:
.Ltmp63:
	jmp	.LBB3_51
.LBB3_49:
.Ltmp50:
.LBB3_51:                               # %_ZNSt6vectorIP12ihipStream_tSaIS1_EED2Ev.exit66
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_ZdlPv
.LBB3_52:                               # %_ZNSt6vectorIPfSaIS0_EED2Ev.exit68
	movq	8(%rsp), %rdi                   # 8-byte Reload
	callq	_ZdlPv
.LBB3_53:                               # %_ZNSt6vectorIPfSaIS0_EED2Ev.exit70
	movq	%rbx, %rdi
	callq	_ZdlPv
	movq	%r12, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp13-.Ltmp6                 #   Call between .Ltmp6 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin0          #     jumps to .Ltmp17
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp25-.Ltmp18                #   Call between .Ltmp18 and .Ltmp25
	.uleb128 .Ltmp26-.Lfunc_begin0          #     jumps to .Ltmp26
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp27-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp30-.Ltmp27                #   Call between .Ltmp27 and .Ltmp30
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp45-.Ltmp32                #   Call between .Ltmp32 and .Ltmp45
	.uleb128 .Ltmp63-.Lfunc_begin0          #     jumps to .Ltmp63
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp46-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp49-.Ltmp46                #   Call between .Ltmp46 and .Ltmp49
	.uleb128 .Ltmp50-.Lfunc_begin0          #     jumps to .Ltmp50
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp51-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp62-.Ltmp51                #   Call between .Ltmp51 and .Ltmp62
	.uleb128 .Ltmp63-.Lfunc_begin0          #     jumps to .Ltmp63
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp62-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Lfunc_end3-.Ltmp62            #   Call between .Ltmp62 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.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_, %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_,@object # @_Z25fluidStructureInteractionPfS_
	.section	.rodata,"a",@progbits
	.globl	_Z25fluidStructureInteractionPfS_
	.p2align	3, 0x0
_Z25fluidStructureInteractionPfS_:
	.quad	_Z40__device_stub__fluidStructureInteractionPfS_
	.size	_Z25fluidStructureInteractionPfS_, 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	"Not enough CUDA devices available."
	.size	.L.str.3, 35

	.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	"Memcpy failed"
	.size	.L.str.5, 14

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"GPU "
	.size	.L.str.6, 5

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	" results: "
	.size	.L.str.7, 11

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z25fluidStructureInteractionPfS_"
	.size	.L__unnamed_1, 34

	.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_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z25fluidStructureInteractionPfS_
	.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_ ; -- Begin function _Z25fluidStructureInteractionPfS_
	.globl	_Z25fluidStructureInteractionPfS_
	.p2align	8
	.type	_Z25fluidStructureInteractionPfS_,@function
_Z25fluidStructureInteractionPfS_:      ; @_Z25fluidStructureInteractionPfS_
; %bb.0:
	s_load_b32 s4, s[0:1], 0x1c
	v_and_b32_e32 v1, 0x3ff, v0
	s_add_u32 s2, s0, 16
	s_addc_u32 s3, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s15, s4, v[1:2]
	s_mov_b32 s4, exec_lo
	v_cmpx_gt_i32_e32 64, v2
	s_cbranch_execz .LBB0_12
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v3, 31, v2
	v_bfe_u32 v6, v0, 20, 10
	v_bfe_u32 v0, v0, 10, 10
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	v_or3_b32 v0, v0, v6, v1
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v4, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v3, vcc_lo
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	global_load_b32 v4, v[4:5], off
	global_load_b32 v5, v[2:3], off
	s_waitcnt vmcnt(0)
	v_fmamk_f32 v1, v4, 0x3dcccccd, v5
	global_store_b32 v[2:3], v1, off
	s_waitcnt_vscnt null, 0x0
	buffer_gl1_inv
	buffer_gl0_inv
	s_barrier
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_11
; %bb.2:
	s_load_b64 s[0:1], s[2:3], 0x58
	v_mov_b32_e32 v2, 0
	s_mov_b32 s4, exec_lo
	s_mov_b32 s2, exec_lo
	v_mbcnt_lo_u32_b32 v1, s4, 0
                                        ; implicit-def: $vgpr3
	s_waitcnt lgkmcnt(0)
	global_load_b32 v0, v2, s[0:1] offset:40
	v_cmpx_eq_u32_e32 0, v1
	s_cbranch_execz .LBB0_4
; %bb.3:
	s_bcnt1_i32_b32 s3, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v3, s3
	global_atomic_add_u32 v3, v2, v3, s[0:1] offset:32 glc
.LBB0_4:
	s_or_b32 exec_lo, exec_lo, s2
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s2, v3
	v_add_nc_u32_e32 v3, -1, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v1, s2, v1
	s_mov_b32 s2, exec_lo
	v_and_b32_e32 v2, 0xffff, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_ne_u32_e64 v2, v3
	s_xor_b32 s2, exec_lo, s2
	s_cbranch_execz .LBB0_8
; %bb.5:                                ; %.preheader.i.i.i.i.preheader
	v_mov_b32_e32 v0, 0
	s_mov_b32 s3, 0
.LBB0_6:                                ; %.preheader.i.i.i.i
                                        ; =>This Inner Loop Header: Depth=1
	s_sleep 1
	global_load_b32 v2, v0, s[0:1] offset:32 glc
	s_waitcnt vmcnt(0)
	v_xor_b32_e32 v2, v2, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_lt_u32_e32 vcc_lo, 0xffff, v2
	s_or_b32 s3, vcc_lo, s3
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB0_6
; %bb.7:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s3
                                        ; implicit-def: $vgpr0
.LBB0_8:                                ; %Flow18
	s_and_not1_saveexec_b32 s2, s2
	s_cbranch_execz .LBB0_11
; %bb.9:
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mbcnt_lo_u32_b32 v1, s2, 0
	v_cmp_eq_u32_e32 vcc_lo, 0, v1
	s_and_b32 s3, exec_lo, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_mov_b32 exec_lo, s3
	s_cbranch_execz .LBB0_11
; %bb.10:
	v_sub_nc_u32_e32 v0, 0x10000, v0
	s_bcnt1_i32_b32 s2, s2
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_mul_lo_u32 v0, v0, s2
	global_atomic_add_u32 v1, v0, s[0:1] offset:32
.LBB0_11:                               ; %_ZN18cooperative_groups4syncINS_10grid_groupEEEvRKT_.exit
	s_waitcnt_vscnt null, 0x0
	s_barrier
.LBB0_12:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z25fluidStructureInteractionPfS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.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 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 2
		.amdhsa_next_free_vgpr 7
		.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	_Z25fluidStructureInteractionPfS_, .Lfunc_end0-_Z25fluidStructureInteractionPfS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 484
; NumSgprs: 18
; NumVgprs: 7
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 7
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; 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:     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
      - .offset:         104
        .size:           8
        .value_kind:     hidden_multigrid_sync_arg
    .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:           _Z25fluidStructureInteractionPfS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z25fluidStructureInteractionPfS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     7
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
