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

@@ -1655,7 +1655,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::synchronizeInOrderExe
const uint64_t *hostAddress = ptrOffset(inOrderExecInfo->getBaseHostAddress(), inOrderExecInfo->getAllocationOffset());
for (uint32_t i = 0; i < inOrderExecInfo->getNumHostPartitionsToWait(); i++) {
if (!NEO::WaitUtils::waitFunctionWithPredicate<const uint64_t>(hostAddress, waitValue, std::greater_equal<uint64_t>())) {
if (!NEO::WaitUtils::waitFunctionWithPredicate<const uint64_t>(hostAddress, waitValue, std::greater_equal<uint64_t>(), timeDiff / 1000)) {
signaled = false;
break;
}

View File

@@ -268,7 +268,7 @@ ze_result_t EventImp<TagSizeT>::queryCounterBasedEventStatus() {
bool signaled = true;
const uint64_t *hostAddress = ptrOffset(inOrderExecInfo->getBaseHostAddress(), this->inOrderAllocationOffset);
for (uint32_t i = 0; i < inOrderExecInfo->getNumHostPartitionsToWait(); i++) {
if (!NEO::WaitUtils::waitFunctionWithPredicate<const uint64_t>(hostAddress, waitValue, std::greater_equal<uint64_t>())) {
if (!NEO::WaitUtils::waitFunctionWithPredicate<const uint64_t>(hostAddress, waitValue, std::greater_equal<uint64_t>(), 0)) {
signaled = false;
break;
}
@@ -362,7 +362,8 @@ ze_result_t EventImp<TagSizeT>::queryStatusEventPackets() {
bool ready = NEO::WaitUtils::waitFunctionWithPredicate<const TagSizeT>(
static_cast<TagSizeT const *>(queryAddress),
queryVal,
std::not_equal_to<TagSizeT>());
std::not_equal_to<TagSizeT>(),
0);
if (!ready) {
return ZE_RESULT_NOT_READY;
}
@@ -378,7 +379,8 @@ ze_result_t EventImp<TagSizeT>::queryStatusEventPackets() {
bool ready = NEO::WaitUtils::waitFunctionWithPredicate<const TagSizeT>(
static_cast<TagSizeT const *>(queryAddress),
queryVal,
std::not_equal_to<TagSizeT>());
std::not_equal_to<TagSizeT>(),
0);
if (!ready) {
return ZE_RESULT_NOT_READY;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2024 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -241,7 +241,7 @@ TEST_F(FenceSynchronizeTest, givenInfiniteTimeoutWhenWaitingForFenceCompletionTh
constexpr uint32_t activePartitions = 2;
constexpr uint32_t postSyncOffset = 16;
VariableBackup<bool> backupWaitpkgUse(&NEO::WaitUtils::waitpkgUse, false);
VariableBackup<WaitUtils::WaitpkgUse> backupWaitpkgUse(&WaitUtils::waitpkgUse, WaitUtils::WaitpkgUse::noUse);
VariableBackup<uint32_t> backupWaitCount(&NEO::WaitUtils::waitCount, 1);
const auto csr = std::make_unique<MockCommandStreamReceiver>(*neoDevice->getExecutionEnvironment(), 0, neoDevice->getDeviceBitfield());