Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions source/adapters/opencl/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t> 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<uint32_t> 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) {
Expand Down