From e2def5516471fc6e20cf281e4c02161fdfefec92 Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Fri, 3 Apr 2020 10:23:36 -0700 Subject: [PATCH] Wake up commandQueue before returning Change-Id: I87eb5a22c81a9cb807474a960b5987d5fb6c2b86 --- hipamd/vdi/hip_event.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hipamd/vdi/hip_event.cpp b/hipamd/vdi/hip_event.cpp index 677becd67e..6219f0c948 100644 --- a/hipamd/vdi/hip_event.cpp +++ b/hipamd/vdi/hip_event.cpp @@ -95,12 +95,20 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) { } hipError_t Event::streamWait(amd::HostQueue* hostQueue, uint flags) { - if ((event_ == nullptr) || (event_->command().queue() == hostQueue)) { + // Effective no-op if event is NULL + if (event_ == nullptr) { return hipSuccess; } amd::ScopedLock lock(lock_); - bool retain = false; + + if (event_->command().queue() == hostQueue) { + // Wake up commandQueue thread + if (!event_->notifyCmdQueue()) { + return hipErrorLaunchOutOfResources; + } + return hipSuccess; + } if (!event_->notifyCmdQueue()) { return hipErrorLaunchOutOfResources;