From c49f1069ab3a67d278a2ed8bf70ea936380a8c28 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Tue, 15 Jun 2021 23:13:27 -0400 Subject: [PATCH] SWDEV-290160 - Don't send notification for batch markers Batch marker already has a barrier with HSA signal callback Change-Id: I69fc63d72320c2e9cc2d2e59ebd3f07c0bd0e3b5 --- rocclr/device/rocm/rocvirtual.cpp | 3 ++- rocclr/platform/command.cpp | 12 +++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/rocclr/device/rocm/rocvirtual.cpp b/rocclr/device/rocm/rocvirtual.cpp index 2a832d26e4..5f2659c76a 100644 --- a/rocclr/device/rocm/rocvirtual.cpp +++ b/rocclr/device/rocm/rocvirtual.cpp @@ -1239,7 +1239,8 @@ void VirtualGPU::profilingEnd(amd::Command& command) { timestamp_->end(); } command.setData(timestamp_); - if (AMD_DIRECT_DISPATCH) { + // Update HW event only for batches + if ((AMD_DIRECT_DISPATCH) && (command.GetBatchHead() != nullptr)) { command.SetHwEvent(timestamp_->Signals().back()); } timestamp_ = nullptr; diff --git a/rocclr/platform/command.cpp b/rocclr/platform/command.cpp index 389a73ad02..ed0c5fa0f6 100644 --- a/rocclr/platform/command.cpp +++ b/rocclr/platform/command.cpp @@ -259,15 +259,9 @@ bool Event::notifyCmdQueue() { HostQueue* queue = command().queue(); if ((status() > CL_COMPLETE) && (nullptr != queue) && (!AMD_DIRECT_DISPATCH || - // Don't need to notify any marker with direct dispatch, - // because all markers are blocking. - ((command().type() != CL_COMMAND_MARKER) && - (command().type() != 0)) || - // Don't need to notify if the current batch is empty, - // because that means the command was processed and extra notification - // will cause a stall on the host. - (queue->GetSubmittionBatch() != nullptr)) && - !notified_.test_and_set()) { + // If HW event was assigned, then notification can be ignored, since a barrier was issued + (HwEvent() == nullptr)) && + !notified_.test_and_set()) { // Make sure the queue is draining the enqueued commands. amd::Command* command = new amd::Marker(*queue, false, nullWaitList, this); if (command == NULL) {