fix: Fixed timeout resolution for zeCommandQueueSynchronize

According to Level Zero specification: timeout [in] if non-zero,
then indicates the maximum time (in nanoseconds) to yield
before returning ZE_RESULT_SUCCESS or ZE_RESULT_NOT_READY

Related-To: NEO-8927

Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
Slawomir Milczarek
2024-02-16 11:09:34 +00:00
committed by Compute-Runtime-Automation
parent ce079c62d5
commit 1a00d96735
2 changed files with 4 additions and 4 deletions

View File

@@ -165,13 +165,13 @@ ze_result_t CommandQueueImp::synchronize(uint64_t timeout) {
}
}
ze_result_t CommandQueueImp::synchronizeByPollingForTaskCount(uint64_t timeout) {
ze_result_t CommandQueueImp::synchronizeByPollingForTaskCount(uint64_t timeoutNanoseconds) {
UNRECOVERABLE_IF(csr == nullptr);
auto taskCountToWait = getTaskCount();
bool enableTimeout = true;
int64_t timeoutMicroseconds = static_cast<int64_t>(timeout);
if (timeout == std::numeric_limits<uint64_t>::max()) {
int64_t timeoutMicroseconds = static_cast<int64_t>(timeoutNanoseconds / 1000);
if (timeoutNanoseconds == std::numeric_limits<uint64_t>::max()) {
enableTimeout = false;
timeoutMicroseconds = NEO::TimeoutControls::maxTimeout;
}