Repository navigation
Conversation
| error = clGetKernelWorkGroupInfo(kernel, device, CL_KERNEL_WORK_GROUP_SIZE, | ||
| sizeof(maxWorkGroupSize), | ||
| &maxWorkGroupSize, NULL); | ||
| test_error(error, "Unable to get max work group size from kernel"); | ||
|
|
||
| cl_uint maxThreadDim = 0; | ||
| error = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, | ||
| sizeof(maxThreadDim), &maxThreadDim, NULL); | ||
| test_error(error, "Unable to get max work item dimensions from device"); | ||
|
|
||
| std::vector<size_t> workGroupMaxSizes(maxThreadDim, 0); | ||
| error = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZES, | ||
| sizeof(size_t) * workGroupMaxSizes.size(), | ||
| workGroupMaxSizes.data(), NULL); | ||
| test_error(error, "Unable to get max work group sizes from device"); |
There was a problem hiding this comment.
I think we can use get_max_allowed_1d_work_group_size_on_device(device, kernel, &maxWorkGroupSize) from harness/kernelHelpers.h here instead of querying CL_KERNEL_WORK_GROUP_SIZE, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, and CL_DEVICE_MAX_WORK_GROUP_SIZES manually.
| error = clGetKernelWorkGroupInfo(kernel, device, CL_KERNEL_WORK_GROUP_SIZE, | |
| sizeof(maxWorkGroupSize), | |
| &maxWorkGroupSize, NULL); | |
| test_error(error, "Unable to get max work group size from kernel"); | |
| cl_uint maxThreadDim = 0; | |
| error = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, | |
| sizeof(maxThreadDim), &maxThreadDim, NULL); | |
| test_error(error, "Unable to get max work item dimensions from device"); | |
| std::vector<size_t> workGroupMaxSizes(maxThreadDim, 0); | |
| error = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZES, | |
| sizeof(size_t) * workGroupMaxSizes.size(), | |
| workGroupMaxSizes.data(), NULL); | |
| test_error(error, "Unable to get max work group sizes from device"); | |
| error = get_max_allowed_1d_work_group_size_on_device(device, kernel, | |
| &maxWorkGroupSize); | |
| test_error(error, "get_max_allowed_1d_work_group_size_on_device failed"); |
| const Version version = get_device_cl_version(device); | ||
| cl_bool nonUniformSupport = CL_FALSE; | ||
| if (version >= Version(3, 0)) | ||
| { | ||
| error = clGetDeviceInfo( | ||
| device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, | ||
| sizeof(nonUniformSupport), &nonUniformSupport, NULL); | ||
| test_error(error, | ||
| "Unable to query CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT"); | ||
| } | ||
| else if (version >= Version(2, 0)) | ||
| { | ||
| nonUniformSupport = CL_TRUE; | ||
| } | ||
|
|
||
| if (nonUniformSupport == CL_FALSE) | ||
| { | ||
| log_info("Device does not support non-uniform work-groups, skipping " | ||
| "test\n"); | ||
| return TEST_SKIPPED_ITSELF; | ||
| } |
There was a problem hiding this comment.
Do we actually need to skip when nonUniformSupport == CL_FALSE? Even on OpenCL 1.2 devices (or OpenCL 3.0 devices without non-uniform work-group support), clEnqueueNDRangeKernel is still required to return CL_INVALID_WORK_GROUP_SIZE for this enqueue. Removing this check would simplify the test and also cover OpenCL 1.2 devices (which aren't covered by consistency_non_uniform_work_group or options_uniform_work_group_size).
There was a problem hiding this comment.
yep, good point - corrected
|
Please rebase |
d490fa4 to
a852383
Compare
Related to #2790.
Checks that
clEnqueueNDRangeKernelreturnsCL_INVALID_WORK_GROUP_SIZEfor a non-uniform work-group when the program is built from source without -cl-std, so it is compiled for OpenCL C 1.x, on a device that supports non-uniform work-groups.[run-test: test_api negative_enqueue_non_uniform_work_group_size]