Skip to content

Commit

Permalink
[L0] Fix DeviceInfo global mem free to report unsupported given MemCo…
Browse files Browse the repository at this point in the history
…unt==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 <neil.r.spruit@intel.com>
  • Loading branch information
nrspruit committed Apr 4, 2024
1 parent 0c0f48d commit 096be8b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/adapters/level_zero/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
}
}
}
return ReturnValue(std::min(GlobalMemSize, FreeMemory));
if (MemCount > 0) {
return ReturnValue(std::min(GlobalMemSize, FreeMemory));
} else {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
}
case UR_DEVICE_INFO_MEMORY_CLOCK_RATE: {
// If there are not any memory modules then return 0.
Expand Down

0 comments on commit 096be8b

Please sign in to comment.