Move the global `-Wno-format` compiler option to the individual tests
that still trigger Wformat warnings. The majority of the tests now
compile cleanly with `-Wformat` enabled.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
test_copy_1D.cpp: num_mip_levels is a cl_uint, so don't cast and just
print using `%u`.
test_pipe_info.cpp: arg_type_qualifier is a 64-bit wide bitfield, so
print in hexadecimal format using the correct length modifier.
test_device_partition.cpp: it is not clear what the bit width of
`cl_device_partition_property` should be, so cast the operands to align
with the format specifiers.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Fix a "format string is not a string literal (potentially insecure)"
warning.
There is no security issue here as the format string argument is
constructed using a stringstream right before. Fix this occurrence
anyway to allow enabling the warning globally.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The values in `src` are indices into an array in `get_order_string()`.
Not initializing `src` resulted in out of bounds accesses there.
It seems that when the out of bounds accesses happened, the result of
`get_order_string()` was not actually used, so at least the test was not
using random data. Fix the issue as it prevents a clean run of this test
with e.g. AddressSanitizer.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
`inOrderStr` and `outOrderStr` are both written into `orderName`,
which may not fit as all three are the same size. Decrease the sizes
of `inOrderStr` and `outOrderStr`. The new sizes are still
sufficiently large to hold the result of `get_order_string`.
This commit only affects the error path and does not change the
printed output. Error logs before and after this commit should not
differ.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Added cl_khr_fp16 extension support for commonfns test (issue #142, commonfns)
* Added missing header due to presubmit check
* Corrected radians/degrees ulp calculations + cosmetic fixes
* Corrected presubmit code format
* Corrections related to code review
* Moved string format helper to test_common in separate header
* Added clang format for last commit
* Corrections related to code review
* Modified mix verification procedure for half type to only report max error
* Removed redundant condition for logging mix verification
* Corrected generator limits for half tests
Names that begin with an underscore followed by an uppercase letter
are reserved for the C++ implementation.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
With GCC 13 some headers are no longer included transitively through
C++ Standard Library headers.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Added cl_khr_fp16 support for test_relationals (issue #142, relationals)
* Added cl_khr_fp16 support for any and bitselect test cases (issue #142, relationals)
* correction related to automated travis build for macOS (issue #142, relationals)
* more corrections related to automated travis build for macOS (issue #142, relationals)
* Added few cosmetic corrections (issue #142, test_relationals)
* Added missing clang format
* Added corrections related to order of initialization
* Added corrections due to code review (issue #142, relationals)
* Correction for prev commit
* Added subnormals related condition for test verification (issue #142, relationals)
* Added indexing correction due to code review
* Replaced hardcoded iteration limit (issue #142, relationals)
To the best of my understanding, these occurrences of the
`-Wunused-but-set` warnings do not reveal any underlying issues, so we
can safely remove these variables. There are more occurrences of this
warning in other places (not touched by this commit) that require
further analysis.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* [NFC] Remove duplicate symbol declarations
Those are provided by testHarness.h.
Signed-off-by: Kévin Petit <kpet@free.fr>
* add missing include
---------
Signed-off-by: Kévin Petit <kpet@free.fr>
print_hex_mem_dump was calling `sprintf` with source and destination
buffers overlapping, which is explicitly forbidden. Rewrite the
function to use C++ stringstreams instead.
This commit only affects the error path and does not change the
printed output. Error logs before and after this commit should not
differ.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
It only contains a pointer type definition for test functions that
really ought to be provided by testHarness.h.
Signed-off-by: Kévin Petit <kpet@free.fr>
Signed-off-by: Kévin Petit <kpet@free.fr>
Remove a misleading comment at the end. Improve comments in general,
and use `true`/`false` for `bool`s.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
It seems the intent was to use `.xyzw` vector component accessors in
the kernel whenever `vecSize` is 2, 3, or 4. The condition was wrong
(i.e., always true for any value of `vecSize`), causing it to always
create a kernel with numeric (`.s0123...`) vector component accessors.
The restriction on the use of `.xyzw` for 8 and 16-component vectors
has been lifted a while ago (see
https://github.com/KhronosGroup/OpenCL-Docs/issues/549) so we do not
need this check at all.
Also, fix the `vecSize` argument of two calls of `get_order_string`
when getting the order string for the "in" kernel argument. Pass
`inVecSize` in these cases, not `outVecSize`.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* 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>