Skip to content

Commit a96fcbc

Browse files
Merge pull request #1972 from aarongreig/aaron/fixSubGroupMaxSizeAssert
Fix CL adapter assuming incorrect type for sub group query.
2 parents f8e89b4 + 0a1ed83 commit a96fcbc

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

source/adapters/opencl/kernel.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -206,19 +206,14 @@ urKernelGetSubGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice,
206206
// Two calls to urDeviceGetInfo are needed: the first determines the size
207207
// required to store the result, and the second returns the actual size
208208
// values.
209-
ur_result_t URRet =
210-
urDeviceGetInfo(hDevice, UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, 0,
211-
nullptr, &ResultSize);
212-
if (URRet != UR_RESULT_SUCCESS) {
213-
return URRet;
214-
}
215-
assert(ResultSize % sizeof(size_t) == 0);
216-
std::vector<size_t> Result(ResultSize / sizeof(size_t));
217-
URRet = urDeviceGetInfo(hDevice, UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL,
218-
ResultSize, Result.data(), nullptr);
219-
if (URRet != UR_RESULT_SUCCESS) {
220-
return URRet;
221-
}
209+
UR_RETURN_ON_FAILURE(urDeviceGetInfo(hDevice,
210+
UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL,
211+
0, nullptr, &ResultSize));
212+
assert(ResultSize % sizeof(uint32_t) == 0);
213+
std::vector<uint32_t> Result(ResultSize / sizeof(uint32_t));
214+
UR_RETURN_ON_FAILURE(urDeviceGetInfo(hDevice,
215+
UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL,
216+
ResultSize, Result.data(), nullptr));
222217
RetVal = *std::max_element(Result.begin(), Result.end());
223218
Ret = CL_SUCCESS;
224219
} else if (propName == UR_KERNEL_SUB_GROUP_INFO_SUB_GROUP_SIZE_INTEL) {

0 commit comments

Comments
 (0)