Suppress exception reporting for well defined invalid signal handles.
hsa_exceptions with empty what() strings will not report in debug builds.
Change-Id: I0d424d3b1d3044808ece1720a460a57d68bf878e
[ROCm/ROCR-Runtime commit: 344d964f9f]
Este commit está contenido en:
@@ -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.");
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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_
|
||||
|
||||
Referencia en una nueva incidencia
Block a user