To reduce differences between tests, remove APPLE specific code from
unary tests as no other test have similar logic.
Ensure gMeasureTimes is consistently initialised regardless of operating
systems to ensure a consistent command line interface.
The remaining APPLE specific pieces of code relate either to include
paths, or to the implementation of PreventSleep(), ResumeSleep() and
GetTime(). Those are not removed in this commit.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Make signature of BuildKernel more consistent across tests: now only two
variants exist:
int BuildKernel(const char *name, int vectorSize, cl_kernel *k,
cl_program *p, bool relaxedMode)
or
int BuildKernel(const char *name/symbol, int vectorSize,
cl_uint kernel_count, cl_kernel *k, cl_program *p,
bool relaxedMode)
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
When invoking for example
test_c11_atomics test-that-does-not-exist
parseAndCallCommandLineTests() would attempt to dereference
`resultTestList` which is still a null pointer.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Add tests to proposed new builtin async_copy functions with a bug fix.
* Revert "Add tests to proposed new builtin async_copy functions with a bug fix."
This reverts commit 7d0f16d014.
* Add tests to proposed new builtin async_copy functions.
* Added is_extension_available to check if an extension is available.
* Added is extension available for test_async_copy_fence.
* fix build issues on windows.
* include algorithms.h for async copy 2D/3D.
* adding algorithms header.
* Fix numLines - 1 in maxTotalPlanesIn/Out.
* fix formatting violations.
* fixed formatting issue.
Improve format.
The binary_operator tests are left untouched by this commit as they
require some non-automatic changes.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Fix possible size_t overflow in 32-bit builds.
Use cl_ulong temporary values for row/slice_pitch.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* Remove redundant casts
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Code is moved to reduce the differences between tests for single- and
double-precision.
Improve consistency in double-literal.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Add assertion to prove isNextafter is true iff the builtin is nextafter()
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Fold functions for nextafter
There is no need to differentiate nextafter() from other binary builtin
functions when creating the vtbl entries.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
clCopyImage and clFillImage contain near-duplicate code for logging of
pixel difference errors. Move this into imageHelpers.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
Improve math_brute_force kernels by consistently using size_t to store
the result of get_global_id().
This change was missed in 5d7be40e (Remove undesired conversions from
size_t to int (#1153), 2021-02-11).
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Because specialValuesInt2Count < specialValuesIntCount (when correctly
computed), there was no out-of-bound access when running the tests. This
also means additional cases will be covered now that the typo is fixed.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Split math_brute_force files
Split each file into two: one covering float and the other covering
double. The goal is to make it possible to diff files to identify bugs
more easily, reduce differences between code for float and double, and
ultimately reduce code duplication in all math_brute_force.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Address clang-format issues
In be936303 (Remove dead code in math_brute_force (#1117), 2021-01-20)
the code was reformatted using git-clang-format, which apparently is less
reliable than clang-format itself when changes occur in large files.
With the previous split of large files, git-clang-format complains about
the format of code originating from binary_two_results_i.cpp.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
This issue was introduced in 8ad1088a (Reduce difference between files
in math_brute_force (#1138), 2021-02-10).
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Move media_sharing tests to test_conformance/extensions/
And rename to cl_khr_dx9_media_sharing.
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
* format code
* more format changes
Moves `if (!gSkipCorrectnessTesting)` in binary_i.cpp to follow
structure of binary.cpp, unary.cpp, macro_unary.cpp and
macro_binary.cpp.
Other non-semantic changes include adding/removing new lines and
updating comments.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
When creating sub-buffers in math_brute_force, the wrong variables were
checked for runtime errors. This patch fixes this and ensures the logs
are consistent.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Improve math_brute_force kernels by consistently using size_t to store
the result of get_global_id().
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Use raw string literals in basic parameter test; NFC
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Change-Id: I294d2aa95c6bab37e5efb7c8b1e43a06d31a0081
* clang-format test_basic_parameter_types.cpp; NFC
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Change-Id: I0792037f5fa6f79d493c099bed15238f0f1486ac
* Reduce differences between files
This will help reduce code duplication is future commits.
Some code is moved around, some variables are renamed and some
statements are slightly altered to reduce differences between files in
math_brute_force, yet the semantics remains the same.
The differences were identified using n-way diffs. Many differences
remain however.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Workaround clang-format limitation
Introduces some insignificant spaces to force clang-format to reduce the
indentation and reduce differences between files.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Implement Negative Tests for clPlatform Functions
This change introduces negative tests for clPlatform
functions as well as changes to the Harness to help with
other negative tests.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Remove magic macro from Negative Platform Tests
This change removes the negative-testing macro and all
other changes related to its usage.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
The current test would always end up assuming a minimum of 16 KB
regardless of the exposed OpenCL version, and the logic for testing the
OpenCL version was hard to follow.
Besides fixing the test for OpenCL 1.1 through 2.1, it also
* adds support for OpenCL 2.2, 3.0, and future OpenCL versions (as long
as `get_device_cl_version()` supports those);
* adapts the error message to mention the currently exposed OpenCL
version rather than a hardcoded OpenCL 1.1;
* reports the advertised local memory size as KB and not Kb, since local
memory size is given in bytes.
Ensure the following forms of command lines are supported, as per usage
message (-h):
- math_brute_force [<name1> [<name2> ... [<nameN>]]]
- math_brute_force I [J]
Remove dead/unnecessary code.
Fix regression introduced in f337e0b6 ( Fix command-line function range
for bruteforce (#1127), 2021-01-29).
Signed-off-by: Marco Antognini <marco.antognini@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>
* 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.
* Handle NULL hostptr in conformance image tests
As per the spec, clCreateBuffer and clCreateImage return
CL_INVALID_HOST_PTR if host_ptr is NULL
and CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are set in flags
or if host_ptr is not NULL
but CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are not set in flags."
Host pointer should be NULL when USE/COPY_HOST_PTR is not set in flags.
* Revert "Handle NULL hostptr in conformance image tests"
This reverts commit 49fa049f9b.
* Move cl_mem_flag and host_ptr check to ImageHelper
Add a check to see if cl_mem_flag has
USE_HOST_PTR or COPY_HOST_PTR.
Override host_ptr with NULL if none of them
are specified.
* Minor fixes for clCopyImage.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Change-Id: I63c47570e45580e5e29716a46929cb1127711c6b
* Convert comment to CTS style.
Return error code instead of -1 in clFinish.
* 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.
* Fix malloc-size calculation in test imagedim
unsigned char size is silently assumed to be 1
in imagedim test of test_basic.
Pass sizeof(type) in malloc size calculation.
Also, change loop variable from signed to unsigned.
Add checks for null pointer for malloced memory.
* Fix command-line function range for bruteforce
Runnning "test_bruteforce N M" is expected to skip
first N functions and test M functions after it.
When N is 0, the test currently skips M functions
and run all functions thereafter.
Fix the test to honor semantics of these
command-line options to correctly test
first M functions when N is 0.
Previously this file used the auto keyword to
declare a string. This can cause compilation
issues when used in a later function.
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@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.
* Fix malloc-size calculation in test imagedim
unsigned char size is silently assumed to be 1
in imagedim test of test_basic.
Pass sizeof(type) in malloc size calculation.
Also, change loop variable from signed to unsigned.
Add checks for null pointer for malloced memory.
* Use size_t instead of int for imagedim
The size calculation for image with larger dimensions
is overflowing with int values.
Change image dim variables to use size_t
to avoid overflow.
While at it, fix formatting at various places.
* Use new instead of malloc in test imagedim
Use new and delete in place of malloc
and free through test_basic imagedim
to avoid NULL pointer checks.
* Revert sizeof changes from size calculation
As the types of width and height are now
changed to size_t, sizeof is not required
in size calculation.
Revert the same.
* Remove dead code
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Remove tautological statements
PARALLEL_REFERENCE is unconditionally defined. Remove preprocessor
condition that always hold.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Remove unnecessary declarations
Also removed unused macro.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Format code
An unnecessary scope was removed. This formats the code using
clang-format.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>