diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/amd_gpu_agent.h b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/amd_gpu_agent.h index 18ef156c39..c1b26495c4 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/amd_gpu_agent.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/amd_gpu_agent.h @@ -332,8 +332,16 @@ class GpuAgent : public GpuAgentInt { static const uint32_t minAqlSize_ = 0x1000; // 4KB min static const uint32_t maxAqlSize_ = 0x20000; // 8MB max - // @brief Create a queue through HSA API to allow tools to intercept. - core::Queue* CreateInterceptibleQueue(); + // @brief Create an internal queue allowing tools to be notified. + core::Queue* CreateInterceptibleQueue() { + return CreateInterceptibleQueue(core::Queue::DefaultErrorHandler, nullptr); + } + + // @brief // @brief Create an internal queue, with a custom error handler, allowing tools to be + // notified. + core::Queue* CreateInterceptibleQueue(void (*callback)(hsa_status_t status, hsa_queue_t* source, + void* data), + void* data); // @brief Create SDMA blit object. // diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index fe757c2446..b7cad75df0 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -533,10 +533,12 @@ hsa_status_t GpuAgent::VisitRegion( return HSA_STATUS_SUCCESS; } -core::Queue* GpuAgent::CreateInterceptibleQueue() { +core::Queue* GpuAgent::CreateInterceptibleQueue(void (*callback)(hsa_status_t status, + hsa_queue_t* source, void* data), + void* data) { // Disabled intercept of internal queues pending tools updates. core::Queue* queue = nullptr; - QueueCreate(minAqlSize_, HSA_QUEUE_TYPE_MULTI, NULL, NULL, 0, 0, &queue); + QueueCreate(minAqlSize_, HSA_QUEUE_TYPE_MULTI, callback, data, 0, 0, &queue); if (queue != nullptr) core::Runtime::runtime_singleton_->InternalQueueCreateNotify(core::Queue::Convert(queue), this->public_handle()); diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/queue.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/queue.cpp index a86bbf8158..9a9bea819d 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/queue.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/queue.cpp @@ -54,6 +54,7 @@ void Queue::DefaultErrorHandler(hsa_status_t status, hsa_queue_t* source, void* const char* msg = "UNKNOWN ERROR"; HSA::hsa_status_string(status, &msg); fprintf(stderr, "Queue at %p inactivated due to async error:\n\t%s\n", source, msg); + abort(); } }