diff --git a/rocclr/device/rocm/rockernel.cpp b/rocclr/device/rocm/rockernel.cpp index 28fd20c42c..c0ac8ba975 100755 --- a/rocclr/device/rocm/rockernel.cpp +++ b/rocclr/device/rocm/rockernel.cpp @@ -76,8 +76,7 @@ bool LightningKernel::init() { } if (!SetAvailableSgprVgpr(targetIdent)) { - LogError(("[ROC][Kernel] Cannot set available SGPR/VGPR for target Ident" + targetIdent).c_str()); - LogError("\n"); + LogPrintfError("Cannot set available SGPR/VGPR for target Ident:%s \n", targetIdent.c_str()); return false; } @@ -89,16 +88,14 @@ bool LightningKernel::init() { symbolName().c_str(), &agent, &symbol); if (hsaStatus != HSA_STATUS_SUCCESS) { - LogError(("[ROC][Kernel] Cannot Get Symbol : " + symbolName()).c_str()); - LogError("\n"); + LogPrintfError("Cannot Get Symbol : %s \n",symbolName().c_str()); return false; } hsaStatus = hsa_executable_symbol_get_info(symbol, HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_OBJECT, &kernelCodeHandle_); if (hsaStatus != HSA_STATUS_SUCCESS) { - LogError(("[ROC][Kernel] Cannot Get Symbol Info : " + symbolName()).c_str()); - LogError("\n"); + LogPrintfError(" Cannot Get Symbol Info: %s \n ", symbolName().c_str()); return false; } @@ -116,8 +113,7 @@ bool LightningKernel::init() { RuntimeHandle().c_str(), &agent, &kernelSymbol); if (hsaStatus != HSA_STATUS_SUCCESS) { - LogError(("[ROC][Kernel] Cannot get Kernel Symbol by name" + RuntimeHandle()).c_str()); - LogError("\n"); + LogPrintfError("Cannot get Kernel Symbol by name: %s \n", RuntimeHandle().c_str()); return false; } @@ -154,7 +150,7 @@ bool LightningKernel::init() { uint32_t wavefront_size = 0; if (hsa_agent_get_info(program()->hsaDevice(), HSA_AGENT_INFO_WAVEFRONT_SIZE, &wavefront_size) != HSA_STATUS_SUCCESS) { - LogError("[ROC][Kernel] Cannot get Wavefront Size \n"); + LogError("[ROC][Kernel] Cannot get Wavefront Size \n"); return false; } assert(wavefront_size > 0); @@ -195,16 +191,14 @@ bool HSAILKernel::init() { errorCode = aclQueryInfo(compileHandle, program()->binaryElf(), RT_ARGUMENT_ARRAY, openClKernelName.c_str(), nullptr, &sizeOfArgList); if (errorCode != ACL_SUCCESS) { - LogError("[ROC][Kernel] Query Info failed with error code: " + itoa(errorCode)); - LogError("\n"); + LogPrintfError("Query Info failed with error code: %d \n", errorCode); return false; } std::unique_ptr argList(new char[sizeOfArgList]); errorCode = aclQueryInfo(compileHandle, program()->binaryElf(), RT_ARGUMENT_ARRAY, openClKernelName.c_str(), argList.get(), &sizeOfArgList); if (errorCode != ACL_SUCCESS) { - LogError("[ROC][Kernel] Query Info failed with error code: " + itoa(errorCode)); - LogError("\n"); + LogPrintfError("Query Info failed with error code: %d \n"errorCode); return false; } @@ -221,24 +215,21 @@ bool HSAILKernel::init() { errorCode = aclQueryInfo(compileHandle, program()->binaryElf(), RT_WORK_GROUP_SIZE, openClKernelName.c_str(), nullptr, &sizeOfWorkGroupSize); if (errorCode != ACL_SUCCESS) { - LogError("[ROC][Kernel] Query Info failed with error code: " + itoa(errorCode)); - LogError("\n"); + LogPrintfError("Query Info failed with error code: %d \n", errorCode); return false; } errorCode = aclQueryInfo(compileHandle, program()->binaryElf(), RT_WORK_GROUP_SIZE, openClKernelName.c_str(), workGroupInfo_.compileSize_, &sizeOfWorkGroupSize); if (errorCode != ACL_SUCCESS) { - LogError("[ROC][Kernel] Query Info failed with error code: " + itoa(errorCode)); - LogError("\n"); + LogPrintfError("Query Info failed with error code: %d \n ", errorCode); return false; } uint32_t wavefront_size = 0; if (HSA_STATUS_SUCCESS != hsa_agent_get_info(program()->hsaDevice(), HSA_AGENT_INFO_WAVEFRONT_SIZE, &wavefront_size)) { - LogError("[ROC][Kernel] Could not get Wave Info Size: " + itoa(errorCode)); - LogError("\n"); + LogPrintfError("Could not get Wave Info Size: %d \n", errorCode); return false; } assert(wavefront_size > 0); @@ -277,8 +268,7 @@ bool HSAILKernel::init() { errorCode = aclQueryInfo(compileHandle, program()->binaryElf(), RT_GPU_PRINTF_ARRAY, openClKernelName.c_str(), nullptr, &sizeOfPrintfList); if (errorCode != ACL_SUCCESS) { - LogError("[ROC][Kernel] Query Info failed with error code: " + itoa(errorCode)); - LogError("\n"); + LogPrintfError("Query Info failed with error code: %d \n", errorCode); return false; }