Skip to content

Commit 4a6b196

Browse files
committed
debug build fixes
1 parent f04fef7 commit 4a6b196

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

offload/plugins-nextgen/level_zero/src/L0Memory.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace llvm::omp::target::plugin {
1818

19-
#if LIBOMPTARGET_DEBUG
19+
#if OMPTARGET_DEBUG
2020
static const char *AllocKindToStr(int32_t Kind) {
2121
switch (Kind) {
2222
case TARGET_ALLOC_DEVICE:
@@ -455,8 +455,9 @@ Error MemAllocatorTy::deinit() {
455455
}
456456
// Report memory usage if requested
457457
if (getDebugLevel() > 0) {
458-
for (auto &Stat : Stats) {
459-
DP("Memory usage for %s, device " DPxMOD "\n", AllocKindToStr(Stat.first),
458+
for (size_t Kind = 0; Kind < MaxMemKind; Kind++) {
459+
auto &Stat = Stats[Kind];
460+
DP("Memory usage for %s, device " DPxMOD "\n", AllocKindToStr(Kind),
460461
DPxPTR(Device));
461462
if (Stat.NumAllocs[0] == 0 && Stat.NumAllocs[1] == 0) {
462463
DP("-- Not used\n");

offload/plugins-nextgen/level_zero/src/L0Plugin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ Expected<int32_t> LevelZeroPluginTy::findDevices() {
9898
DP("List of devices (DeviceID[.SubID[.CCSID]])\n");
9999
for (auto &DeviceInfo : DetectedDevices) {
100100
(void)DeviceInfo; // to avoid unused variable warning in non-debug builds
101-
DP("-- Device %" PRIu32 "%s%s (zeDevice=%p) from Driver %p\n",
101+
DP("-- Device %" PRIu32 "%s%s (zeDevice=" PRIu64 ") from Driver %p\n",
102102
DeviceInfo.Id.RootId,
103103
(DeviceInfo.Id.SubId < 0
104104
? ""
105105
: ("." + std::to_string(DeviceInfo.Id.SubId)).c_str()),
106106
(DeviceInfo.Id.CCSId < 0
107107
? ""
108108
: ("." + std::to_string(DeviceInfo.Id.CCSId)).c_str()),
109-
DPxPTR(DeviceInfo.Id.zeId), DPxPTR(DeviceInfo.Id.Driver));
109+
DPxPTR(DeviceInfo.Id.zeId), DPxPTR(DeviceInfo.Driver));
110110
}
111111
return NumDevices;
112112
}

0 commit comments

Comments
 (0)