Remove the unused `numItems` variable.
As this fixes all occurrences of this warning in test_basic, remove
the suppression flag.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Added cl_khr_fp16 extension support for vector_creation test from basic
* Added corrections related to vendor's review
* Added protection to avoid similar creation cases
* Added comment for recent correction
* cosmetics
* Corrected factor array to restore lost capacity of original test..
leaving only 16-sizes vector tests limited.
The latest version of the cl_khr_extended_async_copies extension uses
element size rather the element type as its base. The means it can be
called with arbitrary and in particular non power of 2 sizes, such as 3
or 13.
Update the test_async_copy2D and test_async_copy3D tests to make them
element size based rather than type based.
As well as this run all tests that can fit into the memory of the
target rather than presumed large elements cannot fit.
Make some addtional good practice changes in terms of const usage,
declaring variables where they are use, and usage of iterators.
The test coverage increases from 1224 cases to 1332 cases for the
test_async_copy2D and test_async_copy3D cases.
Ticket: #1579
Signed-off-by: Chris Gearing <chris.gearing@mobileye.com>
Co-authored-by: Chris Gearing <chris.gearing@mobileye.com>
* Added support for cl_khr_fp16 extenstion in test_astype from basic (issue #142, basic)
* Added correction to iterate over vector of types
* Fixed case with both fp16 and fp64 supported
* Cosmetic corrections due to code review
* Cosmetic corrections due to code review
* 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>