feature: Add 3-level wait scheme with tpause intrinsic

Related-To: NEO-14336

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-03-21 08:27:46 +00:00
committed by Compute-Runtime-Automation
parent 4e9afb32e6
commit 8a85a96ed2
22 changed files with 252 additions and 103 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2024 Intel Corporation
* Copyright (C) 2019-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -148,6 +148,7 @@ inline bool waitForTimestampsWithinContainer(TimestampPacketContainer *container
if (container) {
auto lastHangCheckTime = std::chrono::high_resolution_clock::now();
auto waitStartTime = lastHangCheckTime;
for (const auto &timestamp : container->peekNodes()) {
for (uint32_t i = 0; i < timestamp->getPacketsUsed(); i++) {
if (printWaitForCompletion) {
@@ -155,8 +156,11 @@ inline bool waitForTimestampsWithinContainer(TimestampPacketContainer *container
}
while (timestamp->getContextEndValue(i) == 1) {
csr.downloadAllocation(*timestamp->getBaseGraphicsAllocation()->getGraphicsAllocation(csr.getRootDeviceIndex()));
WaitUtils::waitFunctionWithPredicate<const TSPacketType>(static_cast<TSPacketType const *>(timestamp->getContextEndAddress(i)), 1u, std::not_equal_to<TSPacketType>());
if (csr.checkGpuHangDetected(std::chrono::high_resolution_clock::now(), lastHangCheckTime)) {
auto currentTime = std::chrono::high_resolution_clock::now();
WaitUtils::waitFunctionWithPredicate<const TSPacketType>(static_cast<TSPacketType const *>(timestamp->getContextEndAddress(i)), 1u, std::not_equal_to<TSPacketType>(), std::chrono::duration_cast<std::chrono::microseconds>(currentTime - waitStartTime).count());
if (csr.checkGpuHangDetected(currentTime, lastHangCheckTime)) {
status = WaitStatus::gpuHang;
if (printWaitForCompletion) {
printf("\nWaiting for TS failed");