From 9535b7fcbe70c084e41017141c82787317bd9195 Mon Sep 17 00:00:00 2001 From: David Yat Sin <77975354+dayatsin-amd@users.noreply.github.com> Date: Fri, 14 Nov 2025 15:45:34 -0500 Subject: [PATCH] rocr: Fix exception on AsyncEventControl init (#1852) * rocr: Fix exception on AsyncEventControl init Fix exception on init when compiling with in release mode. * rocr: Fix crash when interrupts are disabled Fix segfault due to assert for signal->EopEvent() being false when HSA_ENABLE_INTERRUPT=0. Use Signal::WaitMultiple(..) when interrupt is disabled. --------- Co-authored-by: JeniferC99 <150404595+JeniferC99@users.noreply.github.com> --- .../rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index 78224e58ae..8e10b7be74 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -2326,7 +2326,7 @@ Runtime::AsyncEventsControl::AsyncEventsControl(AsyncEventsInfo *asyncInfo) if (err != HSA_STATUS_SUCCESS) throw AMD::hsa_exception(HSA_STATUS_ERROR, "Failed to allocate async handler signal"); - thread_ = os::CreateThread(AsyncEventsLoop, asyncInfo, 0, priority); + asyncInfo->control.thread_ = os::CreateThread(AsyncEventsLoop, asyncInfo, 0, priority); if (!asyncInfo->control.thread_) throw AMD::hsa_exception(HSA_STATUS_ERROR, "Failed to initialize async handler thread"); @@ -2389,7 +2389,7 @@ hsa_status_t Runtime::Load() { } asyncSignals_.reset(new AsyncEventsInfo(false)); - asyncExceptions_.reset(new AsyncEventsInfo(true)); + asyncExceptions_.reset(new AsyncEventsInfo(g_use_interrupt_wait)); // Setup system clock frequency for the first time. if (sys_clock_freq_ == 0) {