diff --git a/source/adapters/opencl/kernel.cpp b/source/adapters/opencl/kernel.cpp index 41c6d6de70..9735abefbf 100644 --- a/source/adapters/opencl/kernel.cpp +++ b/source/adapters/opencl/kernel.cpp @@ -206,19 +206,14 @@ urKernelGetSubGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice, // Two calls to urDeviceGetInfo are needed: the first determines the size // required to store the result, and the second returns the actual size // values. - ur_result_t URRet = - urDeviceGetInfo(hDevice, UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, 0, - nullptr, &ResultSize); - if (URRet != UR_RESULT_SUCCESS) { - return URRet; - } - assert(ResultSize % sizeof(size_t) == 0); - std::vector Result(ResultSize / sizeof(size_t)); - URRet = urDeviceGetInfo(hDevice, UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, - ResultSize, Result.data(), nullptr); - if (URRet != UR_RESULT_SUCCESS) { - return URRet; - } + UR_RETURN_ON_FAILURE(urDeviceGetInfo(hDevice, + UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, + 0, nullptr, &ResultSize)); + assert(ResultSize % sizeof(uint32_t) == 0); + std::vector Result(ResultSize / sizeof(uint32_t)); + UR_RETURN_ON_FAILURE(urDeviceGetInfo(hDevice, + UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, + ResultSize, Result.data(), nullptr)); RetVal = *std::max_element(Result.begin(), Result.end()); Ret = CL_SUCCESS; } else if (propName == UR_KERNEL_SUB_GROUP_INFO_SUB_GROUP_SIZE_INTEL) {