Skip to content

Commit c913298

Browse files
committed
[L0] Fix DeviceInfo global mem free to report global if MemCount==0
- If there are no memory modules from zesDeviceEnumMemoryModules, then don't use the free memory value to report global mem free, but instead return the GlobalMemSize. Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 0c0f48d commit c913298

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/adapters/level_zero/device.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
718718
}
719719
}
720720
}
721-
return ReturnValue(std::min(GlobalMemSize, FreeMemory));
721+
if (MemCount > 0) {
722+
return ReturnValue(std::min(GlobalMemSize, FreeMemory));
723+
} else {
724+
return ReturnValue(GlobalMemSize);
725+
}
722726
}
723727
case UR_DEVICE_INFO_MEMORY_CLOCK_RATE: {
724728
// If there are not any memory modules then return 0.

0 commit comments

Comments
 (0)