mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
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:
committed by
Compute-Runtime-Automation
parent
ce079c62d5
commit
1a00d96735
@@ -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);
|
UNRECOVERABLE_IF(csr == nullptr);
|
||||||
|
|
||||||
auto taskCountToWait = getTaskCount();
|
auto taskCountToWait = getTaskCount();
|
||||||
bool enableTimeout = true;
|
bool enableTimeout = true;
|
||||||
int64_t timeoutMicroseconds = static_cast<int64_t>(timeout);
|
int64_t timeoutMicroseconds = static_cast<int64_t>(timeoutNanoseconds / 1000);
|
||||||
if (timeout == std::numeric_limits<uint64_t>::max()) {
|
if (timeoutNanoseconds == std::numeric_limits<uint64_t>::max()) {
|
||||||
enableTimeout = false;
|
enableTimeout = false;
|
||||||
timeoutMicroseconds = NEO::TimeoutControls::maxTimeout;
|
timeoutMicroseconds = NEO::TimeoutControls::maxTimeout;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ struct CommandQueueImp : public CommandQueue {
|
|||||||
MOCKABLE_VIRTUAL NEO::SubmissionStatus submitBatchBuffer(size_t offset, NEO::ResidencyContainer &residencyContainer, void *endingCmdPtr,
|
MOCKABLE_VIRTUAL NEO::SubmissionStatus submitBatchBuffer(size_t offset, NEO::ResidencyContainer &residencyContainer, void *endingCmdPtr,
|
||||||
bool isCooperative);
|
bool isCooperative);
|
||||||
|
|
||||||
ze_result_t synchronizeByPollingForTaskCount(uint64_t timeout);
|
ze_result_t synchronizeByPollingForTaskCount(uint64_t timeoutNanoseconds);
|
||||||
|
|
||||||
void postSyncOperations(bool hangDetected);
|
void postSyncOperations(bool hangDetected);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user