Correct infinite timeout argument for event synchronization

Related-To: NEO-6242

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-03-16 12:53:11 +00:00
committed by Compute-Runtime-Automation
parent 493b01e3c8
commit 878466a1ea
4 changed files with 99 additions and 17 deletions

View File

@@ -100,7 +100,11 @@ ze_result_t EventImp<TagSizeT>::queryStatusKernelTimestamp() {
for (uint32_t i = 0; i < kernelCount; i++) {
uint32_t packetsToCheck = kernelEventCompletionData[i].getPacketsUsed();
for (uint32_t packetId = 0; packetId < packetsToCheck; packetId++) {
if (kernelEventCompletionData[i].getContextEndValue(packetId) == queryVal) {
bool notReady = NEO::WaitUtils::waitFunctionWithPredicate<const TagSizeT>(
static_cast<TagSizeT const *>(kernelEventCompletionData[i].getContextEndAddress(packetId)),
queryVal,
std::equal_to<TagSizeT>());
if (notReady) {
return ZE_RESULT_NOT_READY;
}
}
@@ -116,7 +120,11 @@ ze_result_t EventImp<TagSizeT>::queryStatusNonTimestamp() {
for (uint32_t i = 0; i < kernelCount; i++) {
uint32_t packetsToCheck = kernelEventCompletionData[i].getPacketsUsed();
for (uint32_t packetId = 0; packetId < packetsToCheck; packetId++) {
if (kernelEventCompletionData[i].getContextStartValue(packetId) == queryVal) {
bool notReady = NEO::WaitUtils::waitFunctionWithPredicate<const TagSizeT>(
static_cast<TagSizeT const *>(kernelEventCompletionData[i].getContextStartAddress(packetId)),
queryVal,
std::equal_to<TagSizeT>());
if (notReady) {
return ZE_RESULT_NOT_READY;
}
}
@@ -221,8 +229,6 @@ ze_result_t EventImp<TagSizeT>::hostSynchronize(uint64_t timeout) {
return ret;
}
NEO::WaitUtils::waitFunction(nullptr, 0u);
currentTime = std::chrono::high_resolution_clock::now();
elapsedTimeSinceGpuHangCheck = std::chrono::duration_cast<std::chrono::microseconds>(currentTime - lastHangCheckTime);
@@ -233,7 +239,7 @@ ze_result_t EventImp<TagSizeT>::hostSynchronize(uint64_t timeout) {
}
}
if (timeout == std::numeric_limits<uint32_t>::max()) {
if (timeout == std::numeric_limits<uint64_t>::max()) {
continue;
}