* 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
* Minor fixes for CL_UNORM_SHORT_565, CL_UNORM_SHORT_555
* Fix verification for undefined bit
* Relax current infinitely precision requirement for these formats
and move check in common function.
* Add proper debug output.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* Minor Formating fix.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* 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
* Tests requiring image support use runTestHarnessWithCheck
Removing special case for images in runTestHarness.
Fixes#710
* Remove imageSupportRequired argument
Tests which require image support now specify this while
calling runTestHarnessWithCheck.
Fixes#710
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
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>
* Fix enqueue_flags test to use correct barrier type.
Currently, enqueue_flags test uses CLK_LOCAL_MEM_FENCE.
Use CLK_GLOBAL_MEM_FENCE instead as all threads across work-groups
need to wait here.
* Add check for support for Read-Wrie images
Read-Write images have required OpenCL 2.x.
Read-Write image tests are already being skipped
for 1.x devices.
With OpenCL 3.0, read-write images being optional,
the tests should be run or skipped
depending on the implementation support.
Add a check to decide if Read-Write images are
supported or required to be supported depending
on OpenCL version and decide if the tests should
be run on skipped.
Fixes issue #894
* Fix formatting in case of Read-Write image checks.
Fix formatting in case of Read-write image checks.
Also, combine two ifs into one in case of
kerne_read_write tests
* Fix some more formatting for RW-image checks
Remove unnecessary spaces at various places.
Also, fix lengthy lines.
* skip test cases rather than fail without cl_khr_3d_image_writes
cl_khr_3d_image_writes is required for OpenCL 2.x devices, but is not
required for OpenCL 1.x or OpenCL 3.0 devices. A check for the presence
of the extension on OpenCL 2.x devices already exists in
test_min_max_device_version, so we don't need any failure conditions
here, and can just skip tests if the extension is not supported.
* clang-format changes
* 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
This moves the filter_formats and get_format_list functions to a common
file. These functions were roughly the same, with an optional filtering
in some tests for testing mipmaps.
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
* 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
Removing all references to check_opencl_version as similar
get_device_cl_version() can be used instead.
Fixes#527
Change-Id: I474b6f536033707e1beb9b5b39410de24672c040
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* 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
This removes all the duplicated code from each test, and moves it to
test harness so that we have single place where this information is
printed.
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
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>