Skip to content

Commit c6a85b0

Browse files
committed
Address reviewer comments
1 parent 081f615 commit c6a85b0

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

source/adapters/opencl/device.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -939,15 +939,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
939939
}
940940
case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL: {
941941
/* 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.
944943
* */
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) {
951949
// Have to convert size_t to uint32_t
952950
size_t SubGroupSizesSize = 0;
953951
CL_RETURN_ON_FAILURE(
@@ -960,7 +958,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
960958
return ReturnValue.template operator()<uint32_t>(SubGroupSizes.data(),
961959
SubGroupSizes.size());
962960
} else {
963-
return ReturnValue.template operator()<uint32_t>(std::data({1}), 1);
961+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
964962
}
965963
}
966964
case UR_DEVICE_INFO_EXTENSIONS: {

0 commit comments

Comments
 (0)