[flang-commits] [flang] [flang][cuda] Implicitly load cudadevice module in device/global subprogram (PR #91668)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Thu May 9 15:04:15 PDT 2024


================
@@ -3797,6 +3797,17 @@ bool SubprogramVisitor::Pre(const parser::PrefixSpec::Attributes &attrs) {
         subp->set_cudaSubprogramAttrs(attr);
       }
     }
+    if (auto attrs{subp->cudaSubprogramAttrs()}) {
+      if (*attrs == common::CUDASubprogramAttrs::Global ||
+          *attrs == common::CUDASubprogramAttrs::Device) {
+        // Implicitly USE the cudadevice module by copying its symbol in the
+        // current scope.
----------------
klausler wrote:

s/symbol/symbols/

What about clashes with names that are already in scope (or declared later)?

https://github.com/llvm/llvm-project/pull/91668


More information about the flang-commits mailing list