diff --git a/projects/clr/rocclr/device/rocm/roccounters.cpp b/projects/clr/rocclr/device/rocm/roccounters.cpp index 5f75a3c0af..c10ae9896e 100644 --- a/projects/clr/rocclr/device/rocm/roccounters.cpp +++ b/projects/clr/rocclr/device/rocm/roccounters.cpp @@ -536,6 +536,7 @@ bool PerfCounterProfile::initialize() { profile_.output_buffer = {nullptr, 0}; if (api_.hsa_ven_amd_aqlprofile_start(&profile_, nullptr) != HSA_STATUS_SUCCESS) { + LogError("Start hsa aql profile counter failed"); return false; } @@ -553,6 +554,7 @@ bool PerfCounterProfile::initialize() { profile_.command_buffer.ptr = buf_ptr; } else { + LogError("Failed to allocate profile counter command buffer"); return false; } } @@ -570,12 +572,14 @@ bool PerfCounterProfile::initialize() { } else { roc_device_.hostFree(profile_.command_buffer.ptr, profile_.command_buffer.size); + LogError("Failed to allocate profile counter output buffer"); return false; } } // create the completion signal if (hsa_signal_create(1, 0, nullptr, &completionSignal_) != HSA_STATUS_SUCCESS) { + LogError("Failed to create signal for profile counter"); return false; } diff --git a/projects/clr/rocclr/device/rocm/roccounters.hpp b/projects/clr/rocclr/device/rocm/roccounters.hpp index 45ebbe6632..494d3e07b6 100644 --- a/projects/clr/rocclr/device/rocm/roccounters.hpp +++ b/projects/clr/rocclr/device/rocm/roccounters.hpp @@ -119,14 +119,20 @@ class PerfCounterProfile : public amd::ReferenceCountedObject { hsa_agent_t agent = roc_device_.getBackendDevice(); bool system_support, agent_support; hsa_system_extension_supported(HSA_EXTENSION_AMD_AQLPROFILE, 1, 0, &system_support); + if (!system_support) { + LogError("HSA system does not support profile counter"); + return false; + } hsa_agent_extension_supported(HSA_EXTENSION_AMD_AQLPROFILE, agent, 1, 0, &agent_support); - if (!system_support || !agent_support) { + if (!agent_support) { + LogError ("HSA agent does not support profile counter"); return false; } if (hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_AQLPROFILE, hsa_ven_amd_aqlprofile_VERSION_MAJOR, sizeof(hsa_ven_amd_aqlprofile_pfn_t), &api_) != HSA_STATUS_SUCCESS) { + LogError ("Failed to obtain aql profile extension function table"); return false; }