From 342d552ba73e660a3a7ee0c149843fbb8028e128 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Wed, 27 Apr 2022 04:45:39 +0000 Subject: [PATCH] SWDEV-333848 - Regression fix Change-Id: I328770d5c51418c7f5bcb73696c81311d8dc3aef [ROCm/clr commit: 118fad741a39645866c24574e9267a61e6a9c83b] --- projects/clr/hipamd/src/hip_event.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/projects/clr/hipamd/src/hip_event.cpp b/projects/clr/hipamd/src/hip_event.cpp index 9cc944f7f6..b157e88350 100644 --- a/projects/clr/hipamd/src/hip_event.cpp +++ b/projects/clr/hipamd/src/hip_event.cpp @@ -71,11 +71,15 @@ hipError_t Event::synchronize() { // Check HW status of the ROCcrl event. Note: not all ROCclr modes support HW status static constexpr bool kWaitCompletion = true; if (!g_devices[deviceId()]->devices()[0]->IsHwEventReady(*event_, kWaitCompletion)) { - amd::Command* command = nullptr; - hipError_t status = recordCommand(command, event_->command().queue(), flags); - command->enqueue(); - g_devices[deviceId()]->devices()[0]->IsHwEventReady(command->event(), kWaitCompletion); - command->release(); + if (event_->HwEvent() != nullptr) { + amd::Command* command = nullptr; + hipError_t status = recordCommand(command, event_->command().queue(), flags); + command->enqueue(); + g_devices[deviceId()]->devices()[0]->IsHwEventReady(command->event(), kWaitCompletion); + command->release(); + } else { + event_->awaitCompletion(); + } } return hipSuccess;