Skip to content

Commit 84d77ee

Browse files
authored
Merge pull request #2018 from wenju-he/L0-bindless-image-device-query
[L0] Fix device query of bindless image support
2 parents ffb0f28 + 4648bea commit 84d77ee

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

source/adapters/level_zero/device.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,20 +1051,28 @@ ur_result_t urDeviceGetInfo(
10511051
return ReturnValue(UpdateCapabilities);
10521052
}
10531053
case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP: {
1054-
// On L0 bindless images are supported.
1055-
return ReturnValue(true);
1054+
bool DeviceIsDG2OrNewer =
1055+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
1056+
return ReturnValue(DeviceIsDG2OrNewer &&
1057+
Device->ZeDeviceImageProperties->maxImageDims1D > 0 &&
1058+
Device->ZeDeviceImageProperties->maxImageDims2D > 0 &&
1059+
Device->ZeDeviceImageProperties->maxImageDims3D > 0);
10561060
}
10571061
case UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP: {
10581062
// On L0 bindless images can not be backed by shared (managed) USM.
10591063
return ReturnValue(false);
10601064
}
10611065
case UR_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP: {
1062-
// On L0 1D bindless image USM are supported.
1063-
return ReturnValue(true);
1066+
bool DeviceIsDG2OrNewer =
1067+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
1068+
return ReturnValue(DeviceIsDG2OrNewer &&
1069+
Device->ZeDeviceImageProperties->maxImageDims1D > 0);
10641070
}
10651071
case UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP: {
1066-
// On L0 2D bindless image USM are supported.
1067-
return ReturnValue(true);
1072+
bool DeviceIsDG2OrNewer =
1073+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
1074+
return ReturnValue(DeviceIsDG2OrNewer &&
1075+
Device->ZeDeviceImageProperties->maxImageDims2D > 0);
10681076
}
10691077
case UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP:
10701078
case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP:

0 commit comments

Comments
 (0)