diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/signal.h b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/signal.h index 5209fb7430..82ca6d193d 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/signal.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/signal.h @@ -198,8 +198,7 @@ class Signal { /// @brief Converts from public hsa_signal_t type (an opaque handle) to /// this interface class object. static __forceinline Signal* Convert(hsa_signal_t signal) { - if (signal.handle == 0) - throw AMD::hsa_exception(HSA_STATUS_ERROR_INVALID_ARGUMENT, "Signal handle is invalid."); + if (signal.handle == 0) throw AMD::hsa_exception(HSA_STATUS_ERROR_INVALID_ARGUMENT, ""); SharedSignal* shared = SharedSignal::Convert(signal); if (!shared->IsValid()) throw AMD::hsa_exception(HSA_STATUS_ERROR_INVALID_SIGNAL, "Signal handle is invalid."); 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 b4b5d49006..3e690ff35a 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 @@ -133,7 +133,9 @@ hsa_status_t handleException() { debug_print("HSA exception: BadAlloc\n"); return HSA_STATUS_ERROR_OUT_OF_RESOURCES; } catch (const hsa_exception& e) { - debug_print("HSA exception: %s\n", e.what()); + ifdebug { + if (!strIsEmpty(e.what())) debug_print("HSA exception: %s\n", e.what()); + } return e.error_code(); } catch (const std::exception& e) { debug_print("Unhandled exception: %s\n", e.what()); diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/util/utils.h b/projects/rocr-runtime/runtime/hsa-runtime/core/util/utils.h index a512c54f24..f7f09e9d7c 100755 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/util/utils.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/util/utils.h @@ -305,6 +305,8 @@ static __forceinline uint64_t NextPow2(uint64_t value) { return v + 1; } +static __forceinline bool strIsEmpty(const char* str) noexcept { return str[0] == '\0'; } + #include "atomic_helpers.h" #endif // HSA_RUNTIME_CORE_UTIL_UTIIS_H_