Skip to content

Commit

Permalink
Merge pull request #2018 from wenju-he/L0-bindless-image-device-query
Browse files Browse the repository at this point in the history
[L0] Fix device query of bindless image support
  • Loading branch information
kbenzie authored Oct 4, 2024
2 parents 7b4bc76 + fbb6e86 commit b79ebe4
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source/adapters/level_zero/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,20 +1051,28 @@ ur_result_t urDeviceGetInfo(
return ReturnValue(UpdateCapabilities);
}
case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP: {
// On L0 bindless images are supported.
return ReturnValue(true);
bool DeviceIsDG2OrNewer =
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
return ReturnValue(DeviceIsDG2OrNewer &&
Device->ZeDeviceImageProperties->maxImageDims1D > 0 &&
Device->ZeDeviceImageProperties->maxImageDims2D > 0 &&
Device->ZeDeviceImageProperties->maxImageDims3D > 0);
}
case UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP: {
// On L0 bindless images can not be backed by shared (managed) USM.
return ReturnValue(false);
}
case UR_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP: {
// On L0 1D bindless image USM are supported.
return ReturnValue(true);
bool DeviceIsDG2OrNewer =
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
return ReturnValue(DeviceIsDG2OrNewer &&
Device->ZeDeviceImageProperties->maxImageDims1D > 0);
}
case UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP: {
// On L0 2D bindless image USM are supported.
return ReturnValue(true);
bool DeviceIsDG2OrNewer =
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
return ReturnValue(DeviceIsDG2OrNewer &&
Device->ZeDeviceImageProperties->maxImageDims2D > 0);
}
case UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP:
case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP:
Expand Down

0 comments on commit b79ebe4

Please sign in to comment.