From 41d911d6370da9a29cb28af2c6b4c0cd079ea44d Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Thu, 29 Sep 2022 09:00:13 -0700 Subject: [PATCH] SWDEV-356482 - Improve logging Change-Id: I0c6286fcdb9d94398ed66262e95e8837898ff9fe [ROCm/clr commit: eef2f995134db3783075011730a9bcbb67464c67] --- projects/clr/rocclr/device/device.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/projects/clr/rocclr/device/device.cpp b/projects/clr/rocclr/device/device.cpp index 2394efb32d..afe8d64db8 100644 --- a/projects/clr/rocclr/device/device.cpp +++ b/projects/clr/rocclr/device/device.cpp @@ -396,6 +396,7 @@ bool Device::BlitProgram::create(amd::Device* device, const std::string& extraKe const std::string& extraOptions) { std::vector devices; devices.push_back(device); + int32_t retval = CL_SUCCESS; std::string kernels(device::BlitLinearSourceCode); std::string image_kernels(device::BlitImageSourceCode); @@ -410,6 +411,8 @@ bool Device::BlitProgram::create(amd::Device* device, const std::string& extraKe // Create a program with all blit kernels program_ = new Program(*context_, kernels.c_str(), Program::OpenCL_C); if (program_ == nullptr) { + DevLogPrintfError("Program creation for Kernel: %s failed\n", + kernels.c_str()); return false; } @@ -425,9 +428,10 @@ bool Device::BlitProgram::create(amd::Device* device, const std::string& extraKe if (!GPU_DUMP_BLIT_KERNELS) { opt += " -fno-enable-dump"; } - if (CL_SUCCESS != - program_->build(devices, opt.c_str(), nullptr, nullptr, GPU_DUMP_BLIT_KERNELS)) { - DevLogPrintfError("Build failed for Kernel: %s \n", kernels.c_str()); + if ((retval = program_->build(devices, opt.c_str(), nullptr, nullptr, GPU_DUMP_BLIT_KERNELS)) + != CL_SUCCESS) { + DevLogPrintfError("Build failed for Kernel: %s with error code %d\n", + kernels.c_str(), retval); return false; } if (!program_->load()) {