Commit Graph

111 Commits

Author SHA1 Message Date
julienhascoet
8ca1537157 Fix api/test_api_min_max for Embedded profile with cles_khr_int64 support (#994)
In embedded profile with cles_khr_int64 support,
the test did not consider the size of long. Thus the
number of argument computation was not coherent with
the returned CL_DEVICE_MAX_PARAMETER_SIZE leaded to test failure.
We fix this by taking the size of long when cles_khr_int64
is available in the device extension.
2020-10-13 09:27:27 +01:00
Kévin Petit
020eea9e52 Don't require support for 3D image writes in tests that don't need it (#1003)
Also fix PASSIVE_REQUIRE_* macros to report tests as skipped instead of passed.

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-10-05 13:20:51 -04:00
Ben Ashbaugh
a9d06dcd81 add a basic test for CL_PIPE_PROPERTIES (#995) 2020-09-30 15:18:55 +01:00
Ben Ashbaugh
951d010eaf add a new test to verify reported image formats (#963) 2020-09-28 00:22:49 +01:00
Ben Ashbaugh
eb1bb88a19 add a test case for subbuffer property queries (#961) 2020-09-24 16:40:18 +01:00
Sreelakshmi Haridas Maruthur
90b57a2d7a api: Allow vendor flags (#957)
Mask off vendor extensions when querying host command queue properties.
2020-09-15 11:19:20 +01:00
Ben Ashbaugh
c67868834a switch back to CL_INVALID_MEM_OBJECT for clGetPipeInfo (#947)
* switch back to CL_INVALID_MEM_OBJECT for clGetPipeInfo

* fix formatting

* correct error message to CL_INVALID_MEM_OBJECT
2020-09-10 11:59:15 +01:00
Ben Ashbaugh
4421713cd4 add checks for atomic feature consistency (#946) 2020-09-09 18:13:43 +01:00
Ben Ashbaugh
75ce4c5b0e API Feature Consistency Test, Part 2 (#912)
* added pipes test
clang-format fixes

* simplify diffs

* added pipes test
clang-format fixes

* simplify diffs

* add Program Scope Global Variables consistency test

* switched other checks to test_assert_error

* add non-uniform work group consistency test

* added read-write images consistency test

* add Creating 2D Images from Buffers consistency test

* add Device and Host Timer Synchronization consistency test

* add Intermediate Language Programs consistency test

* add Subgroups consistency test

* add Program Initialization and Clean-Up Kernels consistency test

* add 3D Image Writes consistency test

* clang-format fixes

* switch the check for 3D image writes extension for clarity

* add Depth Images consistency test

* update test for CL_QUEUE_SIZE, must return CL_INVALID_COMMAND_QUEUE

* formatting fixes

* fix copy-paste typo

* change expected error codes to CL_INVALID_OPERATION

* address review comments

* fix formatting

* address review feedback

Since pipes are cl_mems, We can spec and test that clGetPipeInfo
returns CL_INVALID_OPERATION when pipes are not supported by
passing a non-pipe memory object to the function.

* use the CTS framework to choose the OpenCL C version

* address review feedback
2020-09-08 17:24:09 +01:00
Jeremy Kemp
822c5a5fc0 queue_flush_on_release: pass event by reference (#937) 2020-09-03 16:55:43 +01:00
Kévin Petit
f06e1896a8 Test that queues are flushed by clReleaseCommandQueue (#923)
... as required by the OpenCL specification.

Also introduce a utility function to manage polling for changes
via a user-supplied function. Several tests we introduced lately
could have used this.

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-09-01 10:27:27 +01:00
Ben Ashbaugh
e075026819 test CL_QUEUE_ARRAY_PROPERTIES query (#925)
* OpenCL 3.0 test CL_QUEUE_PROPERTIES_ARRAY

* add verification if requested_size <= CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE
* remove test_case - set NULL properties, get not empty array with 0 terminator
* add printing test_case description

* change logic of checking if requested properties are supported by device
depending on host/device type queue.

* fix a few bugs, rename test for consistency

* add utility function for comparing properties

Co-authored-by: Grzegorz Wawiorko <grzegorz.wawiorko@intel.com>
2020-09-01 10:16:18 +01:00
Kévin Petit
faa6ad86c6 Fail gracefully in CL_MEM_PROPERTIES tests when unexpectedly getting zero-size return (#913)
Signed-off-by: Kévin Petit <kpet@free.fr>
2020-08-21 09:56:10 -07:00
Ben Ashbaugh
f966212f2b API Feature Consistency Test, Part 1 (#875)
* add api consistency test for Shared Virtual Memory

* add memory model and device enqueue consistency tests

* added pipes test
clang-format fixes

* simplify diffs

* add negative tests for when features are not supported

Previously, this test emitted warnings in the log if a feature
wasn't supported and a query or API call didn't generated the
expected value.  After this change, these tests will fail if
a query or API call does not generate the expected value or
error condition.

* switch handling of expected error codes to test_failure_error

* fix formatting

* use valid pipe creation parameters

* remove calls to clFinish as per review comments

* purposefully pass a bogus pointer to SVM free functions

* fix pointer passed to clEnqueueSVMFree

* change the bogus pointer to a known bit pattern
2020-08-19 14:48:15 +01:00
Grzegorz Wawiorko
185c02a700 Test against clCreateBufferWithProperties and clCreateImageWithProperties OpenCL 3.0 API (#857)
* Test against clCreateBufferWithProperties and clCreateImageWithProperties OpenCL 3.0 API

* Test against clCreateBufferWithProperties and clCreateImageWithProperties - review fixes

* Do not use enum query_type
* Fix test success/failure  conditions

* Fix  test_mem_object_properties_queries.cpp build error.

* Review Fix  test_mem_object_properties_queries.cpp
2020-08-18 17:06:09 +01:00
Ben Ashbaugh
fb2119eb87 add a test for clSetContextDestructorCallback (#861)
* add a test for clSetContextDestructorCallback

* add a 10 second timeout for mem object and context destructor callbacks

* clang-format fixes

* address review comments
2020-08-10 22:21:37 +01:00
Grzegorz Wawiorko
c9f4ef23f6 OpenCL 3.0 CL_SAMPLER_PROPERTIES tests. (#858)
* OpenCL 3.0 CL_SAMPLER_PROPERTIES tests.

* Test CL_SAMPLER_PROPERTIES - fix misspelling

* Test CL_SAMPLER_PROPERTIES - fix results verification
2020-08-06 10:02:46 +01:00
Jeremy Kemp
b3db418e06 Skip sub_group_dispatch. (#864)
* Skip sub_group_dispatch.

If sub groups aren't supported, skip the test.

* Do not test for cl_khr_subgroups as the extension requires IFP.

3.0 allows sub groups *without* IFP so the check was invalid.
2020-08-05 14:55:35 +01:00
James Price
944b0a8178 Enable -Werror for GCC/Clang builds (#786)
* 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
2020-05-27 19:13:11 +01:00
Jack Frankland
f6b156d523 Correct khr Extension Checks for Device Versions (#778)
* Correct khronos extension device version checks so that 2.0, 2.1 and
2.2 extensions are only require for devices versions < 3.0
(`cl_khr_3d_image_writes`, `cl_khr_image2d_from_buffer` and
`cl_khr_depth_images` are all optional for devices supporting
OpenCL-3.0).

* Remove `cl_khr_fp64` from list or required extensions for 2.0,
`cl_khr_fp64` is a required extension for OpenCL-1.2 devices if they
suport doubles. Check for support of `cl_khr_fp64` on 1.2 devices.

* Remove duplicated `cl_khr_byte_addressable_store` from list of 2.0
extensions. Since this is a 1.1 extension and all versions greater than
1.1 are backwards compatible with 1.1 this will be checked anyway.
2020-05-20 14:16:37 +01:00
Ankit Goyal
4fbcd96e7f Remove "C" linkages (#781)
* Remove extern C linkages

* Update crc32 to cpp and remove extern C linkage
2020-05-20 14:16:19 +01:00
Grzegorz Wawiorko
223c43b7d9 test_api - fix minRequiredDimension in case of new OpenCL version (#779)
* Fix minRequiredDimension in case of new OpenCL version

* Fix code formatting
2020-05-19 10:16:21 +01:00
Jack Frankland
a6c3d921ae Remove clCreatePipe call from test_clone_kernel (#775)
* Remove the call to `clCreatePipe` in the `test_clone_kernel` test as
the result of this call (the pipe object) is unused. Further more
`clCreatePipe` is an optional API in OpenCL-3.0, so even if the pipe
object did have a use, support for this API would need to be queried in
the case of a OpenCL-3.0 driver where returning `CL_INVALID_OPERATION`
would be conformant behaviour. As it stands this test will incorrectly
fail for a 3.0 driver which does not support pipes.

* Correct comment regarding pipes and SVM since these features were not
actually tested in the source.
2020-05-18 13:03:57 +01:00
James Price
de952011f3 Replace magic constants in api/kernels tests (#754)
Also remove one unused test function.
2020-05-04 09:12:46 -04:00
James Price
11b21fdcca Remove unused API test (#756)
The test was also invalid, since it was testing that you can pass a
structure containing cl_mem objects to a kernel without SVM.
2020-05-01 14:29:32 +01:00
James Price
1e5ffa08b5 Fix initialization of input data for api test (#746)
Caught by MSAN.
2020-04-28 09:17:14 -04:00
John Kesapides
c911046f5b Fix minor resource leaks in test_api. (#735)
Added some missing clProgramWrapper/clkernelWrapper, to avoid
resource leaks.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-04-16 13:35:29 +01:00
Jeremy Kemp
f4a4b5428e API: Fixed condition based on is_extension_available. (#726)
enqueue_kernel was being run when the cl_khr_create_command_queue was *not* present. The test should only be run when the extension *is* present.

Regressed in 93e76a8a4a.
2020-04-09 09:57:56 +01:00
ellnor01
ef3528e78a Ensure is_extension_available is used where possible (#721)
(Patch1)
A number of tests have got their own code for checking the presence of
extensions. This change replaces that code with is_extension_available
function.

Contributes to #627

Change-Id: I8dd2233719aa8c84841ac61776437d7f6e3fafe6
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-02 21:22:02 +01:00
Sreelakshmi Haridas Maruthur
46b6bae001 cl20: api: Allow vendor flags (#666)
Mask off vendor extensions when querying host command queue properties.

Khronos Bug: https://github.com/KhronosGroup/OpenCL-CTS/issues/642
Test Suite Affected: api
2020-03-23 15:58:20 +00:00
Radek Szymanski
e6d81f5d43 Fix memory leak in api - zero_sized_enqueue (#687)
The test enqueues kernel and requests event associated with its
execution, but then never releases the event.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-03-19 16:32:11 +00:00
alan-baker
5ec04da102 Add a test that clSetKernelArg does not retain the arg (#665)
* Add `retain_mem_object_set_kernel_arg` to test that calling
clSetKernelArg with a cl_mem object does not retain that mem object
2020-03-11 10:09:51 +00:00
John Kesapides
c93dd48456 Add cl_khr_subgroups pragma enable in the kernel source (#609)
code for test_api sub_group_dispatch. Although subgroups
is a core feature there is no separate 2.1 language spec
so we use the 2.0 with the pragma.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-02-23 12:15:00 +00:00
James Price
40f50d77a3 Rename test .c sources to .cpp where necessary (#604)
Remove hacks to force language from CMake files.

Closes KhronosGroup/OpenCL-CTS#25
2020-02-21 17:34:31 +00:00
Kévin Petit
3f11868e11 Fix warnings reported by -Wconversion-null (#603)
Fix error reporting in clFillImage as a result.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-21 12:21:53 +00:00
Kevin Petit
e306ecd691 Remove most remaining clCreate*WithProperties calls in tests that run on 1.2
Don't touch interop suites or code only run with options not required
for conformance.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-20 14:38:08 +00:00
jiabaxie
943ba04c0c set gDeviceType in testharness.c (#597)
* set gDeviceType in testharness.c, also moved gTestRounding to imageHelpers.cpp & .h and removed duplicate code from host_atomics.cpp

* Cleaned up some redundant code

* Reversed the change in testharness.c
2020-02-20 10:39:55 +00:00
jiabaxie
68d08e07bf Moved all instances of gDeviceType to imageHelper.cpp (#575)
* Moved all instances of gDeviceType to imageHelper.cpp

* Missed one instance of gDeviceType

* Removed all instances of extern cl_device_type gDeviceType, except in imageHelpers.h
2020-02-06 08:27:13 +01:00
Kévin Petit
0061d7c0f2 Remove compatibility api suite (#530)
The last test was also an almost-perfect duplicate of its sibling
in the non-compatibility suite. The only difference was the name
of the member of cl_image_desc used to point to the buffer/memory
object (which changed in 2.x).

We currently always build the conformance tests with the
headers configured for 2.2 (using the default value really) but I've
added code for the pre-2.x name as well for when CL_VERSION_2_0 isn't
defined in case we need it and to keep track of the distinction in that
test.

Contributes to #494.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-01-06 15:12:15 +00:00
Kévin Petit
81cffe9132 Move kernel_arg_info compatibility test to the main api suite (#523)
The diff between the compatibility and non-compatibility tests
is rather big. These tests should both be replaced by a new
maintainable one (see #522).

Contributes to #494.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-12-20 15:55:16 +00:00
Kévin Petit
334650bcca Move cl_khr_create_command_queue test to the main api suite (#521)
In theory, it could exist on a 2.x implementation.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-12-18 11:49:56 +00:00
Kévin Petit
13a32946eb Move sampler and command queue compatibility query tests to the main api suite (#509)
...and mark tests that exercise new-style entrypoints as requiring 2.0

These tests give us (or rather will give us once made exhaustive, see
#508) coverage for both new-style and old-style creation entrypoints,
making the entrypoint used in other tests irrelevant as long as the
old-style entrypoints are required to be implemented.

Signed-off-by: Kévin Petit <kpet@free.fr>
2019-12-11 10:38:29 +00:00
Kévin Petit
32bbb19885 Fix a couple of typos (#478)
Signed-off-by: Kévin Petit <kpet@free.fr>
2019-11-11 17:07:40 +00:00
Kévin Petit
fa4b278432 Build the harness as a static library (#430)
This reduces by a factor of roughly two the number of files to build.

Fixes #193.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-07 17:18:10 +01:00
Radek Szymanski
358ad78344 Handle failed memory allocations (#426)
The test has been ignoring potential failures in memory allocations,
giving misleading error messages.

Add a simple check and return early if the allocation failed.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-08-05 15:04:46 +01:00
Kevin Petit
ef832c330c Stop using ../../test_common to include common headers
Fixes #395.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 18:41:12 +01:00
Kevin Petit
4dca437b0e Merge branch 'cl20_trunk' 2019-08-01 10:30:10 +01:00
Kevin Petit
75a26fdc44 Specify minimum required version for all OpenCL 2.1 tests
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 10:02:28 +01:00
Kevin Petit
d3fb3d975f User create_* helper functions in most tests
Ported from master.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-31 16:00:45 +01:00
Kevin Petit
59e2da3b4e Port framework changes from master
Now requiring the headers to be configured for OpenCL > 2.1.
2019-07-31 16:00:45 +01:00