From a3c4aaf95ab63c6cb35e0ae253b10cc114d4fd84 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Fri, 28 Aug 2020 02:22:07 -0500 Subject: [PATCH] Correct return type error in hsa_amd_signal_wait_any. The error checking macro IS_OPEN returns an hsa_signal_t. This conflicts with the return type of uint32_t. Add an assert and rely on spurious return rule to return zero when rocr is not initialized. Change-Id: Ifc9bb75e22ecdd675273de59b31e5026a69c62e0 --- runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp b/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp index c1a3915fdc..d65d0dc0e2 100644 --- a/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp +++ b/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp @@ -475,7 +475,10 @@ uint32_t hsa_amd_signal_wait_any(uint32_t signal_count, hsa_signal_t* hsa_signal uint64_t timeout_hint, hsa_wait_state_t wait_hint, hsa_signal_value_t* satisfying_value) { TRY; - IS_OPEN(); + if (!core::Runtime::runtime_singleton_->IsOpen()) { + assert(false && "hsa_amd_signal_wait_any called while not initialized."); + return uint32_t(0); + } // Do not check for signal invalidation. Invalidation may occur during async // signal handler loop and is not an error. for (uint i = 0; i < signal_count; i++)