File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
sycl/plugins/unified_runtime/ur/adapters/level_zero Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -245,10 +245,19 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
245
245
return ReturnValue (uint64_t {Device->ZeDeviceProperties ->maxMemAllocSize });
246
246
case UR_DEVICE_INFO_GLOBAL_MEM_SIZE: {
247
247
uint64_t GlobalMemSize = 0 ;
248
+ // Support to read physicalSize depends on kernel,
249
+ // so fallback into reading totalSize if physicalSize
250
+ // is not available.
248
251
for (const auto &ZeDeviceMemoryExtProperty :
249
252
Device->ZeDeviceMemoryProperties ->second ) {
250
253
GlobalMemSize += ZeDeviceMemoryExtProperty.physicalSize ;
251
254
}
255
+ if (GlobalMemSize == 0 ) {
256
+ for (const auto &ZeDeviceMemoryProperty :
257
+ Device->ZeDeviceMemoryProperties ->first ) {
258
+ GlobalMemSize += ZeDeviceMemoryProperty.totalSize ;
259
+ }
260
+ }
252
261
return ReturnValue (uint64_t {GlobalMemSize});
253
262
}
254
263
case UR_DEVICE_INFO_LOCAL_MEM_SIZE:
You can’t perform that action at this time.
0 commit comments