Use CL_KERNEL_WORK_GROUP_SIZE more often (#2435)

Drivers _may_ choose to advertise values for
`CL_DEVICE_MAX_WORK_GROUP_SIZE` or `CL_DEVICE_MAX_WORK_ITEM_SIZES` that
kernels without a `reqd_work_group_size` are not able to be launched
with.

The CTS should therefore make sure that the local_size passed to
`clEnqueueNDRangeKernel` does not exceed `CL_KERNEL_WORK_GROUP_SIZE`

This fixes it up in two places I've noticed this not happening.
This commit is contained in:
Karol Herbst
2025-08-05 23:40:11 +02:00
committed by GitHub
parent 086a6c67fb
commit e2580bded2
2 changed files with 20 additions and 16 deletions

View File

@@ -108,7 +108,11 @@ REGISTER_TEST_VERSION(sub_group_dispatch, Version(2, 1))
nullptr);
test_error(error, "clGetDeviceInfo failed");
max_local = max_work_item_sizes[0];
error = clGetKernelWorkGroupInfo(kernel, device, CL_KERNEL_WORK_GROUP_SIZE,
sizeof(max_local), &max_local, nullptr);
test_error(error, "clGetKernelWorkGroupInfo failed");
max_local = std::min(max_local, max_work_item_sizes[0]);
error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform),
(void *)&platform, NULL);