[flang-commits] [flang] [flang][cuda] Allow list-directed PRINT and WRITE stmt in device code (PR #87415)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Apr 8 09:28:42 PDT 2024


================
@@ -275,9 +275,73 @@ template <bool IsCUFKernelDo> class DeviceContextChecker {
         },
         ec.u);
   }
+  template <typename SEEK, typename A>
+  static const SEEK *GetIOControl(const A &stmt) {
+    for (const auto &spec : stmt.controls) {
+      if (const auto *result{std::get_if<SEEK>(&spec.u)}) {
+        return result;
+      }
+    }
+    return static_cast<const SEEK *>(nullptr);
----------------
klausler wrote:

Can now just be `return nullptr;`

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


More information about the flang-commits mailing list