mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Change notify delay to use microseconds.
- Microseconds offer better precision. - Some workloads require threshold less then 1 millisecond to work efficiently. Change-Id: I1a565049340fb6eeebe5c0a61ededae9959daca8
This commit is contained in:
@@ -176,7 +176,7 @@ void CommandStreamReceiver::cleanupResources() {
|
||||
}
|
||||
}
|
||||
|
||||
bool CommandStreamReceiver::waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait) {
|
||||
bool CommandStreamReceiver::waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMicroseconds, uint32_t taskCountToWait) {
|
||||
std::chrono::high_resolution_clock::time_point time1, time2;
|
||||
int64_t timeDiff = 0;
|
||||
|
||||
@@ -186,10 +186,10 @@ bool CommandStreamReceiver::waitForCompletionWithTimeout(bool enableTimeout, int
|
||||
}
|
||||
|
||||
time1 = std::chrono::high_resolution_clock::now();
|
||||
while (*getTagAddress() < taskCountToWait && timeDiff <= timeoutMs) {
|
||||
while (*getTagAddress() < taskCountToWait && timeDiff <= timeoutMicroseconds) {
|
||||
if (enableTimeout) {
|
||||
time2 = std::chrono::high_resolution_clock::now();
|
||||
timeDiff = std::chrono::duration_cast<std::chrono::milliseconds>(time2 - time1).count();
|
||||
timeDiff = std::chrono::duration_cast<std::chrono::microseconds>(time2 - time1).count();
|
||||
}
|
||||
}
|
||||
if (*getTagAddress() >= taskCountToWait) {
|
||||
|
||||
Reference in New Issue
Block a user