[flang-commits] [flang] [flang][cuda] Lower CUDA shared variable with cuf.shared_memory op (PR #131399)
Valentin Clement バレンタイン クレメン via flang-commits
flang-commits at lists.llvm.org
Sun Mar 16 09:27:36 PDT 2025
================
@@ -0,0 +1,11 @@
+! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s
+
+attributes(global) subroutine sharedmem()
+ real, shared :: s(32)
+ integer :: t
+ t = threadIdx%x
+ s(t) = t
+end subroutine
+
+! CHECK-LABEL: func.func @_QPsharedmem() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}
+! CHECK: %{{.*}} = cuf.shared_memory !fir.array<32xf32> {bindc_name = "s", uniq_name = "_QFsharedmemEs"} -> !fir.ref<!fir.array<32xf32>>
----------------
clementval wrote:
```suggestion
! CHECK: %{{.*}} = cuf.shared_memory !fir.array<32xf32> {bindc_name = "s", uniq_name = "_QFsharedmemEs"} -> !fir.ref<!fir.array<32xf32>>
! CHECK-NOT: cuf.free
```
https://github.com/llvm/llvm-project/pull/131399
More information about the flang-commits
mailing list