Commit Graph

98 Commits

Author SHA1 Message Date
Ben Ashbaugh
39fdb462be define NOMINMAX in the CMakefile to fix std::min and std::max on MSVC (#1308) 2021-08-28 10:21:34 +01:00
BKoscielak
433974fd28 Fix check for image support in test_basic sizeof (#1269) 2021-07-13 17:15:33 +01:00
Pierre Moreau
06f7661fdc basic/async: Check for extension only once per test (#1242)
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.
2021-05-12 11:39:17 +01:00
Zakaria Taha
6b36f645b8 Add tests to proposed new builtin async_copy functions with a bug fix. (#725)
* 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.
2021-03-18 14:27:59 +00:00
Sven van Haastregt
87a1525d53 NFC: clang-format test_basic_parameter_types.cpp (#1151)
* 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
2021-02-11 11:37:14 +00:00
Stephen Clarke
fad6a005c9 Fix test_vector_swizzle possible overwrite of padding of 3-element vectors (#1124)
Use vstore3 to ensure padding is not overwritten in destination buffer.

Fixes #1120
2021-02-03 14:34:18 +00:00
Nikhil Joshi
0130c24fe5 Fix malloc-size calculation in test imagedim (#1100)
* 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.
2021-01-21 13:31:54 +00: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
Grzegorz Wawiorko
827dffbd83 Fix support verification for read write images (#1072) 2020-12-02 10:48:49 +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
ellnor01
a6809710ea Remove unnecessary cl_mem_flags casts (#1018)
* api, atomics: remove unnecessary cl_mem_flags casts

Instances in api, atomics, buffers and c11_atomics suites

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* basic: remove unnecessary cl_mem_flags casts

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* spir, thread_dimensions: remove unnecessary cl_mem_flags casts

Instances in spir, thread_dimensions and workgroups tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* profiling, relationals: remove unnecessary cl_mem_flags casts

Includes relationals, profiling, muliple_device_context, integer_ops
tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* clcpp: remove unnecessary cl_mem_flags casts

Contibutes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* events, geometrics: remove unnecessary cl_mem_flags casts

Includes events, geometrics, gl and images tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* commonfs, compiler: remove unnecessary cl_mem_flags casts

Includes cast removal in commonfs, compiler and device_partition tests

Fixes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Fix up formatting

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-10-19 13:56:02 +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
02fc5809e3 simple vector swizzle test (#960)
* 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
2020-09-24 20:41:04 +01:00
David Avedissian
3db1a9b3aa Ensure that test_preprocessors checks __OPENCL_C_VERSION__ correctly for CL 3.0 contexts. (#938) 2020-09-17 09:42:58 +01:00
Jack Frankland
11c3eb6610 Update rw_image_access_qualifier for OpenCL-3.0 (#922)
* 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.
2020-08-31 15:16:02 -07:00
Jack Frankland
581d9ea990 Dynamically select -cl-std Build Option for get_(global|local)_linear_id (#876)
* Dynamically select the build option `-cl-std` for the
`get_(global|local)_linear_id()` builtin based on the device version
of the driver.
2020-08-31 15:14:10 -07:00
Jack Frankland
0ba7cf1369 Dynamically Select -cl-std Option (#879)
* 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.
2020-08-25 09:32:08 -07:00
Jack Frankland
655d83db80 Optionally Skip progvar Tests (#878)
* Optionally skip the proram scope globa variable tests on OpenCL-3.0
devices that optionally do not support programscope global variables.
2020-08-14 13:49:51 +01:00
Jack Frankland
48114a4e55 Run test_enqueued_local_size if Non-Uniform Work-Groups Not Supported (#789)
* `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.
2020-08-11 08:04:46 -07: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
James Price
09aa54246f Fix warnings in basic suite (#782)
* Fix "ignored typedef" warning

* Fix "returning reference to temporary" warning
2020-05-20 15:16:18 -04:00
Ankit Goyal
833f0d029e Fix return-type warnings with harness library and basic test (#776)
* Fix offending `-Wreturn-type` in harness library

* Fix offending `-Wreturn-type` in basic test
2020-05-18 13:03:17 +01:00
John Kesapides
3afe926416 Mem-leaks from conformance test_basic (#771)
Release some leaked events

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-05-14 12:57:20 +01:00
James Price
bda0285c2a Refactor basic/intmath tests into a single file (#757)
* Refactor basic/intmath tests into a single file

These six tests previously duplicated almost all of their sources in
separate files. Bring them into a single file with templated routines
to perform the tests.

This change also makes use of more C++ features and utilities from the
harness library to make the code cleaner.

* Fix array indices for initialization

* Use loop for buffer creation

* Refactor to remove duplicate verification code

Remove need for hardcoded number of test operations.

* Address review comments

* Use TEST_SKIPPED_ITSELF
2020-05-06 11:32:31 -04:00
Kévin Petit
2fa8611862 Make it possible for enqueue_map tests to catch more USE_HOST_PTR issues (#730)
* Make it possible for enqueue_map tests to catch more USE_HOST_PTR issues

Don't update the memory passed as host_ptr with the correct result
and compute the reference result using a separate allocation so that
implementations that use copies to manage the host_ptr and never update
as part of map/unmap commands the memory pointed to by host_ptr fail
the test.

Rename initialData to hostPtrData for clarity.

Fixes #700

Signed-off-by: Kévin Petit <kpet@free.fr>

* format fixes

* more format fixes?
2020-04-16 10:23:03 +01:00
ellnor01
3b79ecdb87 Replace get_device_version with get_cl_device_version (#733)
They are duplicate functions

Fixes #709

Change-Id: I8f7d6b8254047adb9e09ede4951dedc3ec5c1099
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-15 14:31:22 +01:00
Kévin Petit
cd3b552094 Clean up enqueue_map_{buffer,image} tests a bit (#701)
- Introduce MTdataHolder
- Use BufferOwningPtr to manage allocations (fixes a few leaks in error cases)
- Introduce variable for common expressions
- Remove image format support check as the format is required by OpenCL 1.0

Contributes to #700

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-04-02 21:46:41 +01:00
ellnor01
08b52d036f Remove explicit_s2v_bool test (#688)
The test does not do anything other than print a skipping test
message.

Fixes #438

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-03-20 12:00:40 +00:00
Marco Antognini
3e771b0070 Fixes #498 - Extend progvar_prog_scope_uninit checks (#544)
This adds checks to progvar_prog_scope_uninit which ensure that
program-scope variables are default-initialized to the zero-value for
their type.
2020-03-11 18:18:12 +00:00
Kévin Petit
4c5a8fff6d Conditionally test BGRA in Basic readimage3d (#623) (#624)
* imageHelpers: Created generic function that returns a vector of required image formats.

An upcoming commit requires access to the vector of required image formats, separatley from check_minimum_supported.

* imageHelpers: Added a new function is_image_format_required.

This function can be used to determine for any given cl_image_format, whether the implementaion is required to support it.

Conditionally test BGRA in Basic readimage3d (#623)

This change adds checks to see if testing against an embedded implementation and if so, queries whether BGRA is supported or not.

* Refactor based on PR review.

* Update passed message code.

* Changed scope of struct to be within test_readimage3d.
2020-03-05 18:47:51 +00:00
Kévin Petit
b2eba77d42 Get rid of test_finish macro and related ATF cruft (#633)
Closes #431

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-03-02 15:06:44 +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
695960df2e Remove duplicate sizeof test from the compatibility suite (#545)
... and fix bug 16041 in the main suite.

The only diffs were:
- changes made to support both 1.2 and 2.0 on master
- changes to fix bug 16041 in the compatibility version that
  hadn't made it to the main version.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-01-15 10:09:25 +00:00
Kévin Petit
1c04050b5b Use old-style sampler creation in basic suite and remove duplicate compatibility tests (#510)
As agreed in the WG calls, the query tests are sufficient to cover
both old-style and new-style sampler and command queue creation
entrypoints.

Use old-style entrypoints in all tests that don't require 2.x
features to get compatibility with 1.x implementations.
This makes it possible to remove duplicate compatibility tests.

Contributes to #494.

Signed-off-by: Kévin Petit <kpet@free.fr>
2019-12-11 10:36:45 +00:00
Grzegorz Wawiorko
18046e65d1 Fixes issue #499 - Test basic from master branch on OCL 1.2 device (#500)
* Fixes issue #499 - Test basic from master branch on OCL 1.2 device

* Restore pitch tests for CL1.X
2019-11-25 09:24:26 +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
Sam Laynton
12bc0c1f3f Check max work group size in test basic (#414)
The test enqueued_local_size in test_basic used a
local work group size larger than the minimum max
supported work group size supported by some platforms.

This change checks the max and clamps to it if
requested size would be larger than supported.

Signed-off-by: Sam Laynton <sam.laynton@arm.com>
2019-08-05 11:26:17 +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
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
Radek Szymanski
a344529c9b cl20: Use single array for function list (#146)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-04-10 12:29:22 +01:00
Kevin Petit
f6a2955758 Remove build systems other than CMake
Make it clear that CMake is the only supported build system.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-03-15 09:48:26 +00:00
Kevin Petit
53db6e7f9f Synchronise with Khronos-private Gitlab branch
The maintenance of the conformance tests is moving to Github.

This commit contains all the changes that have been done in
Gitlab since the first public release of the conformance tests.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-03-05 16:24:06 +00:00
Kedar Patil
3a440d17c8 Initial open source release of OpenCL 2.0 CTS. 2017-05-16 18:50:35 +05:30