Skip to content

Commit 0a99d87

Browse files
authored
[SYCL] Fix global memory reporting for Arc (#10013)
3c35b1b dropped this previous fix by mistake: #8624
1 parent eaaedc9 commit 0a99d87

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_device.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,19 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
245245
return ReturnValue(uint64_t{Device->ZeDeviceProperties->maxMemAllocSize});
246246
case UR_DEVICE_INFO_GLOBAL_MEM_SIZE: {
247247
uint64_t GlobalMemSize = 0;
248+
// Support to read physicalSize depends on kernel,
249+
// so fallback into reading totalSize if physicalSize
250+
// is not available.
248251
for (const auto &ZeDeviceMemoryExtProperty :
249252
Device->ZeDeviceMemoryProperties->second) {
250253
GlobalMemSize += ZeDeviceMemoryExtProperty.physicalSize;
251254
}
255+
if (GlobalMemSize == 0) {
256+
for (const auto &ZeDeviceMemoryProperty :
257+
Device->ZeDeviceMemoryProperties->first) {
258+
GlobalMemSize += ZeDeviceMemoryProperty.totalSize;
259+
}
260+
}
252261
return ReturnValue(uint64_t{GlobalMemSize});
253262
}
254263
case UR_DEVICE_INFO_LOCAL_MEM_SIZE:

0 commit comments

Comments
 (0)