As the extension is vector size and type independent, we only need to
check for the extension once per test and not for every possible
combination of inputs, thereby drastically reducing the log output of
the test when the extension is not supported.
Fix heap-buffer-overflow reported by AddressSanitizer: ensure the
appropriate number of elements are allocated for the list of tests.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Builtin functions producing two results can have their worst error, for
each result, on different inputs. Report both inputs.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Make variables local to loops, with appropriate types. These variables
are not read after the loop without being reset first, so this patch
doesn't change behaviour.
These variables should now be used for one purpose only, making it
easier to reason about the code. This will make future refactoring
easier.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Remove CMake statements that have no effect in math_brute_force.
set_source_files_properties without a list of files has no effect.
When MODULE_NAME is FOO,
set_source_files_properties(${MODULE_NAME}_SOURCES ...) sets the
properties of "FOO_SOURCES", not of the files listed in the variable
named FOO_SOURCES.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Part of the negative CTS test for clGetPlatformInfo
incorrectly tested with a NULL platform. As this is a
special case it meant that the test was not correct.
This change removes the incorrect part of the test so that
it conforms with the OpenCL specification.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
gWimpyBufferSize is never modified and is actually not used to modify
the number of tests -- gWimpyReductionFactor is used for that purpose by
some tests, but not all.
This patch removes this unnecessary global variable to simplify the
codebase, and reduce differences between tests.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
Use one loop to read buffers from device, with the last read operation
blocking until complete.
This pattern cannot be elegantly refactored just yet, mainly for two
reasons:
- Some tests use goto statements to clean their resources.
- Some tests (not modified in this patch) only use blocking read
operations.
Once code is further unified, this pattern can be refactored into a
helper function.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Make variables and functions local to translation unit
Make some global variables local to function, or remove them when
actually dead.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Address comments
Remove unused code.
Reduce scope of gDoubleCapabilities.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Remove code for runtime measurement
The GetTime() and associated functions are not fully implemented on
Linux. This functionality is assumed to be untested, or unused at best.
Reduce differences between tests by removing this unnecessary feature.
It can be (re-)implemented later, if desired, once the math_brute_force
component is in better shape.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Coalesce if-statements
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* Keep else branch
Address comments.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
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>