* Removed hardcoded -cl-std=CL2.0 build option from progvar tests
Fixes issue #1380https://github.com/KhronosGroup/OpenCL-CTS/issues/1380
These changes will query the device for the latest supported CL C
version instead of using a hardcoded value. The create_single_kernel_helper
function queries for the latest CL C version internally, so calls to
create_single_kernel_helper_with_build_options were replaced with calls
to create_single_kernel_helper instead.
* Fixed formatting
Only disable `-Wunused-but-set-variable` for tests that do not compile
cleanly with this warning enabled. This re-enables the warning for
most other tests, so that it can catch any new occurrences.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
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>
There is no particular reason to limit the domain of unsigned 32-bit
integers in the input, so use genrand_int32 directly.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
Fail when an unhandled image format is encountered instead of
continuing validation with uninitialized variables.
Fixes a `-Wsometimes-uninitialized` warning for e.g. the `tolerance`
variable.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
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>
* Deduplicate write_image
Merge writeimage,writeimage_int16,writeimage_fp32
as they share a lot of common code.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* Test for CL_MEM_WRITE_ONLY and CL_MEM_READ_WRITE.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* Rename test_flags to img_flags
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Merge readimage,readimage_int16,read_image_fp32,
readimage3d,readimage3d_int16,read_image3d_fp32
as they share a lot of common code.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Merge fpmath_float,fpmath_float2,fpmath_float4
as they share a lot of common code.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Fix a few instances where an incorrect number of arguments was
supplied when calling (v)log_error.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Manually reformat the `prog_src` variable which contains kernel code
and disable clang-format on it.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The condition inside the assert is dropped in Release builds, so
`num_printed` becomes unused.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Remove unused variables throughout the code base and enable the
`-Wunused-variable` warning flag globally to prevent new unused
variable issues being introduced in the future.
This is mostly a non-functional change, with one exception:
- In `test_conformance/api/test_kernel_arg_info.cpp`, an error check
of the clGetDeviceInfo return value was added.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Update cl_khr_extended_async_copies tests to the latest version of the extension
Update the 2D and 3D extended async copies tests. Previously they were based on
an older provisional version of the extension.
Also update the variable names to only use 'stride' to refer to the actual
stride values. Previously the tests used 'stride' to refer to the end of one
line or plane and the start of the next. This is not the commonly understood
meaning.
* Address cl_khr_extended_async_copies PR feedback
* Remove unnecessary parenthesis in kernel code
* Make variables `const` and rearrange so that we can reuse
variables, rather than repeating expressions.
* Add in missing vector size of 3 for 2D tests
* Use C++ String literals for kernel code
Rather than C strings use C++11 string literals to define the
kernel code in the extended async-copy tests. Doing this makes
the kernel code more readable.
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
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.
* 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.
* 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
* 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.
* 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>
* initial version, tests vec2 and vec4
* added all types and vector sizes
* fix formatting
* add checks for long and ulong support
* test floats unconditionally, not tied to long support (oops)
* fix for vec3 kernel arguments
* remove generic address space dependency
* Skip `rw_image_access_qualifier` if images are not supported.
* Skip `rw_image_access_qualifier` if read-write images are optionally
not supported on a OpenCL-3.0 or later device.
* Stop assuming `-cl-std=CL3.0` and default to latest OpenCL C supported
by the device.
* Dynamically select the `-cl-std` option on the basic `sizeof` and
`wg_barrier` tests to be one of `CL1.X`, `CL2.0` or `CL3.0`.
Use the most recent CL C standard supported on the device.
* `test_enqueued_local_size` will be skipped for OpenCL < 2.0. However,
non-uniform work-groups became optional in 3.0 and so check that they
are supported before running `test_enqueued_local_size`. If they are not
suppported round the global sizes up to the next multiple of the local
size, so that we can still test that `get_enqueued_local_size() ==
get_local_size()` in the case of uniform workgroups.
* 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