From f1adecd18640dd49e948a29842bcb88483b5267c Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Tue, 5 Mar 2024 20:44:27 +0000 Subject: [PATCH] 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 --- rocclr/device/devkernel.cpp | 4 ++-- rocclr/device/pal/palkernel.cpp | 3 +-- rocclr/device/pal/palvirtual.hpp | 2 +- rocclr/device/rocm/rocvirtual.cpp | 6 ++---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/rocclr/device/devkernel.cpp b/rocclr/device/devkernel.cpp index 84e6ab7e87..b536f8a4cd 100644 --- a/rocclr/device/devkernel.cpp +++ b/rocclr/device/devkernel.cpp @@ -1477,7 +1477,7 @@ void Kernel::InitPrintf(const std::vector& printfInfoStrings) { } while (end != std::string::npos); if (tokens.size() < 2) { - ClPrint(amd::LOG_WARNING, amd::LOG_KERN, "Invalid PrintInfo string: \"%s\"", str.c_str()); + LogPrintfError("Invalid PrintInfo string: \"%s\"", str.c_str()); continue; } @@ -1503,7 +1503,7 @@ void Kernel::InitPrintf(const std::vector& printfInfoStrings) { // ensure that we have the correct number of tokens if (tokens.size() < end + 1 /*last token is the fmtString*/) { - ClPrint(amd::LOG_WARNING, amd::LOG_KERN, "Invalid PrintInfo string: \"%s\"", str.c_str()); + LogPrintfError("Invalid PrintInfo string: \"%s\"", str.c_str()); continue; } diff --git a/rocclr/device/pal/palkernel.cpp b/rocclr/device/pal/palkernel.cpp index b0ad8cdc52..3b8240be2b 100644 --- a/rocclr/device/pal/palkernel.cpp +++ b/rocclr/device/pal/palkernel.cpp @@ -337,8 +337,7 @@ hsa_kernel_dispatch_packet_t* HSAILKernel::loadArguments( if (amd::IS_HIP) { uintptr_t buffer = reinterpret_cast(gpu.getOrCreateHostcallBuffer()); if (!buffer) { - ClPrint(amd::LOG_ERROR, amd::LOG_KERN, - "Kernel expects a hostcall buffer, but none found"); + LogError("Kernel expects a hostcall buffer, but none found"); } assert(it.size_ == sizeof(buffer) && "check the sizes"); WriteAqlArgAt(hidden_arguments, buffer, it.size_, it.offset_); diff --git a/rocclr/device/pal/palvirtual.hpp b/rocclr/device/pal/palvirtual.hpp index 61f472ed91..170753426a 100644 --- a/rocclr/device/pal/palvirtual.hpp +++ b/rocclr/device/pal/palvirtual.hpp @@ -714,7 +714,7 @@ inline void VirtualGPU::logVmMemory(const std::string name, const Memory* memory if (PAL_EMBED_KERNEL_MD) { iCmd()->CmdCommentString(buf); } - ClPrint(amd::LOG_INFO, amd::LOG_KERN, "%s", buf); + ClPrint(amd::LOG_INFO, amd::LOG_MEM, "%s", buf); } } diff --git a/rocclr/device/rocm/rocvirtual.cpp b/rocclr/device/rocm/rocvirtual.cpp index 7083dfbee1..6bcf44d213 100644 --- a/rocclr/device/rocm/rocvirtual.cpp +++ b/rocclr/device/rocm/rocvirtual.cpp @@ -3056,14 +3056,12 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, uintptr_t buffer = reinterpret_cast( roc_device_.getOrCreateHostcallBuffer(gpu_queue_, coopGroups, cuMask_)); if (!buffer) { - ClPrint(amd::LOG_ERROR, amd::LOG_KERN, - "Kernel expects a hostcall buffer, but none found"); + LogError("Kernel expects a hostcall buffer, but none found"); return false; } WriteAqlArgAt(hidden_arguments, buffer, it.size_, it.offset_); } else { - ClPrint(amd::LOG_ERROR, amd::LOG_KERN, - "Pcie atomics not enabled, hostcall not supported"); + LogError("Pcie atomics not enabled, hostcall not supported"); return false; } }