Skip to content

Commit

Permalink
[flang][runtime] Temporary fix for unresolved reference in CUDA F18 r…
Browse files Browse the repository at this point in the history
…untime. (#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.
  • Loading branch information
vzakhari committed Mar 14, 2024
1 parent b6193a2 commit c08d70a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flang/runtime/pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit c08d70a

Please sign in to comment.