From b06f6058957d6674233673d08af3698a63daaf6b Mon Sep 17 00:00:00 2001 From: Lukasz Jobczyk Date: Thu, 20 Jul 2023 12:02:24 +0000 Subject: [PATCH] fix: Correctly flush DC when reuse heap Related-To: NEO-8067 Signed-off-by: Lukasz Jobczyk --- .../command_stream_receiver_flush_task_3_tests.cpp | 6 ++++++ .../command_stream/command_stream_receiver_hw_base.inl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp index d6fca6eef3..046e373b41 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp @@ -615,6 +615,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenUpdateTaskCountFromWaitEnable DebugManager.flags.UpdateTaskCountFromWait.set(3); auto mockCsr = new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); + mockCsr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch); pDevice->resetCommandStreamReceiver(mockCsr); mockCsr->useNewResourceImplicitFlush = false; mockCsr->useGpuIdleImplicitFlush = false; @@ -635,7 +636,12 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenUpdateTaskCountFromWaitEnable parseCommands(commandStream); auto itorPipeControl = find(cmdList.begin(), cmdList.end()); + if (MemorySynchronizationCommands::isBarrierWaRequired(pDevice->getRootDeviceEnvironment())) { + itorPipeControl++; + } EXPECT_NE(itorPipeControl, cmdList.end()); + auto cmd = genCmdCast(*itorPipeControl); + EXPECT_EQ(cmd->getDcFlushEnable(), mockCsr->getDcFlushSupport()); } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeWhenFlushTaskIsCalledThenFlushedTaskCountIsModifed) { diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 7bf9090d1b..2d75688781 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -377,7 +377,7 @@ CompletionStamp CommandStreamReceiverHw::flushTask( // for BatchedSubmissions it will be nooped and only last ppc in batch will be emitted. levelClosed = true; // if we guard with ppc, flush dc as well to speed up completion latency - if (dispatchFlags.guardCommandBufferWithPipeControl) { + if (dispatchFlags.guardCommandBufferWithPipeControl || this->heapStorageRequiresRecyclingTag) { dispatchFlags.dcFlush = this->dcFlushSupport; } }