From 596b496c16225ac7e9ef2abbd605e0a4fefe0e0d Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Thu, 28 Sep 2023 15:00:40 -0400 Subject: [PATCH] SWDEV-424249 - Check if HwEvent is available Allocate marker only if HW event doesn't exist for the last command. Change-Id: I3e7284202365a9c75313fb5403f0c1908ab51d1e --- rocclr/platform/commandqueue.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rocclr/platform/commandqueue.cpp b/rocclr/platform/commandqueue.cpp index 1dc91ad05f..b30b1873f4 100644 --- a/rocclr/platform/commandqueue.cpp +++ b/rocclr/platform/commandqueue.cpp @@ -121,7 +121,15 @@ void HostQueue::finish(bool cpu_wait) { return; } } - if (nullptr == command || command->type() != CL_COMMAND_MARKER || + // If command doesn't contain HW event and runtime didn't request CPU wait, + // then force marker submit + bool force_marker = false; + if (AMD_DIRECT_DISPATCH && (command != nullptr) && !cpu_wait) { + void* hw_event = + (command->NotifyEvent() != nullptr) ? command->NotifyEvent()->HwEvent() : command->HwEvent(); + force_marker = (hw_event == nullptr); + } + if (nullptr == command || force_marker || vdev()->isHandlerPending() || vdev()->isFenceDirty()) { if (nullptr != command) { command->release();