From 6a3d0e6412f61fb541bc5f291fc5d408128e508c Mon Sep 17 00:00:00 2001 From: Flora Cui Date: Wed, 28 Aug 2024 17:56:01 +0800 Subject: [PATCH] rocr: skip exception_signal_ handling on exit if .supports_exception_debugging is not enabled. Change-Id: I944fe7aa4f3068964f47e23f5259c3802d1e9556 Signed-off-by: Flora Cui [ROCm/ROCR-Runtime commit: ac64c54d7493b23672c2a5c2ef3a9f9b0027f25a] --- .../hsa-runtime/core/runtime/amd_aql_queue.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index 744d8bf072..82d2c71167 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp @@ -363,13 +363,15 @@ AqlQueue::~AqlQueue() { } // Remove kfd exception handler - exceptionState |= ERROR_HANDLER_TERMINATE; - while ((exceptionState & ERROR_HANDLER_DONE) != ERROR_HANDLER_DONE) { - const uint64_t timeout_ms = 5000; + if (core::Runtime::runtime_singleton_->KfdVersion().supports_exception_debugging) { + exceptionState |= ERROR_HANDLER_TERMINATE; + while ((exceptionState & ERROR_HANDLER_DONE) != ERROR_HANDLER_DONE) { + const uint64_t timeout_ms = 5000; - exception_signal_->StoreRelease(-1ull); - exception_signal_->WaitRelaxed(HSA_SIGNAL_CONDITION_NE, -1ull, timeout_ms, - HSA_WAIT_STATE_BLOCKED); + exception_signal_->StoreRelease(-1ull); + exception_signal_->WaitRelaxed(HSA_SIGNAL_CONDITION_NE, -1ull, timeout_ms, + HSA_WAIT_STATE_BLOCKED); + } } Inactivate();