brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 573e012 Raw
36 lines · plain
1! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s2 3! Test CUDA Fortran atmoicadd functions available cudadevice module4 5attributes(global) subroutine test_atomicaddvector_r2()6  real(2), device :: a(2), tmp1(2), tmp2(2)7  tmp1 = atomicAddVector(a, tmp2)8end subroutine9 10! CHECK-LABEL: func.func @_QPtest_atomicaddvector_r2() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}11! CHECK: llvm.atomicrmw fadd %{{.*}}, %{{.*}} seq_cst : !llvm.ptr, vector<2xf16>12 13attributes(global) subroutine test_atomicaddvector_r4()14  real(4), device :: a(2), tmp1(2), tmp2(2)15  tmp1 = atomicAddVector(a, tmp2)16end subroutine17 18! CHECK-LABEL: func.func @_QPtest_atomicaddvector_r4() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}19! CHECK: llvm.atomicrmw fadd %{{.*}}, %{{.*}} seq_cst : !llvm.ptr, vector<2xf32>20 21attributes(global) subroutine test_atomicadd_r2x4()22  real(4), device :: a(2), tmp1(2), tmp2(2)23  tmp1 = atomicaddreal4x2(a, tmp2)24end subroutine25 26! CHECK-LABEL: func.func @_QPtest_atomicadd_r2x4() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}27! CHECK: llvm.atomicrmw fadd %{{.*}}, %{{.*}} seq_cst : !llvm.ptr, vector<2xf32>28 29attributes(global) subroutine test_atomicadd_r4x4()30  real(4), device :: a(4), tmp1(4), tmp2(4)31  tmp1 = atomicaddreal4x4(a, tmp2)32end subroutine33 34! CHECK-LABEL: func.func @_QPtest_atomicadd_r4x4() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}35! CHECK: atom.add.v4.f3236