Skip to content

Commit c08d70a

Browse files
authored
[flang][runtime] Temporary fix for unresolved reference in CUDA F18 runtime. (#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.
1 parent b6193a2 commit c08d70a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flang/runtime/pointer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ int RTDEF(PointerDeallocate)(Descriptor &pointer, bool hasStat,
185185
if (!pointer.IsAllocated()) {
186186
return ReturnError(terminator, StatBaseNull, errMsg, hasStat);
187187
}
188+
#if !defined(RT_DEVICE_COMPILATION)
188189
if (executionEnvironment.checkPointerDeallocation) {
189190
// Validate the footer. This should fail if the pointer doesn't
190191
// span the entire object, or the object was not allocated as a
@@ -200,6 +201,7 @@ int RTDEF(PointerDeallocate)(Descriptor &pointer, bool hasStat,
200201
terminator, StatBadPointerDeallocation, errMsg, hasStat);
201202
}
202203
}
204+
#endif
203205
return ReturnError(terminator,
204206
pointer.Destroy(/*finalize=*/true, /*destroyPointers=*/true, &terminator),
205207
errMsg, hasStat);

0 commit comments

Comments
 (0)