[flang-commits] [flang] [flang][Lower] Rewrite present of device variable to deviceptr (PR #217164)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Tue Aug 18 17:01:39 PDT 2026


================
@@ -2888,12 +2859,28 @@ static Op createComputeOp(
     } else if (const auto *presentClause =
                    std::get_if<Fortran::parser::AccClause::Present>(
                        &clause.u)) {
+      // CUDA device variables (DataAttribute::Device) are always present on
+      // the device, no need for a present check - use deviceptr instead.
+      auto isCUDADevice = [](const Fortran::parser::AccObject &obj) {
+        return Fortran::semantics::IsCUDADevice(
+            getSymbolFromAccObject(obj).GetUltimate());
+      };
+      genDataOperandOperations<mlir::acc::DevicePtrOp>(
----------------
clementval wrote:

Could we just drop the clause in that case? 

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


More information about the flang-commits mailing list