non_uniform_work_group: fix unused-but-set variables (#1733)

Remove the unused `nonRemainderGlobalSize` array.  Inspect the result
of the `clGetDeviceInfo` call.

As this fixes all occurrences of this warning, remove the suppression
flag from this test.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2023-06-05 11:45:25 +01:00
committed by GitHub
parent ce17549812
commit 63a8cb6b9d
2 changed files with 5 additions and 7 deletions

View File

@@ -10,8 +10,6 @@ set(${MODULE_NAME}_SOURCES
tools.cpp
)
set_gnulike_module_compile_flags("-Wno-unused-but-set-variable")
include(../CMakeCommon.txt)
# end of file #

View File

@@ -448,13 +448,8 @@ void TestNonUniformWorkGroup::verifyData (DataContainerAttrib * reference, DataC
}
void TestNonUniformWorkGroup::calculateExpectedValues () {
size_t nonRemainderGlobalSize[MAX_DIMS];
size_t numberOfPossibleRegions[MAX_DIMS];
nonRemainderGlobalSize[0] = _globalSize[0] - (_globalSize[0] % _enqueuedLocalSize[0]);
nonRemainderGlobalSize[1] = _globalSize[1] - (_globalSize[1] % _enqueuedLocalSize[1]);
nonRemainderGlobalSize[2] = _globalSize[2] - (_globalSize[2] % _enqueuedLocalSize[2]);
numberOfPossibleRegions[0] = (_globalSize[0]>1)?2:1;
numberOfPossibleRegions[1] = (_globalSize[1]>1)?2:1;
numberOfPossibleRegions[2] = (_globalSize[2]>1)?2:1;
@@ -502,6 +497,11 @@ size_t TestNonUniformWorkGroup::getMaxLocalWorkgroupSize (const cl_device_id &de
if (TestNonUniformWorkGroup::_maxLocalWorkgroupSize == 0) {
err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE,
sizeof(TestNonUniformWorkGroup::_maxLocalWorkgroupSize), &TestNonUniformWorkGroup::_maxLocalWorkgroupSize, NULL);
if (err)
{
log_error("clGetDeviceInfo failed\n");
return 0;
}
}
return TestNonUniformWorkGroup::_maxLocalWorkgroupSize;