Skip to content

Commit 890bc46

Browse files
authored
[Offload] Update LIBOMPTARGET_INFO text for attach map-type. (#155509)
Also adds two debug dumps regarding pointer-attachment.
1 parent 94738dd commit 890bc46

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

offload/libomptarget/omptarget.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ static int performPointerAttachment(DeviceTy &Device, AsyncInfoTy &AsyncInfo,
403403
reinterpret_cast<uint64_t>(HstPteeBase);
404404
void *TgtPteeBase = reinterpret_cast<void *>(
405405
reinterpret_cast<uint64_t>(TgtPteeBegin) - Delta);
406+
DP("HstPteeBase: " DPxMOD ", HstPteeBegin: " DPxMOD
407+
", Delta (HstPteeBegin - HstPteeBase): %" PRIu64 ".\n",
408+
DPxPTR(HstPteeBase), DPxPTR(HstPteeBegin), Delta);
409+
DP("TgtPteeBase (TgtPteeBegin - Delta): " DPxMOD ", TgtPteeBegin : " DPxMOD
410+
"\n",
411+
DPxPTR(TgtPteeBase), DPxPTR(TgtPteeBegin));
406412

407413
// Add shadow pointer tracking
408414
// TODO: Support shadow-tracking of larger than VoidPtrSize pointers,

offload/libomptarget/private.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ printKernelArguments(const ident_t *Loc, const int64_t DeviceId,
5555
const char *Type = nullptr;
5656
const char *Implicit =
5757
(ArgTypes[I] & OMP_TGT_MAPTYPE_IMPLICIT) ? "(implicit)" : "";
58-
if (ArgTypes[I] & OMP_TGT_MAPTYPE_TO && ArgTypes[I] & OMP_TGT_MAPTYPE_FROM)
58+
59+
if (ArgTypes[I] & OMP_TGT_MAPTYPE_ATTACH &&
60+
ArgTypes[I] & OMP_TGT_MAPTYPE_ALWAYS)
61+
Type = "attach:always";
62+
else if (ArgTypes[I] & OMP_TGT_MAPTYPE_ATTACH)
63+
Type = "attach";
64+
else if (ArgTypes[I] & OMP_TGT_MAPTYPE_TO &&
65+
ArgTypes[I] & OMP_TGT_MAPTYPE_FROM)
5966
Type = "tofrom";
6067
else if (ArgTypes[I] & OMP_TGT_MAPTYPE_TO)
6168
Type = "to";

0 commit comments

Comments
 (0)