cl20: Khronos Bug 16080 Fix local work size limit.

Problem: Some tests assume that all local work-items can be used in a
single dimension of an NDRange.

Spec References: OpenCL C 2.0 r19, table 4.3,
CL_DEVICE_MAX_WORK_ITEM_SIZES.

Solution: The overall maximum local work size is trimmed to that of an
NDRange's first dimension or all dimensions, as appropriate.

Test Suite Affected: atomics, non_uniform_work_group, and workgroups.

Side Effects: None

Change-Id: I2e8179ca15c2c090f47ea84d1d3c109dd69ec185
This commit is contained in:
Samuel Pauls
2016-10-05 18:49:15 -04:00
committed by Kévin Petit
parent e0d7ab2187
commit 627c180a31
12 changed files with 129 additions and 72 deletions

View File

@@ -455,6 +455,7 @@ void TestNonUniformWorkGroup::enableStrictMode(bool state) {
int TestNonUniformWorkGroup::prepareDevice () {
int err;
cl_uint device_max_dimensions;
cl_uint i;
if (_globalSize[0] == 0)
{
@@ -462,9 +463,6 @@ int TestNonUniformWorkGroup::prepareDevice () {
return -1;
}
if(_localSize_IsNull == false)
calculateExpectedValues();
err = clGetDeviceInfo(_device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS,
sizeof(device_max_dimensions), &device_max_dimensions, NULL);
test_error(err, "clGetDeviceInfo failed");
@@ -474,6 +472,16 @@ int TestNonUniformWorkGroup::prepareDevice () {
test_error(err, "clGetDeviceInfo failed");
// Trim the local size to the limitations of what the device supports in each dimension.
for (i = 0; i < _dims; i++) {
if(_enqueuedLocalSize[i] > _maxWorkItemSizes[i]) {
_enqueuedLocalSize[i] = _maxWorkItemSizes[i];
}
}
if(_localSize_IsNull == false)
calculateExpectedValues();
std::string buildOptions = BUILD_CL_STD_2_0;
if(_reqdWorkGroupSize[0] != 0 && _reqdWorkGroupSize[1] != 0 && _reqdWorkGroupSize[2] != 0) {
std::ostringstream tmp(" ");