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:
Mrozek, Michal
2018-02-27 07:40:15 +01:00
parent 3da9df23a9
commit cd747b7b8c
21 changed files with 33 additions and 33 deletions

View File

@@ -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) {