Commit Graph

730 Commits

Author SHA1 Message Date
Anastasia Stulova
ffa75c37ce Test cl_ext_cxx_for_opencl (#1095)
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>
2021-01-12 10:17:13 +00:00
james-morrissey-arm
901f5fcb63 Fix samplerlessReads read_write (#329) (#1016)
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>
2021-01-11 15:02:26 +00:00
Grzegorz Wawiorko
2597027737 Use highest OpenCL C version (#1081)
* Set the highest supported OpenCL C version.

* Remove gDeviceLt20 variable - not used anymore.

* Fix formatting issues
2021-01-11 13:54:19 +00:00
James Price
f02cbad2e3 Fix scope of clEventWrapper declarations (#1099)
This change allows us to remove the extra clReleaseEvent calls which
were causing double-free issues.
2021-01-10 12:55:25 +00:00
james-morrissey-arm
24e6a9125c Use the right flags when creating images (#328) (#1015)
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>
2021-01-07 12:26:44 +00:00
ellnor01
18c54be0a4 Validate CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED (#1086)
* 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>
2021-01-07 11:39:57 +00:00
Jeremy Kemp
904fb419ee Restored the embedded reduction factor to bruteforce. (#1052)
* 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*.
2021-01-07 11:34:58 +00:00
ellnor01
25d9ff5d6e Using helper functions for clCreateKernel (#1064)
* 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>
2021-01-07 11:34:42 +00:00
Chetan Mistry
85bae70f81 Fix Context Leak in api:clone_kernel (#1090)
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>
2021-01-04 16:13:06 +00:00
James Price
1cd9d084d5 Fix implicit int->float warning inside kernel (#1093)
* 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
2021-01-04 16:12:44 +00:00
ellnor01
42d58be9a3 Use clang-format-9 binary in Github Actions (#1088)
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2021-01-04 15:20:55 +00:00
Chetan Mistry
5f869e1c98 Move TEST_SKIPPED_ITSELF to test_status in testHarness (#1089)
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>
2021-01-04 15:20:19 +00:00
ellnor01
72998af43c Making object queries tests exhaustive (#1008)
* 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>
2021-01-04 15:00:45 +00:00
Jeremy Kemp
3615c4eea6 Use memcmp for select verification. (#1084)
* 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.
2020-12-23 17:05:38 -05:00
ellnor01
cd99c874b2 Reduce number of compilations in buffer suite (#1082)
* 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>
2020-12-18 07:50:30 +00:00
Filip @ Intel
b34ac1038d Correct test_consistency_svm (#1071)
Do not use NULL svm pointers.
Add a check for clEnqueueSVMMigrateMem.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2020-12-11 08:21:15 -08:00
ellnor01
5ae5e7a1fa Remove imageSupportRequired parameter to runTestHarness (#1077)
* 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>
2020-12-09 16:12:40 +00:00
alan-baker
b7adaa5c3b Add more relaxed math conformance tests (#1079)
* 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
2020-12-09 16:12:19 +00:00
James Price
ff9676f878 Fix build_with_il on devices older than 2.1 (#1065)
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.
2020-12-09 16:06:30 +00:00
Grzegorz Wawiorko
827dffbd83 Fix support verification for read write images (#1072) 2020-12-02 10:48:49 +00:00
james-morrissey-arm
5bd85b7384 Fix write-only image tests in kernel_image_methods (#330) (#1014)
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>
v2020-11-23-00
2020-11-21 08:33:04 +00:00
ellnor01
993447a74a Remove code under USE_LOCAL_WORK_GROUP (#1063)
Local work groups are not relevant to these tests.

Fixes #1019

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-11-20 09:33:30 -05:00
julienhascoet
f84fcb055b Fix aliasing issue for test_half (#45) (#1004)
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.
2020-11-20 14:07:14 +00:00
Radek Szymanski
05d5331509 Remove unused code in samplerlessReads (#1051)
These declarations either aren't used or aren't needed, as testBase.h
already declares them.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-11-20 14:06:48 +00:00
Radek Szymanski
956d9a05e6 Remove unused code in kernel_read_write (#1050)
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>
2020-11-20 14:06:40 +00:00
Radek Szymanski
bf3d3fef75 Remove unused code in kernel_image_methods (#1048)
These declarations either aren't used or aren't needed, as testBase.h
already declares them.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-11-20 14:06:32 +00:00
James Price
f22e3a31d0 Fixes for kernel private memory size test (#1053)
* 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
2020-11-10 10:01:04 +00:00
Chetan Mistry
657456f7df Implement test for CL_KERNEL_PRIVATE_MEM_SIZE (#459) (#1013)
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>
2020-11-09 11:07:59 +00:00
Sreelakshmi Haridas Maruthur
16ddfbb1ae gles: Fix compile errors. (#976)
* fix gles build error

* fix format check fail

* fix Werror and link error

* gles: Makefile changes

Change-Id: Ie493a730e6004f9251bbf9b534f758e0dc920191

Co-authored-by: Guang <891528583@qq.com>
2020-11-09 11:04:57 +00:00
ellnor01
63f01be181 Reimplement buffer tests (#1007)
* 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>
2020-11-06 11:33:36 +00:00
Jack Frankland
e8c55e59bc Skip features_macro Test in Offline Mode (#1034)
- [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.
2020-11-06 11:32:13 +00:00
Grzegorz Wawiorko
8fa24b8a72 Change arg type to unsigned int from signed int (#1031) 2020-11-06 11:31:56 +00:00
Radek Szymanski
83cc521e17 Remove unused code in clFillImage (#1036)
These declarations either aren't used or aren't needed, as testBase.h
already declares them.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-11-06 11:25:12 +00:00
Radek Szymanski
51d2e5003e Remove unused code in clGetInfo (#1038)
These declarations either aren't used or aren't needed, as testBase.h
already declares them.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-11-06 11:24:59 +00:00
Radek Szymanski
e31e3a6694 Remove unused code in clReadWriteImage (#1043)
These declarations either aren't used or aren't needed, as testBase.h
already declares them.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-11-06 11:24:46 +00:00
Kévin Petit
c8163e931f Fix a few typos and remove unused code (#1041)
Fixes #845
Fixes #844

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-11-06 11:24:15 +00:00
Kévin Petit
46fead41f4 Replace Travis CI with Github Actions (#1047)
* Replace Travis CI with Github Actions

Signed-off-by: Kevin Petit <kevin.petit@arm.com>

* Fix OpenGL coverage

* Tidy up

- Fix shell warning
- Remove ENABLE_OPENCL30_PROVISIONAL ICD CMake option
2020-11-06 11:23:50 +00:00
Kévin Petit
0e67969989 Fix build warning/error introduced by 8d443029 (#1042)
"control reaches end of non-void function"

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-11-06 10:09:33 +00:00
Stuart Brady
12fce84a66 Minor refactoring of CL_PROGRAM_SOURCE tests (#1032)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-11-04 12:44:54 +00:00
Yilong Guo
ac05575abc [api][test_zero_sized_enqueue] Add CL_SUBMITTED check for waiting status (#1012) 2020-11-04 09:02:11 +00:00
Radek Szymanski
c55ab4f503 Remove unused code in clCopyImage (#1027)
* 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>
2020-11-03 15:08:32 +00:00
David Avedissian
4e2d4c3a66 Remove uninitialised input buffer from test_zero_sized_enqueue (#952) 2020-10-30 15:02:08 +00:00
Alastair Murray
8894e7f046 Add memory_scope_all_devices testing (#999)
* 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
2020-10-30 15:01:48 +00:00
Qinyu
67ab7a7010 Fix memory leak of test_basic (#943) (#948)
Fix issue https://github.com/KhronosGroup/OpenCL-CTS/issues/943.

Free buffer while verify fail.
2020-10-30 14:49:48 +00:00
Stuart Brady
337db8882a Remove spirv_new binaries and add Python script to generate them (#902)
* 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>
2020-10-30 14:38:39 +00:00
Jack Frankland
e7a23536e5 Skip Compiler Unload Tests in Binary Mode (#1025)
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.
2020-10-30 14:29:19 +00:00
John Kesapides
e815bf3565 Fix min version for SPIRV test registration. (#1028)
Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-10-30 14:16:22 +00:00
Stuart Brady
af7d914514 Reformat test harness code (#940)
* Reformat common help text

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Reformat test harness code

This goes part of the way to fixing issue #625.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-10-30 14:13:52 +00:00
Ewan Crawford
55976fad35 Permit half overflow within allowable ULP (#600)
* Permit half overflow within allowable ULP

Modify the algorithm for calculating half precision ULP error so
that it duplicates the behaviour of the single precision ULP algorithm,
in regards to allowing overflow within the defined ULP error.

In the case where the test value is infinity, but the reference is
finite, pretend the test value is 63336.0 and calculate the ULP error
against that.

Encountered this while testing half precision `hypot()` in PR !529,
for inputs `hypot(-48864.0, 43648.0)` which has reference
`65519.755799`. With RTE rounding this only just rounds to `65504` as half,
and returning INF is currently infinite ULP error. Using the leniency
introduced by this change however the error is `~0.5` within the `2` ULP
bounds defined by the spec.

* Run clang-format over changes

Code now conforms to style guidelines and allows `check-format.sh` to pass.
2020-10-28 10:13:40 +00:00
Alastair Murray
f162c8b5ef Skip compiler unload/reload tests if compiler is not available (#986)
* Skip compiler unload/reload tests if compiler is not available

Note that tests that use the compiler helper functions but won't work without a
compiler are in the `subtests_to_skip_with_offline_compiler` list.  I didn't do
that here because they tests directly use `clBuildProgram` etc directly,
because they're specifically testing it's behaviour in edge-cases.

* Change type of status variable
2020-10-28 08:06:11 +00:00