Skip to content

Commit e423c17

Browse files
nrspruitadamfidel
authored andcommitted
[UR][L0] Fix bfloat16 lookup to check for the extension (intel#17364)
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 7edac83 commit e423c17

File tree

1 file changed

+5
-5
lines changed
  • unified-runtime/source/adapters/level_zero

1 file changed

+5
-5
lines changed

unified-runtime/source/adapters/level_zero/device.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ ur_result_t urDeviceGetInfo(
284284
// Supports reading and writing of images.
285285
SupportedExtensions += ("cl_khr_3d_image_writes ");
286286

287-
// L0 does not tell us if bfloat16 is supported.
288-
// For now, assume ATS and PVC support it.
289-
// TODO: change the way we detect bfloat16 support.
290-
if ((Device->ZeDeviceProperties->deviceId & 0xfff) == 0x201 ||
291-
(Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0)
287+
if (Device->Platform->zeDriverExtensionMap.count(
288+
ZE_BFLOAT16_CONVERSIONS_EXT_NAME))
289+
SupportedExtensions += ("cl_intel_bfloat16_conversions ");
290+
else if ((Device->ZeDeviceProperties->deviceId & 0xfff) == 0x201 ||
291+
(Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0)
292292
SupportedExtensions += ("cl_intel_bfloat16_conversions ");
293293

294294
return ReturnValue(SupportedExtensions.c_str());

0 commit comments

Comments
 (0)