From d86cc127ea9f4dfd4d6788aed6ac2d6fbbddb886 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Wed, 13 Aug 2025 19:22:02 +0000 Subject: [PATCH] fix: remove no longer needed flush l3 after cpu read Related-To: NEO-13163 Signed-off-by: Kamil Kopryk --- opencl/source/command_queue/command_queue.h | 1 - .../command_queue/enqueue_read_buffer.h | 1 - opencl/source/command_queue/finish.h | 14 ------- .../unit_test/command_queue/finish_tests.cpp | 41 ------------------- .../test/unit_test/mocks/mock_command_queue.h | 1 - 5 files changed, 58 deletions(-) diff --git a/opencl/source/command_queue/command_queue.h b/opencl/source/command_queue/command_queue.h index a320419ee7..cab1391b98 100644 --- a/opencl/source/command_queue/command_queue.h +++ b/opencl/source/command_queue/command_queue.h @@ -547,7 +547,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> { bool heaplessModeEnabled = false; bool heaplessStateInitEnabled = false; bool isForceStateless = false; - bool l3FlushedAfterCpuRead = true; bool l3FlushAfterPostSyncEnabled = false; bool isWalkerWithProfilingEnqueued = false; bool shouldRegisterEnqueuedWalkerWithProfiling = false; diff --git a/opencl/source/command_queue/enqueue_read_buffer.h b/opencl/source/command_queue/enqueue_read_buffer.h index cfcac3f791..95e0ecd120 100644 --- a/opencl/source/command_queue/enqueue_read_buffer.h +++ b/opencl/source/command_queue/enqueue_read_buffer.h @@ -76,7 +76,6 @@ cl_int CommandQueueHw::enqueueReadBufferImpl( if (isCpuCopyAllowed) { if (isMemTransferNeeded) { - this->l3FlushedAfterCpuRead = false; return enqueueReadWriteBufferOnCpuWithMemoryTransfer(cmdType, buffer, offset, size, ptr, numEventsInWaitList, eventWaitList, event); } else { diff --git a/opencl/source/command_queue/finish.h b/opencl/source/command_queue/finish.h index b5890c405c..7315db59cd 100644 --- a/opencl/source/command_queue/finish.h +++ b/opencl/source/command_queue/finish.h @@ -25,20 +25,6 @@ cl_int CommandQueueHw::finish() { bool waitForTaskCountRequired = false; - if (!l3FlushedAfterCpuRead && l3FlushAfterPostSyncEnabled) { - csr.flushTagUpdate(); - - CompletionStamp completionStamp = { - csr.peekTaskCount(), - csr.peekTaskLevel(), - csr.obtainCurrentFlushStamp()}; - - this->updateFromCompletionStamp(completionStamp, nullptr); - - this->l3FlushedAfterCpuRead = true; - waitForTaskCountRequired = true; - } - // Stall until HW reaches taskCount on all its engines const auto waitStatus = waitForAllEngines(true, nullptr, waitForTaskCountRequired); if (waitStatus == WaitStatus::gpuHang) { diff --git a/opencl/test/unit_test/command_queue/finish_tests.cpp b/opencl/test/unit_test/command_queue/finish_tests.cpp index e20d742eae..049521e238 100644 --- a/opencl/test/unit_test/command_queue/finish_tests.cpp +++ b/opencl/test/unit_test/command_queue/finish_tests.cpp @@ -96,44 +96,3 @@ HWTEST_F(FinishTest, givenFreshQueueWhenFinishIsCalledThenCommandStreamIsNotAllo EXPECT_EQ(nullptr, cmdQ.peekCommandStream()); } - -HWTEST_F(FinishTest, givenL3FlushAfterPostSyncEnabledWhenFlushTagUpdateIsCalledThenPipeControlIsAddedWithDcFlushEnabled) { - using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - - DebugManagerStateRestore dbgRestorer; - debugManager.flags.EnableL3FlushAfterPostSync.set(true); - - auto &productHelper = pClDevice->getDevice().getProductHelper(); - if (!productHelper.isL3FlushAfterPostSyncRequired(true)) { - GTEST_SKIP(); - } - - MockContext contextWithMockCmdQ(pClDevice, true); - MockCommandQueueHw cmdQ(&contextWithMockCmdQ, pClDevice, 0); - - cmdQ.l3FlushedAfterCpuRead = false; - cmdQ.l3FlushAfterPostSyncEnabled = true; - - auto &csr = cmdQ.getUltCommandStreamReceiver(); - auto used = csr.commandStream.getUsed(); - - auto taskCount = csr.taskCount.load(); - auto retVal = cmdQ.finish(); - - EXPECT_EQ(taskCount + 1, csr.taskCount.load()); - EXPECT_EQ(taskCount + 1, cmdQ.taskCount); - - ASSERT_EQ(CL_SUCCESS, retVal); - EXPECT_FALSE(cmdQ.recordedSkipWait); - - HardwareParse hwParse; - hwParse.parseCommands(csr.commandStream, used); - auto itorCmd = find(hwParse.cmdList.begin(), hwParse.cmdList.end()); - - EXPECT_NE(hwParse.cmdList.end(), itorCmd); - - // Verify DC flush is enabled - auto pipeControl = genCmdCast(*itorCmd); - ASSERT_NE(nullptr, pipeControl); - EXPECT_EQ(csr.dcFlushSupport, pipeControl->getDcFlushEnable()); -} diff --git a/opencl/test/unit_test/mocks/mock_command_queue.h b/opencl/test/unit_test/mocks/mock_command_queue.h index 63b4aa9e91..88abca1772 100644 --- a/opencl/test/unit_test/mocks/mock_command_queue.h +++ b/opencl/test/unit_test/mocks/mock_command_queue.h @@ -283,7 +283,6 @@ class MockCommandQueueHw : public CommandQueueHw { using BaseClass::isCompleted; using BaseClass::isGpgpuSubmissionForBcsRequired; using BaseClass::l3FlushAfterPostSyncEnabled; - using BaseClass::l3FlushedAfterCpuRead; using BaseClass::latestSentEnqueueType; using BaseClass::minimalSizeForBcsSplit; using BaseClass::obtainCommandStream;