Skip to content

Commit

Permalink
Merge pull request #1972 from aarongreig/aaron/fixSubGroupMaxSizeAssert
Browse files Browse the repository at this point in the history
Fix CL adapter assuming incorrect type for sub group query.
  • Loading branch information
omarahmed1111 authored Aug 19, 2024
2 parents f8e89b4 + 0a1ed83 commit a96fcbc
Showing 1 changed file with 8 additions and 13 deletions.
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

0 comments on commit a96fcbc

Please sign in to comment.