Skip to content

Commit f44740a

Browse files
authored
[NFC][Offload] Fix minor debug print issues introduced in llvm#170425. (llvm#172377)
1 parent 89658f5 commit f44740a

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

offload/libomptarget/interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static inline int targetKernel(ident_t *Loc, int64_t DeviceId, int32_t NumTeams,
359359
ODBG_OS(ODT_Kernel, [&](llvm::raw_ostream &Os) {
360360
for (uint32_t I = 0; I < KernelArgs->NumArgs; ++I) {
361361
Os << "Entry " << llvm::format_decimal(I, 2)
362-
<< " Base=" << KernelArgs->ArgBasePtrs[I]
362+
<< ": Base=" << KernelArgs->ArgBasePtrs[I]
363363
<< ", Begin=" << KernelArgs->ArgPtrs[I]
364364
<< ", Size=" << KernelArgs->ArgSizes[I]
365365
<< ", Type=" << llvm::format_hex(KernelArgs->ArgTypes[I], 8)

offload/libomptarget/omptarget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,8 @@ int processAttachEntries(DeviceTy &Device, AttachInfoTy &AttachInfo,
776776
if (AttachInfo.AttachEntries.empty())
777777
return OFFLOAD_SUCCESS;
778778

779-
ODBG(ODT_Mapping) << "Processing " << AttachInfo.AttachEntries.size();
779+
ODBG(ODT_Mapping) << "Processing " << AttachInfo.AttachEntries.size()
780+
<< " deferred ATTACH map entries";
780781

781782
int Ret = OFFLOAD_SUCCESS;
782783
bool IsFirstPointerAttachment = true;

offload/test/offloading/struct_mapping_with_pointers.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,47 +37,47 @@ int main() {
3737
/// when mapping the struct happens after the mapping of the pointers.
3838

3939
// clang-format off
40-
// CHECK: omptarget --> Entry 0: Base=[[DAT_HST_PTR_BASE:0x.*]], Begin=[[DAT_HST_PTR_BASE]], Size=288, Type=0x0, Name=unknown
41-
// CHECK: omptarget --> Entry 1: Base=[[DAT_HST_PTR_BASE]], Begin=[[DAT_HST_PTR_BASE]], Size=288, Type=0x1000000000001, Name=unknown
42-
// CHECK: omptarget --> Entry 2: Base=[[DAT_HST_PTR_BASE]], Begin=[[DATUM_HST_PTR_BASE:0x.*]], Size=40, Type=0x1000000000011, Name=unknown
43-
// CHECK: omptarget --> Entry 3: Base=[[MORE_DATUM_HST_PTR_BASE:0x.*]], Begin=[[MORE_DATUM_HST_PTR_BEGIN:0x.*]], Size=80, Type=0x1000000000011, Name=unknown
40+
// CHECK: omptarget --> Entry 0: Base=0x{{0*}}[[DAT_HST_PTR_BASE:.*]], Begin=0x{{0*}}[[DAT_HST_PTR_BASE]], Size=288, Type=0x{{0*}}, Name=unknown
41+
// CHECK: omptarget --> Entry 1: Base=0x{{0*}}[[DAT_HST_PTR_BASE]], Begin=0x{{0*}}[[DAT_HST_PTR_BASE]], Size=288, Type=0x1000000000001, Name=unknown
42+
// CHECK: omptarget --> Entry 2: Base=0x{{0*}}[[DAT_HST_PTR_BASE]], Begin=0x{{0*}}[[DATUM_HST_PTR_BASE:.*]], Size=40, Type=0x1000000000011, Name=unknown
43+
// CHECK: omptarget --> Entry 3: Base=0x{{0*}}[[MORE_DATUM_HST_PTR_BASE:.*]], Begin=0x{{0*}}[[MORE_DATUM_HST_PTR_BEGIN:.*]], Size=80, Type=0x1000000000011, Name=unknown
4444
// clang-format on
4545

4646
/// The struct will be mapped in the same order as the above entries.
4747

4848
/// First argument is the struct itself and it will be mapped once.
4949

5050
// clang-format off
51-
// CHECK: omptarget --> Looking up mapping(HstPtrBegin=[[DAT_HST_PTR_BASE]], Size=288)...
52-
// CHECK: PluginInterface --> MemoryManagerTy::allocate: size 288 with host pointer [[DAT_HST_PTR_BASE]].
53-
// CHECK: omptarget --> Creating new map entry with HstPtrBase=[[DAT_HST_PTR_BASE]], HstPtrBegin=[[DAT_HST_PTR_BASE]], TgtAllocBegin=[[DAT_DEVICE_PTR_BASE:0x.*]], TgtPtrBegin=[[DAT_DEVICE_PTR_BASE]], Size=288, DynRefCount=1, HoldRefCount=0, Name=unknown
54-
// CHECK: omptarget --> Moving 288 bytes (hst:[[DAT_HST_PTR_BASE]]) -> (tgt:[[DAT_DEVICE_PTR_BASE]])
51+
// CHECK: omptarget --> Looking up mapping(HstPtrBegin=0x{{0*}}[[DAT_HST_PTR_BASE]], Size=288)...
52+
// CHECK: PluginInterface --> MemoryManagerTy::allocate: size 288 with host pointer 0x{{0*}}[[DAT_HST_PTR_BASE]].
53+
// CHECK: omptarget --> Creating new map entry with HstPtrBase=0x{{0*}}[[DAT_HST_PTR_BASE]], HstPtrBegin=0x{{0*}}[[DAT_HST_PTR_BASE]], TgtAllocBegin=0x{{0*}}[[DAT_DEVICE_PTR_BASE:.*]], TgtPtrBegin=0x{{0*}}[[DAT_DEVICE_PTR_BASE]], Size=288, DynRefCount=1, HoldRefCount=0, Name=unknown
54+
// CHECK: omptarget --> Moving 288 bytes (hst:0x{{0*}}[[DAT_HST_PTR_BASE]]) -> (tgt:0x{{0*}}[[DAT_DEVICE_PTR_BASE]])
5555
// clang-format on
5656

5757
/// Second argument is dat.datum:
5858
// clang-format off
59-
// CHECK: omptarget --> Looking up mapping(HstPtrBegin=[[DATUM_HST_PTR_BASE]], Size=40)...
60-
// CHECK: PluginInterface --> MemoryManagerTy::allocate: size 40 with host pointer [[DATUM_HST_PTR_BASE]].
61-
// CHECK: omptarget --> Creating new map entry with HstPtrBase=[[DATUM_HST_PTR_BASE]], HstPtrBegin=[[DATUM_HST_PTR_BASE]], TgtAllocBegin=[[DATUM_DEVICE_PTR_BASE:0x.*]], TgtPtrBegin=[[DATUM_DEVICE_PTR_BASE]], Size=40, DynRefCount=1, HoldRefCount=0, Name=unknown
62-
// CHECK: omptarget --> Moving 40 bytes (hst:[[DATUM_HST_PTR_BASE]]) -> (tgt:[[DATUM_DEVICE_PTR_BASE]])
59+
// CHECK: omptarget --> Looking up mapping(HstPtrBegin=0x{{0*}}[[DATUM_HST_PTR_BASE]], Size=40)...
60+
// CHECK: PluginInterface --> MemoryManagerTy::allocate: size 40 with host pointer 0x{{0*}}[[DATUM_HST_PTR_BASE]].
61+
// CHECK: omptarget --> Creating new map entry with HstPtrBase=0x{{0*}}[[DATUM_HST_PTR_BASE]], HstPtrBegin=0x{{0*}}[[DATUM_HST_PTR_BASE]], TgtAllocBegin=0x{{0*}}[[DATUM_DEVICE_PTR_BASE:.*]], TgtPtrBegin=0x{{0*}}[[DATUM_DEVICE_PTR_BASE]], Size=40, DynRefCount=1, HoldRefCount=0, Name=unknown
62+
// CHECK: omptarget --> Moving 40 bytes (hst:0x{{0*}}[[DATUM_HST_PTR_BASE]]) -> (tgt:0x{{0*}}[[DATUM_DEVICE_PTR_BASE]])
6363
// clang-format on
6464

6565
/// Third argument is dat.more_datum:
6666
// clang-format off
67-
// CHECK: omptarget --> Looking up mapping(HstPtrBegin=[[MORE_DATUM_HST_PTR_BEGIN]], Size=80)...
68-
// CHECK: PluginInterface --> MemoryManagerTy::allocate: size 80 with host pointer [[MORE_DATUM_HST_PTR_BEGIN]].
69-
// CHECK: omptarget --> Creating new map entry with HstPtrBase=[[MORE_DATUM_HST_PTR_BEGIN]], HstPtrBegin=[[MORE_DATUM_HST_PTR_BEGIN]], TgtAllocBegin=[[MORE_DATUM_DEVICE_PTR_BEGIN:0x.*]], TgtPtrBegin=[[MORE_DATUM_DEVICE_PTR_BEGIN]], Size=80, DynRefCount=1, HoldRefCount=0, Name=unknown
70-
// CHECK: omptarget --> Moving 80 bytes (hst:[[MORE_DATUM_HST_PTR_BEGIN]]) -> (tgt:[[MORE_DATUM_DEVICE_PTR_BEGIN]])
67+
// CHECK: omptarget --> Looking up mapping(HstPtrBegin=0x{{0*}}[[MORE_DATUM_HST_PTR_BEGIN]], Size=80)...
68+
// CHECK: PluginInterface --> MemoryManagerTy::allocate: size 80 with host pointer 0x{{0*}}[[MORE_DATUM_HST_PTR_BEGIN]].
69+
// CHECK: omptarget --> Creating new map entry with HstPtrBase=0x{{0*}}[[MORE_DATUM_HST_PTR_BEGIN]], HstPtrBegin=0x{{0*}}[[MORE_DATUM_HST_PTR_BEGIN]], TgtAllocBegin=0x{{0*}}[[MORE_DATUM_DEVICE_PTR_BEGIN:.*]], TgtPtrBegin=0x{{0*}}[[MORE_DATUM_DEVICE_PTR_BEGIN]], Size=80, DynRefCount=1, HoldRefCount=0, Name=unknown
70+
// CHECK: omptarget --> Moving 80 bytes (hst:0x{{0*}}[[MORE_DATUM_HST_PTR_BEGIN]]) -> (tgt:0x{{0*}}[[MORE_DATUM_DEVICE_PTR_BEGIN]])
7171
// clang-format on
7272

7373
#pragma omp target enter data map(to : dat.datum[ : 10]) \
7474
map(to : dat.more_datum[ : 20]) map(to : dat)
7575

7676
/// Checks induced by having a target region:
7777
// clang-format off
78-
// CHECK: omptarget --> Entry 0: Base=[[DAT_HST_PTR_BASE]], Begin=[[DAT_HST_PTR_BASE]], Size=288, Type=0x223, Name=unknown
79-
// CHECK: omptarget --> Mapping exists (implicit) with HstPtrBegin=[[DAT_HST_PTR_BASE]], TgtPtrBegin=[[DAT_DEVICE_PTR_BASE]], Size=288, DynRefCount=2 (incremented), HoldRefCount=0, Name=unknown
80-
// CHECK: omptarget --> Obtained target argument [[DAT_DEVICE_PTR_BASE]] from host pointer [[DAT_HST_PTR_BASE]]
78+
// CHECK: omptarget --> Entry 0: Base=0x{{0*}}[[DAT_HST_PTR_BASE]], Begin=0x{{0*}}[[DAT_HST_PTR_BASE]], Size=288, Type=0x{{0*}}223, Name=unknown
79+
// CHECK: omptarget --> Mapping exists (implicit) with HstPtrBegin=0x{{0*}}[[DAT_HST_PTR_BASE]], TgtPtrBegin=0x{{0*}}[[DAT_DEVICE_PTR_BASE]], Size=288, DynRefCount=2 (incremented), HoldRefCount=0, Name=unknown
80+
// CHECK: omptarget --> Obtained target argument 0x{{0*}}[[DAT_DEVICE_PTR_BASE]] from host pointer 0x{{0*}}[[DAT_HST_PTR_BASE]]
8181
// clang-format on
8282

8383
#pragma omp target
@@ -93,15 +93,15 @@ int main() {
9393

9494
/// Post-target region checks:
9595
// clang-format off
96-
// CHECK: omptarget --> Mapping exists with HstPtrBegin=[[DAT_HST_PTR_BASE]], TgtPtrBegin=[[DAT_DEVICE_PTR_BASE]], Size=288, DynRefCount=1 (decremented), HoldRefCount=0
96+
// CHECK: omptarget --> Mapping exists with HstPtrBegin=0x{{0*}}[[DAT_HST_PTR_BASE]], TgtPtrBegin=0x{{0*}}[[DAT_DEVICE_PTR_BASE]], Size=288, DynRefCount=1 (decremented), HoldRefCount=0
9797
// clang-format on
9898

9999
#pragma omp target exit data map(from : dat)
100100

101101
/// Target data end checks:
102102
// clang-format off
103-
// CHECK: omptarget --> Mapping exists with HstPtrBegin=[[DAT_HST_PTR_BASE]], TgtPtrBegin=[[DAT_DEVICE_PTR_BASE]], Size=288, DynRefCount=0 (decremented, delayed deletion), HoldRefCount=0
104-
// CHECK: omptarget --> Moving 288 bytes (tgt:[[DAT_DEVICE_PTR_BASE]]) -> (hst:[[DAT_HST_PTR_BASE]])
103+
// CHECK: omptarget --> Mapping exists with HstPtrBegin=0x{{0*}}[[DAT_HST_PTR_BASE]], TgtPtrBegin=0x{{0*}}[[DAT_DEVICE_PTR_BASE]], Size=288, DynRefCount=0 (decremented, delayed deletion), HoldRefCount=0
104+
// CHECK: omptarget --> Moving 288 bytes (tgt:0x{{0*}}[[DAT_DEVICE_PTR_BASE]]) -> (hst:0x{{0*}}[[DAT_HST_PTR_BASE]])
105105
// clang-format on
106106

107107
// CHECK: dat.xi = 4

0 commit comments

Comments
 (0)