Skip to content

Commit 065bf2d

Browse files
authored
Merge pull request #1486 from nrspruit/fix_memfree_report
[L0] Fix DeviceInfo global mem free to report unsupported given MemCount==0
2 parents b915354 + ec773e6 commit 065bf2d

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)