Move functions in .h files to .cpp files where appropriate; align
prototypes and definitions; and remove functions that are not used.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* images: Stop checking gDeviceType != CL_DEVICE_TYPE_GPU
If the device type also advertises CL_DEVICE_TYPE_DEFAULT (which should
be valid), this causes it to be considered a CPU device and the tests
enforce different precision and rounding expectations.
* Fix clang-format
* Drop redundant NORM_OFFSET checks
* Move common global variable and functions to header
InitFloatCoords for 3D read images has also been renamed
so it can later be used as a common function
Contributes #616
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Set-up for using 3D functions as a base
test_read_image_3D had been moved to common.cpp (and renamed
test_read_image) along with corresponding
determine_validation_error_offset and InitFloatCoords.
Only function names and the formatting have been changed.
Contributes #616
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Use std::vector for format lists in images suite
Avoids memory deallocation issues and generally simplifies the code.
* Fixup formatting with git-clang-format
These declarations either aren't used or aren't needed, as testBase.h
already declares them.
Some definitions got moved to test_common.h, as these are duplicated
across few files. There's further opportunity to improve code reuse
via test_common.h, but that's for future patch.
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
Fix validate_float/half_write_results so that when nan/inf is
encountered on a channel, the rest of the channel values are still
considered for correctness.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Signed-off-by: James Morrissey <james.morrissey@arm.com>
Co-authored-by: John Kesapides <john.kesapides@arm.com>
* Enable -Werror for GCC/Clang builds
Fixes many of the errors this produces, and disables a handful that
didn't have solutions that were obvious (to me).
* Check for `-W*` flags empirically
* Remove cl_APPLE_fp64_basic_ops support
* Undo NAN conversion fix
* Add comments to warning override flags
* Remove unneeded STRINGIFY definition
* Fix tautological compare issue in basic
* Use ABS_ERROR macro in image tests
* Use fabs for ABS_ERROR macro
* Move ABS_ERROR definition to common header
* Allow CL_HALF_FLOAT denorm flushing for write tests (#452)
* On mismatch, add relaxation when denormal half result is expected
* Refactor to use common validation function
* Clean up some diagnostics
* Fix review comments
- use cl_half
- remove extraneous casts
- replace literals with sizeof()
* Document rollover trick for IsHalfSubnormal
* set gDeviceType in testharness.c, also moved gTestRounding to imageHelpers.cpp & .h and removed duplicate code from host_atomics.cpp
* Cleaned up some redundant code
* Reversed the change in testharness.c
* Moved all instances of gDeviceType to imageHelper.cpp
* Missed one instance of gDeviceType
* Removed all instances of extern cl_device_type gDeviceType, except in imageHelpers.h
* Require exact for match normals, instead of arbitrary .005 relative error
* Add relaxation to allow 0 when float denormal is expected
* Refactor to use common validation function
Some of the setup functionality is already there in the test harness, so
use that and remove the duplicated code from within the suite.
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>