[llvm] [Offload] Update LIBOMPTARGET_INFO text for `attach` map-type. (PR #155509)
Abhinav Gaba via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 26 15:16:57 PDT 2025
https://github.com/abhinavgaba created https://github.com/llvm/llvm-project/pull/155509
Also improves one debug dump regarding pointer-attachment.
>From d1ce7860220242af1834ae83e485698528bad092 Mon Sep 17 00:00:00 2001
From: Abhinav Gaba <abhinav.gaba at intel.com>
Date: Tue, 26 Aug 2025 15:08:39 -0700
Subject: [PATCH] [Offload] Update LIBOMPTARGET_INFO text for "attach"
map-type.
Also improves one debug dump regarding pointer-attachment.
---
offload/libomptarget/omptarget.cpp | 6 ++++++
offload/libomptarget/private.h | 9 ++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/offload/libomptarget/omptarget.cpp b/offload/libomptarget/omptarget.cpp
index 32e89cc75efc9..4c8eba1e7180c 100644
--- a/offload/libomptarget/omptarget.cpp
+++ b/offload/libomptarget/omptarget.cpp
@@ -403,6 +403,12 @@ static int performPointerAttachment(DeviceTy &Device, AsyncInfoTy &AsyncInfo,
reinterpret_cast<uint64_t>(HstPteeBase);
void *TgtPteeBase = reinterpret_cast<void *>(
reinterpret_cast<uint64_t>(TgtPteeBegin) - Delta);
+ DP("HstPteeBase: " DPxMOD ", HstPteeBegin: " DPxMOD
+ ", Delta (HstPteeBegin - HstPteeBase): %" PRIu64 ".\n",
+ DPxPTR(HstPteeBase), DPxPTR(HstPteeBegin), Delta);
+ DP("TgtPteeBase (TgtPteeBegin - Delta): " DPxMOD ", TgtPteeBegin : " DPxMOD
+ "\n",
+ DPxPTR(TgtPteeBase), DPxPTR(TgtPteeBegin));
// Add shadow pointer tracking
// TODO: Support shadow-tracking of larger than VoidPtrSize pointers,
diff --git a/offload/libomptarget/private.h b/offload/libomptarget/private.h
index 0b3d545990484..90e5e1780e666 100644
--- a/offload/libomptarget/private.h
+++ b/offload/libomptarget/private.h
@@ -55,7 +55,14 @@ printKernelArguments(const ident_t *Loc, const int64_t DeviceId,
const char *Type = nullptr;
const char *Implicit =
(ArgTypes[I] & OMP_TGT_MAPTYPE_IMPLICIT) ? "(implicit)" : "";
- if (ArgTypes[I] & OMP_TGT_MAPTYPE_TO && ArgTypes[I] & OMP_TGT_MAPTYPE_FROM)
+
+ if (ArgTypes[I] & OMP_TGT_MAPTYPE_ATTACH &&
+ ArgTypes[I] & OMP_TGT_MAPTYPE_ALWAYS)
+ Type = "attach:always";
+ else if (ArgTypes[I] & OMP_TGT_MAPTYPE_ATTACH)
+ Type = "attach";
+ else if (ArgTypes[I] & OMP_TGT_MAPTYPE_TO &&
+ ArgTypes[I] & OMP_TGT_MAPTYPE_FROM)
Type = "tofrom";
else if (ArgTypes[I] & OMP_TGT_MAPTYPE_TO)
Type = "to";
More information about the llvm-commits
mailing list