Skip to content

Commit f1adecd

Browse files
committed
SWDEV-301667 - Use right macros and level for logging
- Sometimes we want to mask out kernel names, use right level for kernel logging Change-Id: Ideae9647c57b86ae390ff2f4131f6d8c6df5c086
1 parent f5ca620 commit f1adecd

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

rocclr/device/devkernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ void Kernel::InitPrintf(const std::vector<std::string>& printfInfoStrings) {
14771477
} while (end != std::string::npos);
14781478

14791479
if (tokens.size() < 2) {
1480-
ClPrint(amd::LOG_WARNING, amd::LOG_KERN, "Invalid PrintInfo string: \"%s\"", str.c_str());
1480+
LogPrintfError("Invalid PrintInfo string: \"%s\"", str.c_str());
14811481
continue;
14821482
}
14831483

@@ -1503,7 +1503,7 @@ void Kernel::InitPrintf(const std::vector<std::string>& printfInfoStrings) {
15031503

15041504
// ensure that we have the correct number of tokens
15051505
if (tokens.size() < end + 1 /*last token is the fmtString*/) {
1506-
ClPrint(amd::LOG_WARNING, amd::LOG_KERN, "Invalid PrintInfo string: \"%s\"", str.c_str());
1506+
LogPrintfError("Invalid PrintInfo string: \"%s\"", str.c_str());
15071507
continue;
15081508
}
15091509

rocclr/device/pal/palkernel.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,7 @@ hsa_kernel_dispatch_packet_t* HSAILKernel::loadArguments(
337337
if (amd::IS_HIP) {
338338
uintptr_t buffer = reinterpret_cast<uintptr_t>(gpu.getOrCreateHostcallBuffer());
339339
if (!buffer) {
340-
ClPrint(amd::LOG_ERROR, amd::LOG_KERN,
341-
"Kernel expects a hostcall buffer, but none found");
340+
LogError("Kernel expects a hostcall buffer, but none found");
342341
}
343342
assert(it.size_ == sizeof(buffer) && "check the sizes");
344343
WriteAqlArgAt(hidden_arguments, buffer, it.size_, it.offset_);

rocclr/device/pal/palvirtual.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ inline void VirtualGPU::logVmMemory(const std::string name, const Memory* memory
714714
if (PAL_EMBED_KERNEL_MD) {
715715
iCmd()->CmdCommentString(buf);
716716
}
717-
ClPrint(amd::LOG_INFO, amd::LOG_KERN, "%s", buf);
717+
ClPrint(amd::LOG_INFO, amd::LOG_MEM, "%s", buf);
718718
}
719719
}
720720

rocclr/device/rocm/rocvirtual.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,14 +3056,12 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
30563056
uintptr_t buffer = reinterpret_cast<uintptr_t>(
30573057
roc_device_.getOrCreateHostcallBuffer(gpu_queue_, coopGroups, cuMask_));
30583058
if (!buffer) {
3059-
ClPrint(amd::LOG_ERROR, amd::LOG_KERN,
3060-
"Kernel expects a hostcall buffer, but none found");
3059+
LogError("Kernel expects a hostcall buffer, but none found");
30613060
return false;
30623061
}
30633062
WriteAqlArgAt(hidden_arguments, buffer, it.size_, it.offset_);
30643063
} else {
3065-
ClPrint(amd::LOG_ERROR, amd::LOG_KERN,
3066-
"Pcie atomics not enabled, hostcall not supported");
3064+
LogError("Pcie atomics not enabled, hostcall not supported");
30673065
return false;
30683066
}
30693067
}

0 commit comments

Comments
 (0)