From 409c07e3d89b7bb69b4aaad0a717410ccb0e385a Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Mon, 3 Oct 2022 09:11:09 -0700 Subject: [PATCH] SWDEV-359548 - Enqueue marker if fence is dirty The marker would flush any caches. Change-Id: I5f990285fb3c3a3e8d5d0b2a2d5a9f1fdcea435c [ROCm/clr commit: da88091ba40ea3058ee0c011495c461666447e61] --- projects/clr/hipamd/src/hip_stream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_stream.cpp b/projects/clr/hipamd/src/hip_stream.cpp index e67e831dad..1896ae3c10 100644 --- a/projects/clr/hipamd/src/hip_stream.cpp +++ b/projects/clr/hipamd/src/hip_stream.cpp @@ -200,6 +200,7 @@ void Stream::destroyAllStreams(int deviceId) { // ================================================================================================ void iHipWaitActiveStreams(amd::HostQueue* blocking_queue, bool wait_null_stream) { amd::Command::EventWaitList eventWaitList(0); + bool submitMarker = 0; { amd::ScopedLock lock(streamSetLock); @@ -223,6 +224,7 @@ void iHipWaitActiveStreams(amd::HostQueue* blocking_queue, bool wait_null_stream if (!ready) { ready = (command->status() == CL_COMPLETE); } + submitMarker |= active_queue->vdev()->isFenceDirty(); // Check the current active status if (!ready) { command->notifyCmdQueue(); @@ -240,7 +242,7 @@ void iHipWaitActiveStreams(amd::HostQueue* blocking_queue, bool wait_null_stream } // Check if we have to wait anything - if (eventWaitList.size() > 0) { + if (eventWaitList.size() > 0 || submitMarker) { amd::Command* command = new amd::Marker(*blocking_queue, kMarkerDisableFlush, eventWaitList); if (command != nullptr) { command->enqueue();