Skip to content

Commit fbb6e86

Browse files
wenju-heaarongreig
authored andcommitted
[L0] Fix device query of bindless image support
Bindless image support is only supported on intel DG2 or newer GPU. In addition, it also requires basic image support queried from ZeDeviceImageProperties.
1 parent 2ad3268 commit fbb6e86

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
@@ -1010,20 +1010,28 @@ ur_result_t urDeviceGetInfo(
10101010
Device->Platform->ZeMutableCmdListExt.Supported);
10111011
}
10121012
case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP: {
1013-
// On L0 bindless images are supported.
1014-
return ReturnValue(true);
1013+
bool DeviceIsDG2OrNewer =
1014+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
1015+
return ReturnValue(DeviceIsDG2OrNewer &&
1016+
Device->ZeDeviceImageProperties->maxImageDims1D > 0 &&
1017+
Device->ZeDeviceImageProperties->maxImageDims2D > 0 &&
1018+
Device->ZeDeviceImageProperties->maxImageDims3D > 0);
10151019
}
10161020
case UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP: {
10171021
// On L0 bindless images can not be backed by shared (managed) USM.
10181022
return ReturnValue(false);
10191023
}
10201024
case UR_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP: {
1021-
// On L0 1D bindless image USM are supported.
1022-
return ReturnValue(true);
1025+
bool DeviceIsDG2OrNewer =
1026+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
1027+
return ReturnValue(DeviceIsDG2OrNewer &&
1028+
Device->ZeDeviceImageProperties->maxImageDims1D > 0);
10231029
}
10241030
case UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP: {
1025-
// On L0 2D bindless image USM are supported.
1026-
return ReturnValue(true);
1031+
bool DeviceIsDG2OrNewer =
1032+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
1033+
return ReturnValue(DeviceIsDG2OrNewer &&
1034+
Device->ZeDeviceImageProperties->maxImageDims2D > 0);
10271035
}
10281036
case UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP:
10291037
case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP:

0 commit comments

Comments
 (0)