mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
feature: clear deferred TS nodes after in-order CL sync
Related-To: NEO-7966 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c544004b8e
commit
2dd7a9cdc3
@@ -1077,6 +1077,9 @@ template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::synchronizeInOrderExecution(uint64_t timeout) const {
|
||||
using TSPacketType = typename GfxFamily::TimestampPacketType;
|
||||
|
||||
NEO::TimestampPacketContainer nodesToRelease;
|
||||
nodesToRelease.swapNodes(*this->deferredTimestampPackets);
|
||||
|
||||
std::chrono::high_resolution_clock::time_point waitStartTime, lastHangCheckTime, now;
|
||||
uint64_t timeDiff = 0;
|
||||
|
||||
@@ -1110,6 +1113,10 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::synchronizeInOrderExe
|
||||
timeDiff = std::chrono::duration_cast<std::chrono::nanoseconds>(now - waitStartTime).count();
|
||||
} while (timeDiff < timeout);
|
||||
|
||||
if (status == ZE_RESULT_NOT_READY) {
|
||||
nodesToRelease.moveNodesToNewContainer(*this->deferredTimestampPackets);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -1258,6 +1258,33 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenCallingSyncThenHandleCompleti
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenCallingSyncThenHandleDeferredNodesLifeCycle, IsAtLeastXeHpCore) {
|
||||
auto immCmdList = createImmCmdList<gfxCoreFamily>();
|
||||
|
||||
immCmdList->appendLaunchKernel(kernel->toHandle(), &groupCount, nullptr, 0, nullptr, launchParams, false);
|
||||
immCmdList->appendLaunchKernel(kernel->toHandle(), &groupCount, nullptr, 0, nullptr, launchParams, false);
|
||||
immCmdList->appendLaunchKernel(kernel->toHandle(), &groupCount, nullptr, 0, nullptr, launchParams, false);
|
||||
|
||||
auto node = getLatestTsNode(immCmdList.get());
|
||||
|
||||
setTimestampPacketContextEndValue<FamilyType>(node, 1);
|
||||
|
||||
EXPECT_EQ(1u, immCmdList->timestampPacketContainer->peekNodes().size());
|
||||
EXPECT_EQ(2u, immCmdList->deferredTimestampPackets->peekNodes().size());
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_NOT_READY, immCmdList->hostSynchronize(1));
|
||||
|
||||
EXPECT_EQ(1u, immCmdList->timestampPacketContainer->peekNodes().size());
|
||||
EXPECT_EQ(2u, immCmdList->deferredTimestampPackets->peekNodes().size());
|
||||
|
||||
setTimestampPacketContextEndValue<FamilyType>(node, 0x1234);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, immCmdList->hostSynchronize(std::numeric_limits<uint64_t>::max()));
|
||||
|
||||
EXPECT_EQ(1u, immCmdList->timestampPacketContainer->peekNodes().size());
|
||||
EXPECT_EQ(0u, immCmdList->deferredTimestampPackets->peekNodes().size());
|
||||
}
|
||||
|
||||
HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenDoingCpuCopyThenSynchronize, IsAtLeastXeHpCore) {
|
||||
auto immCmdList = createImmCmdList<gfxCoreFamily>();
|
||||
immCmdList->copyThroughLockedPtrEnabled = true;
|
||||
|
||||
Reference in New Issue
Block a user