Prevent "0" as delta.

Change-Id: Ic0fae0ff816c6c587eb37b43462455f86cf3628c
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek 2020-03-12 10:56:12 +01:00
parent 6ce9402fc2
commit ff09ef9263
1 changed files with 2 additions and 2 deletions

View File

@ -603,7 +603,7 @@ bool WddmMemoryManager::isCpuCopyRequired(const void *ptr) {
timestamp1 = __rdtsc();
_mm_lfence();
localVariableReadDelta = timestamp1 - timestamp0 - meassurmentOverhead;
if (localVariableReadDelta < 0) {
if (localVariableReadDelta <= 0) {
localVariableReadDelta = 1;
}
if (localVariableReadDelta < fastestLocalRead) {
@ -620,7 +620,7 @@ bool WddmMemoryManager::isCpuCopyRequired(const void *ptr) {
timestamp1 = __rdtsc();
_mm_lfence();
inputPointerReadDelta = timestamp1 - timestamp0 - meassurmentOverhead;
if (inputPointerReadDelta < 0) {
if (inputPointerReadDelta <= 0) {
inputPointerReadDelta = 1;
}
return inputPointerReadDelta > slownessFactor * fastestLocalRead;