* Use std::vector for format lists in images suite
Avoids memory deallocation issues and generally simplifies the code.
* Fixup formatting with git-clang-format
In OpenCL spec 1.1:
"Prior to calling clEnqueueAcquireGLObjects, the application must ensure that any pending GL
operations which access the objects specified in mem_objects have completed. This may be
accomplished portably by issuing and waiting for completion of a glFinish command on all GL
contexts with pending references to these objects."
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Add tests for API extension for compilation
of kernels in C++ for OpenCL language.
* Test that -cl-std=CLC++ is accepted and a
basic kernel with C++ features is compiled.
* Test that API extension reports the same
language version as __OPENCL_CPP_VERSION__.
This commit also adds a separate folder for extension
tests.
Signed-off-by: Victoria Holodovsky <victoria.holodovsky@arm.com>
Co-authored-by: Victoria Holodovsky <victoria.holodovsky@arm.com>
The test was trying to create read_write image with read_only formats.
Make it use common image formats for both read_only and read_write
flags when creating images.
Fixes issue #329
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
Signed-off-by: James Morrissey <james.morrissey@arm.com>
Co-authored-by: Radek Szymanski <radek.szymanski@arm.com>
Test was querying for supported images with CL_MEM_WRITE_ONLY flag, but
always used CL_MEM_READ_ONLY to create images.
Fixes issue #328
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
Signed-off-by: James Morrissey <james.morrissey@arm.com>
Co-authored-by: Radek Szymanski <radek.szymanski@arm.com>
* Validate CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED
Adding test to validate value returned from clGetDeviceInfo with
CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED.
Fixes#993
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Fixes for formatting on computeinfo add tests
Fixes#993
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Restored the embedded reduction factor to bruteforce.
This change was present on the GitLab branch but missed out during the transition to GitHub.
This change is intentionally as close as possible to the patch on GitLab.
Fixes#1045
* Added helper functions for bruteforce step and scale.
* Added missing files from 1e4d19b.
* Renamed getTestScale and getTestStep to set*.
* Using helper functions for clCreateKernel
Uses of clCreateKernel following create program helper
functions, have been incorporated into
create_single_kernel_helper when suitable.
Contributes #31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Skip tests using clCompileProgram in offline mode
Contributes #31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Using type wrappers when using kernel helper functions
Also includes fix for windows build
Fixes#31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Remove clReleaseKernel for wrapped kernel
Fixes#31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
In this test we repeated call create_single_kernel_helper
to create different kernels but reuse the same clProgramWrapper.
create_single_kernel_helper() creates a new program each time it
is called, creating a new reference on the underlying context.
When the test ends, the program is released (as it should when
using the clProgramWrapper), however there are multiple program
objects attached to the context resulting in reference leak errors.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Fix implicit int->float warning inside kernel
This kernel is used to test various compiler options including
-Werror. Some compilers produce a warning about the implicit
conversion which results in this test failing when -Werror is used.
* Fix formatting
TEST_SKIPPED_ITSELF was originally located in
threadTesting.h but this no longer makes sense.
This change moves the definition to the test_status
struct in testHarness so that it can be used in the same
way that test_status' can be used.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Making object queries tests exhaustive
Tests which were only testing fixed values have been made exhaustive
and refactored. They only use properties from the core spec.
Associated Macros have been turned into templated functions.
Comparison of devices with cl_device_id rather than vendor ids.
All object queries tests are now in test_queries.cpp.
Fixes#508
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Remove unnecessary arguments from test_queries.cpp functions
Fixes#508
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Using test_assert_error in test_queries.cpp
This commit also fixes the queue properties array and
corrects for on device queues being optional in CL3.0
test_queries_compatibility.cpp has been removed as
tests are now in test_queries.cpp
Contributes #508
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Correct api test boolean for device queue support
Contributes #508
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Use memcmp for select verification.
If memcmp fails, fall back to looping through the result buffer to find the incorrect result.
* Removed extra prints for check_int.
* Reduce number of compilations in buffer suite
Extracts program and kernel compilation from mem_flags loop
as they were being recompiled unnecessarily.
Fixes#1020
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Remove misplaced frees in buffer tests
Contributes #1020
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@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>
* Add relaxed tests for functions (in an implementation that uses
derived functions) that define an absolute ULP error requirement, but
were not tested in the current conformance suite
* acos
* asin
* atan
* cospi
* sinpi
* log10
The get_device_il_version_string() function throws an exception if the
device does not support the CL_DEVICE_IL_VERSION query, so don't call
this unless the version is recent enough.
Pass the right flags to the tests that create images to ensure valid
usage.
Fixes issue #330
Signed-off-by: James Morrissey <james.morrissey@arm.com>
Co-authored-by: Alessandro Navone <alessandro.navone@arm.com>
OpenCL-C code must respect aliasing rules as in C99.
Therefore, accessing data from multiple pointer sizes
must all point to character type to keep strict aliasing
rules. If not, when the compiler performs optimization,
the dataflow was broken leading to failure.
We also fix the formatting and refactor few things.
These declarations either aren't used or aren't needed, as testBase.h
already declares them.
Some definitions got moved to test_common.h, as these are duplicated
across few files. There's further opportunity to improve code reuse
via test_common.h, but that's for future patch.
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
* Add kernel private memory size to CMake build
* Fix kernel private memory size build error
* Use uint for kernel private memory size test
Not all devices support 64-bit types.
* Register kernel private memory size test
Implement a test to ensure that the CL_KERNEL_PRIVATE_MEM_SIZE
flag for clGetKernelWorkGroupInfo passes.
Change-Id: Ibd6d64d185c00ddbd23467692717c534498bb901
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Reimplement buffer tests
Reintegrated and fixed test code for buffer tests buffer_read_half and
buffer_write_half tests.
Added mem_alloc_ref_flags test code, as was previously non-existent,
to test CL_MEM_ALLOC_HOST_PTR. This flag was otherwise untested and
as similar tests within the suite are used to test other cl_mem_flags
it has been assumed that this was the purpose of the test.
Fixes#439
Change-Id: I5accf986be7436d09377d0bfd7afd5de2235c329
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* move mem_read_write_flags to a common function
Code under mem_*_flags tests have a lot of duplication, this is
the first step of moving test code to a common function.
Contributes #439
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* move mem_write_only_flags test code to a common function
Code under mem_*_flags tests have a lot of duplication
Contributes #439
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* move mem_read_only_flags test code to a common function
Code under mem_*_flags tests have a lot of duplication
Contributes #439
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* move mem_copy_host_flags test code to a common function
Code under mem_*_flags tests have a lot of duplication, moved
mem_copy_host_flags code and rearranged function where appropriate
mem_ref_alloc_flags test also uses common function.
Contributes #439
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Remove unused NOT_IMPLEMENTED_TEST macro
This define is not in use anymore, since tests have been
reimplemented in #439. Tests should be working and implemented
or not registered.
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
- [x] Skip the `features_macro` test in offline mode since it makes
calls to `create_single_kernel_helper_create_program` and fails when the
call doesn't return `CL_SUCCESS` which will happen when the offline
compiler fails to compile the kernel which is deliberately supposed to
fail compilation in this test.
* Remove unused code in clCopyImage
Some of the declarations that are still used now moved to testBase.h
as these are reused throughout the image tests.
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
* Add missing file
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
* Add memory_scope_all_devices testing
This duplicats memory_scope_all_svm_devices testing, but it seems pretty quick
so I don't think it hurts.
Fixes#990
* Address clang-format failures
* Address a further clang-format failure
* Remove binaries for spirv_new (#21)
Avoid storing binaries in version control, as it is generally not well
suited to this. Instead, in a followup commit we will add a script to
regenerate the .spv files from their sources.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
* Add Python script to assemble spirv_new binaries (#21)
This also changes the ext_cl_khr_spirv_no_integer_wrap_decoration assembly
source so that the SPIR-V version is listed as 1.0, to ensure that the
output of spirv-dis exactly matches the assembly.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
The following tests make calls to `clCompileProgram` or
`clBuildProgram` and therefore require a compiler in the runtime:
* `unload_repeated`
* `unload_compile_unload_link`
* `unload_build_unload_create_kernel`
* `unload_link_different↩`
* `unload_build_threaded`
* `unload_build_info`
* `unload_program_binaries`
Skip these tests if no compiler is present in the runtime.