mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
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:
committed by
Compute-Runtime-Automation
parent
4e9afb32e6
commit
8a85a96ed2
@@ -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 ×tamp : 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");
|
||||
|
||||
Reference in New Issue
Block a user