[flang-commits] [flang] [flang][runtime] Temporary fix for unresolved reference in CUDA F18 runtime. (PR #85294)
Slava Zakharin via flang-commits
flang-commits at lists.llvm.org
Thu Mar 14 11:44:24 PDT 2024
https://github.com/vzakhari created https://github.com/llvm/llvm-project/pull/85294
Avoid referencing executionEnvironment in the device code, since
environment.cpp is not part of the CUDA build yet.
This is a temporary fix before #85182 is merged.
>From 59ae6da0460b4f19faff7a59618c2546688fb25f Mon Sep 17 00:00:00 2001
From: Slava Zakharin <szakharin at nvidia.com>
Date: Thu, 14 Mar 2024 11:37:00 -0700
Subject: [PATCH] [flang][runtime] Temporary fix for unresolved reference in
CUDA F18 runtime.
Avoid referencing executionEnvironment in the device code, since
environment.cpp is not part of the CUDA build yet.
This is a temporary fix before #85182 is merged.
---
flang/runtime/pointer.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/flang/runtime/pointer.cpp b/flang/runtime/pointer.cpp
index 08a1223764f393..b01735dc30e691 100644
--- a/flang/runtime/pointer.cpp
+++ b/flang/runtime/pointer.cpp
@@ -185,6 +185,7 @@ int RTDEF(PointerDeallocate)(Descriptor &pointer, bool hasStat,
if (!pointer.IsAllocated()) {
return ReturnError(terminator, StatBaseNull, errMsg, hasStat);
}
+#if !defined(RT_DEVICE_COMPILATION)
if (executionEnvironment.checkPointerDeallocation) {
// Validate the footer. This should fail if the pointer doesn't
// span the entire object, or the object was not allocated as a
@@ -200,6 +201,7 @@ int RTDEF(PointerDeallocate)(Descriptor &pointer, bool hasStat,
terminator, StatBadPointerDeallocation, errMsg, hasStat);
}
}
+#endif
return ReturnError(terminator,
pointer.Destroy(/*finalize=*/true, /*destroyPointers=*/true, &terminator),
errMsg, hasStat);
More information about the flang-commits
mailing list