From 1d51406e8074eaeec11fec0fe6932d11feb4b55f Mon Sep 17 00:00:00 2001 From: zichguan-amd Date: Wed, 5 Mar 2025 15:30:38 -0500 Subject: [PATCH] Throw exception when runtime not initialized for hsa_amd_signal_wait_* Signed-off-by: zichguan-amd [ROCm/ROCR-Runtime commit: 3415a500c7d8ead43ed4a06d242e0516bba44adc] --- .../runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp index a7acbdcbec..4998605fd7 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp @@ -577,8 +577,7 @@ uint32_t hsa_amd_signal_wait_all(uint32_t signal_count, hsa_signal_t* hsa_signal hsa_signal_value_t* satisfying_values) { TRY; if (!core::Runtime::runtime_singleton_->IsOpen()) { - assert(false && "hsa_amd_signal_wait_all called while not initialized."); - return uint32_t(0); + throw AMD::hsa_exception(HSA_STATUS_ERROR_NOT_INITIALIZED, "hsa_amd_signal_wait_all called while not initialized"); } // Treat NULL and invalid signals as already satisfied their condition and skip them @@ -626,8 +625,7 @@ uint32_t hsa_amd_signal_wait_any(uint32_t signal_count, hsa_signal_t* hsa_signal hsa_signal_value_t* satisfying_value) { TRY; if (!core::Runtime::runtime_singleton_->IsOpen()) { - assert(false && "hsa_amd_signal_wait_any called while not initialized."); - return uint32_t(0); + throw AMD::hsa_exception(HSA_STATUS_ERROR_NOT_INITIALIZED, "hsa_amd_signal_wait_any called while not initialized"); } // Ignore NULL and invalid signals