Prevent "0" as delta.
Change-Id: Ic0fae0ff816c6c587eb37b43462455f86cf3628c Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
parent
6ce9402fc2
commit
ff09ef9263
|
@ -603,7 +603,7 @@ bool WddmMemoryManager::isCpuCopyRequired(const void *ptr) {
|
||||||
timestamp1 = __rdtsc();
|
timestamp1 = __rdtsc();
|
||||||
_mm_lfence();
|
_mm_lfence();
|
||||||
localVariableReadDelta = timestamp1 - timestamp0 - meassurmentOverhead;
|
localVariableReadDelta = timestamp1 - timestamp0 - meassurmentOverhead;
|
||||||
if (localVariableReadDelta < 0) {
|
if (localVariableReadDelta <= 0) {
|
||||||
localVariableReadDelta = 1;
|
localVariableReadDelta = 1;
|
||||||
}
|
}
|
||||||
if (localVariableReadDelta < fastestLocalRead) {
|
if (localVariableReadDelta < fastestLocalRead) {
|
||||||
|
@ -620,7 +620,7 @@ bool WddmMemoryManager::isCpuCopyRequired(const void *ptr) {
|
||||||
timestamp1 = __rdtsc();
|
timestamp1 = __rdtsc();
|
||||||
_mm_lfence();
|
_mm_lfence();
|
||||||
inputPointerReadDelta = timestamp1 - timestamp0 - meassurmentOverhead;
|
inputPointerReadDelta = timestamp1 - timestamp0 - meassurmentOverhead;
|
||||||
if (inputPointerReadDelta < 0) {
|
if (inputPointerReadDelta <= 0) {
|
||||||
inputPointerReadDelta = 1;
|
inputPointerReadDelta = 1;
|
||||||
}
|
}
|
||||||
return inputPointerReadDelta > slownessFactor * fastestLocalRead;
|
return inputPointerReadDelta > slownessFactor * fastestLocalRead;
|
||||||
|
|
Loading…
Reference in New Issue