From 4a901f3dd3c2866f948f4e817ff10c2b5e5e48a7 Mon Sep 17 00:00:00 2001 From: Aryan Salmanpour Date: Mon, 6 Jul 2020 15:11:05 -0400 Subject: [PATCH] Always print error message with the returned error code before abort Change-Id: I8479abc586937a50c90b2785c4ce7364e6e9732b --- rocclr/device/rocm/rocdevice.cpp | 3 ++- rocclr/device/rocm/rocvirtual.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rocclr/device/rocm/rocdevice.cpp b/rocclr/device/rocm/rocdevice.cpp index cfcf095fdf..3a48de13d8 100644 --- a/rocclr/device/rocm/rocdevice.cpp +++ b/rocclr/device/rocm/rocdevice.cpp @@ -2198,7 +2198,8 @@ bool Device::SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeI static void callbackQueue(hsa_status_t status, hsa_queue_t* queue, void* data) { if (status != HSA_STATUS_SUCCESS && status != HSA_STATUS_INFO_BREAK) { // Abort on device exceptions. - DevLogPrintfError("Device::callbackQueue aborting with status: %d \n", status); + ClPrint(amd::LOG_NONE, amd::LOG_ALWAYS, "Device::callbackQueue aborting with status: 0x%x", + status); abort(); } } diff --git a/rocclr/device/rocm/rocvirtual.cpp b/rocclr/device/rocm/rocvirtual.cpp index 1eace34661..57cc07de43 100644 --- a/rocclr/device/rocm/rocvirtual.cpp +++ b/rocclr/device/rocm/rocvirtual.cpp @@ -1903,7 +1903,8 @@ void VirtualGPU::submitMigrateMemObjects(amd::MigrateMemObjectsCommand& vcmd) { static void callbackQueue(hsa_status_t status, hsa_queue_t* queue, void* data) { if (status != HSA_STATUS_SUCCESS && status != HSA_STATUS_INFO_BREAK) { // Abort on device exceptions. - DevLogPrintfError("VirtualGPU::callbackQueue aborting with status: %d \n", status); + ClPrint(amd::LOG_NONE, amd::LOG_ALWAYS, "VirtualGPU::callbackQueue aborting with status: 0x%x", + status); abort(); } }