Skip to content

Commit ec773e6

Browse files
committed
[L0] Fix DeviceInfo global mem free to report unsupported given MemCount==0
- If there are no memory modules from zesDeviceEnumMemoryModules, then we cannot query the free memory from level zero and we do not support reporting free memory thru this api on this platform/os. Signed-off-by: Neil R. Spruit <[email protected]>
1 parent b915354 commit ec773e6

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 UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
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)