From f0fcc1e26107fff080b9d9be725a6374d42adc17 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 7 Mar 2025 10:57:55 -0800 Subject: [PATCH] [UR][L0] Fix bfloat16 lookup to check for the extension Signed-off-by: Neil R. Spruit --- unified-runtime/source/adapters/level_zero/device.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/unified-runtime/source/adapters/level_zero/device.cpp b/unified-runtime/source/adapters/level_zero/device.cpp index 078923503ef11..6d04168e01397 100644 --- a/unified-runtime/source/adapters/level_zero/device.cpp +++ b/unified-runtime/source/adapters/level_zero/device.cpp @@ -284,11 +284,11 @@ ur_result_t urDeviceGetInfo( // Supports reading and writing of images. SupportedExtensions += ("cl_khr_3d_image_writes "); - // L0 does not tell us if bfloat16 is supported. - // For now, assume ATS and PVC support it. - // TODO: change the way we detect bfloat16 support. - if ((Device->ZeDeviceProperties->deviceId & 0xfff) == 0x201 || - (Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0) + if (Device->Platform->zeDriverExtensionMap.count( + ZE_BFLOAT16_CONVERSIONS_EXT_NAME)) + SupportedExtensions += ("cl_intel_bfloat16_conversions "); + else if ((Device->ZeDeviceProperties->deviceId & 0xfff) == 0x201 || + (Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0) SupportedExtensions += ("cl_intel_bfloat16_conversions "); return ReturnValue(SupportedExtensions.c_str());