mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 02:18:05 +08:00
fix: remove no longer needed flush l3 after cpu read
Related-To: NEO-13163 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7185e5bfbe
commit
d86cc127ea
@@ -547,7 +547,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
|||||||
bool heaplessModeEnabled = false;
|
bool heaplessModeEnabled = false;
|
||||||
bool heaplessStateInitEnabled = false;
|
bool heaplessStateInitEnabled = false;
|
||||||
bool isForceStateless = false;
|
bool isForceStateless = false;
|
||||||
bool l3FlushedAfterCpuRead = true;
|
|
||||||
bool l3FlushAfterPostSyncEnabled = false;
|
bool l3FlushAfterPostSyncEnabled = false;
|
||||||
bool isWalkerWithProfilingEnqueued = false;
|
bool isWalkerWithProfilingEnqueued = false;
|
||||||
bool shouldRegisterEnqueuedWalkerWithProfiling = false;
|
bool shouldRegisterEnqueuedWalkerWithProfiling = false;
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBufferImpl(
|
|||||||
|
|
||||||
if (isCpuCopyAllowed) {
|
if (isCpuCopyAllowed) {
|
||||||
if (isMemTransferNeeded) {
|
if (isMemTransferNeeded) {
|
||||||
this->l3FlushedAfterCpuRead = false;
|
|
||||||
return enqueueReadWriteBufferOnCpuWithMemoryTransfer(cmdType, buffer, offset, size, ptr,
|
return enqueueReadWriteBufferOnCpuWithMemoryTransfer(cmdType, buffer, offset, size, ptr,
|
||||||
numEventsInWaitList, eventWaitList, event);
|
numEventsInWaitList, eventWaitList, event);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -25,20 +25,6 @@ cl_int CommandQueueHw<GfxFamily>::finish() {
|
|||||||
|
|
||||||
bool waitForTaskCountRequired = false;
|
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
|
// Stall until HW reaches taskCount on all its engines
|
||||||
const auto waitStatus = waitForAllEngines(true, nullptr, waitForTaskCountRequired);
|
const auto waitStatus = waitForAllEngines(true, nullptr, waitForTaskCountRequired);
|
||||||
if (waitStatus == WaitStatus::gpuHang) {
|
if (waitStatus == WaitStatus::gpuHang) {
|
||||||
|
|||||||
@@ -96,44 +96,3 @@ HWTEST_F(FinishTest, givenFreshQueueWhenFinishIsCalledThenCommandStreamIsNotAllo
|
|||||||
|
|
||||||
EXPECT_EQ(nullptr, cmdQ.peekCommandStream());
|
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<FamilyType> 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<FamilyType>(csr.commandStream, used);
|
|
||||||
auto itorCmd = find<PIPE_CONTROL *>(hwParse.cmdList.begin(), hwParse.cmdList.end());
|
|
||||||
|
|
||||||
EXPECT_NE(hwParse.cmdList.end(), itorCmd);
|
|
||||||
|
|
||||||
// Verify DC flush is enabled
|
|
||||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*itorCmd);
|
|
||||||
ASSERT_NE(nullptr, pipeControl);
|
|
||||||
EXPECT_EQ(csr.dcFlushSupport, pipeControl->getDcFlushEnable());
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -283,7 +283,6 @@ class MockCommandQueueHw : public CommandQueueHw<GfxFamily> {
|
|||||||
using BaseClass::isCompleted;
|
using BaseClass::isCompleted;
|
||||||
using BaseClass::isGpgpuSubmissionForBcsRequired;
|
using BaseClass::isGpgpuSubmissionForBcsRequired;
|
||||||
using BaseClass::l3FlushAfterPostSyncEnabled;
|
using BaseClass::l3FlushAfterPostSyncEnabled;
|
||||||
using BaseClass::l3FlushedAfterCpuRead;
|
|
||||||
using BaseClass::latestSentEnqueueType;
|
using BaseClass::latestSentEnqueueType;
|
||||||
using BaseClass::minimalSizeForBcsSplit;
|
using BaseClass::minimalSizeForBcsSplit;
|
||||||
using BaseClass::obtainCommandStream;
|
using BaseClass::obtainCommandStream;
|
||||||
|
|||||||
Reference in New Issue
Block a user