@@ -939,15 +939,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
939
939
}
940
940
case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL: {
941
941
/* CL_DEVICE_SUB_GROUP_SIZES_INTEL is only supported if the device has the
942
- * cl_intel_required_subgroup_size extension, if it does not have it we
943
- * return a default subgroups sizes list of {1}
942
+ * cl_intel_required_subgroup_size extension.
944
943
* */
945
- size_t ExtSize = 0 ;
946
- urDeviceGetInfo (hDevice, UR_DEVICE_INFO_EXTENSIONS, 0 , nullptr , &ExtSize);
947
- std::string ExtStr (ExtSize, 0 );
948
- urDeviceGetInfo (hDevice, UR_DEVICE_INFO_EXTENSIONS, ExtSize, ExtStr.data (),
949
- nullptr );
950
- if (ExtStr.find (" cl_intel_required_subgroup_size" ) != std::string::npos) {
944
+ bool Supported = false ;
945
+ CL_RETURN_ON_FAILURE (cl_adapter::checkDeviceExtensions (
946
+ cl_adapter::cast<cl_device_id >(hDevice),
947
+ {" cl_intel_required_subgroup_size" }, Supported));
948
+ if (Supported) {
951
949
// Have to convert size_t to uint32_t
952
950
size_t SubGroupSizesSize = 0 ;
953
951
CL_RETURN_ON_FAILURE (
@@ -960,7 +958,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
960
958
return ReturnValue.template operator ()<uint32_t >(SubGroupSizes.data (),
961
959
SubGroupSizes.size ());
962
960
} else {
963
- return ReturnValue. template operator ()< uint32_t >( std::data ({ 1 }), 1 ) ;
961
+ return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION ;
964
962
}
965
963
}
966
964
case UR_DEVICE_INFO_EXTENSIONS: {
0 commit comments