From 56f280c8a7363fcecb82fd8ab7f7f6339bebb581 Mon Sep 17 00:00:00 2001 From: Jay Cornwall Date: Mon, 15 Apr 2019 19:11:49 -0500 Subject: [PATCH] Detect memory event through Flags field insetad of Failure KFD no longer reports MemoryAccessFault.Failure with retry fault implementation. ROCr ignores the memory event when Failure = 0. Use the Flags field instead, which will be non-zero when the event is triggered. Change-Id: Ie90799a303b0b2f1b476b20ffafdde79ae137182 --- runtime/hsa-runtime/core/runtime/signal.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/hsa-runtime/core/runtime/signal.cpp b/runtime/hsa-runtime/core/runtime/signal.cpp index f76d00404d..de943e2465 100644 --- a/runtime/hsa-runtime/core/runtime/signal.cpp +++ b/runtime/hsa-runtime/core/runtime/signal.cpp @@ -253,9 +253,7 @@ uint32_t Signal::WaitAny(uint32_t signal_count, const hsa_signal_t* hsa_signals, if (event_type == HSA_EVENTTYPE_MEMORY) { const HsaMemoryAccessFault& fault = signals[i]->EopEvent()->EventData.EventData.MemoryAccessFault; - const uint32_t* failure = - reinterpret_cast(&fault.Failure); - if (*failure != 0) { + if (fault.Flags == HSA_EVENTID_MEMORY_FATAL_PROCESS) { return i; } }