[clang] [OpenMP][libomptarget] Add map checks when running under unified shared memory (PR #69005)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 13 13:23:55 PDT 2023


================
@@ -268,6 +268,23 @@ TargetPointerResultTy DeviceTy::getTargetPointer(
          LR.TPR.getEntry()->holdRefCountToStr().c_str(), HoldRefCountAction,
          (HstPtrName) ? getNameFromMapping(HstPtrName).c_str() : "unknown");
     LR.TPR.TargetPointer = (void *)Ptr;
+
+    if (PM->RTLs.RequiresFlags & OMP_REQ_UNIFIED_SHARED_MEMORY &&
+        !HasCloseModifier && !LR.TPR.Flags.IsHostPointer) {
+      // This is a host pointer and is not present if the pointers match:
+      if (LR.TPR.getEntry()->TgtPtrBegin == LR.TPR.getEntry()->HstPtrBegin) {
+        LR.TPR.Flags.IsPresent = false;
+        LR.TPR.Flags.IsHostPointer = true;
+      }
+
+      // Catch the case where incmoing HstPtrBegin is not consistent with the
----------------
carlobertolli wrote:

incmoing->incoming

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


More information about the cfe-commits mailing list