From fe3f32eb688674bf83d0bc3ee9fcd409cb0763dc Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Fri, 20 Jan 2023 11:30:38 +0000 Subject: [PATCH] Fix relax ordering check for event remaining packets Related-To: NEO-7490 Signed-off-by: Zbigniew Zdanowicz --- level_zero/core/source/cmdlist/cmdlist_hw.h | 1 - level_zero/core/source/cmdlist/cmdlist_hw.inl | 30 ++----------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.h b/level_zero/core/source/cmdlist/cmdlist_hw.h index ec0741715a..480b83e944 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.h +++ b/level_zero/core/source/cmdlist/cmdlist_hw.h @@ -300,7 +300,6 @@ struct CommandListCoreFamily : CommandListImp { compactL3FlushEvent(dcFlush); } void allocateKernelPrivateMemoryIfNeeded(Kernel *kernel, uint32_t sizePerHwThread); - void waitOnRemainingEventPackets(Event *event); CmdListEventOperation estimateEventPostSync(Event *event, uint32_t operations); void dispatchPostSyncCopy(uint64_t gpuAddress, uint32_t value, bool workloadPartition); void dispatchPostSyncCompute(uint64_t gpuAddress, uint32_t value, bool workloadPartition); diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index c4b3e2560b..c418860804 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -2026,7 +2026,9 @@ ze_result_t CommandListCoreFamily::appendWaitOnEvents(uint32_t nu commandContainer.addToResidencyContainer(&event->getAllocation(this->device)); gpuAddr = event->getCompletionFieldGpuAddress(this->device); uint32_t packetsToWait = event->getPacketsInUse(); - + if (this->signalAllEventPackets) { + packetsToWait = event->getMaxPacketsCount(); + } for (uint32_t i = 0u; i < packetsToWait; i++) { if (relaxedOrdering) { NEO::EncodeBatchBufferStartOrEnd::programConditionalDataMemBatchBufferStart(*commandContainer.getCommandStream(), 0, gpuAddr, eventStateClear, @@ -2040,9 +2042,6 @@ ze_result_t CommandListCoreFamily::appendWaitOnEvents(uint32_t nu gpuAddr += event->getSinglePacketSize(); } - if (this->signalAllEventPackets) { - waitOnRemainingEventPackets(event); - } } if (NEO::DebugManager.flags.EnableSWTags.get()) { @@ -2714,29 +2713,6 @@ void CommandListCoreFamily::allocateKernelPrivateMemoryIfNeeded(K } } -template -void CommandListCoreFamily::waitOnRemainingEventPackets(Event *event) { - using COMPARE_OPERATION = typename GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION; - - uint32_t packetUsed = event->getPacketsInUse(); - uint32_t packetsRemaining = event->getMaxPacketsCount() - packetUsed; - if (packetsRemaining == 0) { - return; - } - - uint64_t gpuAddress = event->getCompletionFieldGpuAddress(this->device); - size_t packetSize = event->getSinglePacketSize(); - gpuAddress += packetSize * packetUsed; - - for (uint32_t i = 0; i < packetsRemaining; i++) { - NEO::EncodeSempahore::addMiSemaphoreWaitCommand(*commandContainer.getCommandStream(), - gpuAddress, - Event::STATE_CLEARED, - COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD); - gpuAddress += packetSize; - } -} - template CmdListEventOperation CommandListCoreFamily::estimateEventPostSync(Event *event, uint32_t operations) { CmdListEventOperation ret;