Commit Graph

43 Commits

Author SHA1 Message Date
Ben Ashbaugh
933874f070 allow specifying CL_DEVICE_TYPE_ALL as the harness device type (#2421)
Currently, selecting a different device in a platform to test is rather
cumbersome, for two reasons:

1. The default device type tested is the "default" device and there is
at most one default device in a platform. This means that, by itself,
choosing any non-zero device index is by definition out-of-range:

```sh
$ CL_PLATFORM_INDEX=1 CL_DEVICE_INDEX=1 ./test_conformance/basic/test_basic 
 Initializing random seed to 0.
Requesting Default device based on command line for platform index 1 and device index 1
device index out of range -- choosen_device_index (1) >= num_devices (1)
```

2. To choose a non-default device type you therefore need to explicitly
specify another device type also, but "all" is not a valid device type
in the harness. This means that you need to know both the device type
and the index of the device within that device type to choose the device
to test.

```sh
$ CL_DEVICE_TYPE=all CL_PLATFORM_INDEX=1 CL_DEVICE_INDEX=1 ./test_conformance/basic/test_basic 
Unknown CL_DEVICE_TYPE env variable setting: all.
Aborting...
Aborted (core dumped)
```

This PR aims to fix (2), by allowing "all" as a device type. In the
future, we could consider making the default device type "all" vs.
"default", which would fix (1) also, but that will likely need more
discussion and should be done in a separate PR.
2025-07-15 09:00:20 -07:00
Kévin Petit
0a1456d8f9 [RFC] Move logic for test registration to the test harness (#2151)
And use in device_timer suite.

Signed-off-by: Kévin Petit <kpet@free.fr>
2024-11-26 09:55:09 -08:00
Sreelakshmi Haridas Maruthur
d3b9520adc printf: add fflush(stdout) at the end (#2103)
Some platforms (Windows in our case) seem to need this.
2024-11-26 09:25:01 -08:00
saurabhnv
e865c1e8dd Fix vulkan subtest for diffCtx and platform/device info (#2046)
Fixes:
1. Multi import diff ctx subtest which acquires/releases external memory
via queue not associated with the context in which memory was imported.
2. Platform/Device info subtests to handle different platforms and
availability of the query.
2024-09-24 08:55:01 -07:00
Aharon Abramson
d4f9d04b39 add support for custom devices (#1891)
enable the CTS to run on custom devices
2024-02-13 09:29:39 -08:00
Ben Ashbaugh
d5b7d10db7 add SPIR-V version testing (#1861)
* basic SPIR-V 1.3 testing support

* updated script to compile for more SPIR-V versions

* switch to general SPIR-V versions test

* update copyright text and fix license

* improve output while test is running

* check for higher SPIR-V versions first

* fix formatting
2024-01-30 09:14:40 -08:00
Aharon Abramson
be626ca1fa add MIPS architecture (#1837) 2023-11-07 09:36:45 -08:00
Sven van Haastregt
50f9f06323 test_common: fix -Wsign-compare warnings (#1759)
In preparation of re-enabling `-Wsign-compare` globally, avoid mixing
signed and unsigned integers in comparisons in test_common.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-21 15:19:21 +01:00
Kévin Petit
ff1369d94e Add basic support to the harness for parallel test execution (#1687)
This change introduces a new command-line parameter to enable
parallel execution by a specified number of worker threads. When
parallel execution is requested, tests are distributed across
the worker threads. This behaviour is disabled by default.

This does not currently work for all suites as some of them are
using global variables to configure tests. For the suites that
do not use global state, this change reduced the execution time
by up to 5x on an 8-core machine.

Signed-off-by: Kévin Petit <kpet@free.fr>
2023-04-25 19:30:42 +01:00
Sreelakshmi Haridas Maruthur
868de6c15e test_harness: Update test status upon api failure (#1615)
Co-authored-by: Vasu Penugonda <vpenugon@qti.qualcomm.com>
2023-03-28 09:14:47 -07:00
Kévin Petit
1eeb10296f Get rid of threadTesting.h (#1604)
It only contains a pointer type definition for test functions that
really ought to be provided by testHarness.h.

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

Signed-off-by: Kévin Petit <kpet@free.fr>
2023-01-14 15:18:27 +00:00
Sven van Haastregt
f6a963a583 harness: Fix -Wformat warnings (#1527)
The main sources of warnings were:

 * Printing of a `size_t` which requires the `%zu` specifier.

 * Printing of `cl_long`/`cl_ulong` which is now done using the
   `PRI*64` macros to ensure portability across 32 and 64-bit builds.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-10-13 10:02:40 +01:00
Kévin Petit
9e0ce2ba80 Produce JSON results even when a suite's init function reports SKIP or FAIL (#1521)
Also tidy-up some surrounding code.

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

Signed-off-by: Kévin Petit <kpet@free.fr>
2022-10-11 09:35:36 -07:00
Marco Antognini
76ace61314 Fix leaks in callSingleTestFunction (#1224)
The context and queue were not released when the test is not supported
in offline mode or the queue couldn't be created.

Inline test_missing_support_offline_cmpiler_ret macro, remove dead
parameter of check_functions_for_offline_compiler and slightly refactor
callSingleTestFunction to address leaks.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-06-09 11:08:08 +01:00
Pierre Moreau
d7f87492bd testHarness: Print error string when clFinish fails (#1243) 2021-05-12 11:39:45 +01:00
Sven van Haastregt
dbd3e787fe Do not dereference null pointer for no matching tests (#1191)
When invoking for example

    test_c11_atomics test-that-does-not-exist

parseAndCallCommandLineTests() would attempt to dereference
`resultTestList` which is still a null pointer.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2021-03-18 21:46:05 +00:00
Chetan Mistry
f6b501352d Implement Negative Test for Platform Layer Functions (#1076)
* Implement Negative Tests for clPlatform Functions

This change introduces negative tests for clPlatform
functions as well as changes to the Harness to help with
other negative tests.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Remove magic macro from Negative Platform Tests

This change removes the negative-testing macro and all
other changes related to its usage.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
2021-02-05 16:36:16 +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
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
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
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
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
Kenneth Benzie
8d44302935 Return a non-zero exit-code when a sub-test fails (#951)
When running sub-tests explicitly on the command line and that sub-test
fails, the test harness returns `0` from `main()`. This is problematic
in automated testing environments as failed tests can be hidden.

This patch iterates over all the test results in the `resultTestList`
after all sub-tests have completed, if any of the tests failed a
non-zero value is returned from `parseAndCallCommandLineTests()` which
is then propagated up the call stack to `main()`.
2020-10-19 23:08:40 -07:00
Kévin Petit
3320035581 Align with updated conformance process (#989)
- Remove the requirement to detail values for device queries and list
  extensions in the submission template. They are printed by computeinfo.
- Require that tests skipped in accordance with the conformance
  process be listed in the submission template.
- Remove support for OPENCL_1_0_DEVICE. This variable doesn't control
  anything anymore and the updated conformance process no longer refers
  to it.
- Require that implementations running via a loader document the loader
  that was used.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-09-29 13:51:49 -07:00
Pierre Moreau
c001dc2d9c Only include sys/sysctl.h on for Apple (#916)
glibc deprecated that header in version 2.30, and removed it in 2.32.
2020-08-27 18:31:51 +01:00
aarongreig
fb55f7e81c Set new minimum version for the spirv_new tests. (#854)
This allows 1.2 implementations with the cl_khr_il_program extension to run them.
2020-07-31 13:13:08 +01:00
Grzegorz Wawiorko
44a240367e Fix code format errors 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
9a006ba1a0 Spirv readiness - move to harness
Fixes support  cl_khr_il_program
2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
adec8f9412 Add support for cl_khr_il_program extension 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
3730bce4e8 SPIR-V handling on different OpenCL devices version
Example usage for bruteforce and spirv_new
2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
d643dc5399 Add API name to version_expected_info function 2020-07-23 17:21:07 +01:00
Kévin Petit
5e2f5b857e Accept OpenCL 3.0 in version parsing code and use where appropriate (#752)
* Accept OpenCL 3.0 in version parsing code and use where appropriate

There were a number of tests against 2.2 that are clearer against 3.0.

Fixes #751

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

* Remove CL_EXPERIMENTAL guards

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

* formatting

* Configure the headers for OpenCL 3.0

* more format fixes
2020-04-30 11:51:06 +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
Jeremy Kemp
5e84ad0c19 Generic Address Space: Skip tests utlilising SVM on devices that do n… (#712)
* Harness: Added an option for a test to skip itself.

New condtion in callSingleTestFunction. This allows a test to return TEST_SKIP if the device does not support the requested test.

* Split generic_ptr_to_host_mem into two tests.

The old generic_ptr_to_host_mem test tests two different device capabilities (SVM and not SVM). This is a prerequisite for the following commit.

* Generic Address Space: Skip tests utlilising SVM on devices that do not support SVM.

Where a device does not support SVM, do not run the generic address space test(s) that rely on SVM.
2020-03-27 12:38:30 +00:00
John Kesapides
d128fea964 Global variable gDeviceType correctly set (#611)
Add gDeviceType set on kernel_read_write tests(image_streams)
as the device type affects the way validation is performed in the test.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-03-26 22:14:46 +00:00
Grzegorz Wawiorko
51cd792e9e Fix test skip handling while test initialization - device_timer (#667) 2020-03-10 18:25:49 +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
5f77d763ea Do not include sys/sysctl.h on Android (#635)
Android has linux/sysctl.h, but the functions that need it are not
used when targeting Android at the moment.
2020-02-28 08:38:52 +00:00
Radek Szymanski
80c3a27a6a Remove unused parameter (#630)
The imageSupportRequired param is not needed in runTestHarnessWithCheck,
so just remove it.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-02-27 15:36:28 +00:00
Kévin Petit
d5334dc61d Get rid of checkDeviceTypeOverride (#602)
This is now done in the test harness.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-24 10:34:04 +00:00
Grzegorz Wawiorko
452adcd7be Fix - Windows build errors - utsname sysctl files (#621) 2020-02-24 10:28:05 +00:00
Bhargav Das
b2cb18073c Improved PrintArch functions (#595) (#601)
Moved all duplicate 'PrintArch' functions to testHarness.c
Replaced sysctl system call used in 'PrintArch' function with uname
system call

Signed-off-by: bhargavdas <bhargav_das@mentor.com>

Update testHarness.c
2020-02-21 16:47:54 +00:00
James Price
bce4e48c89 Rename harness .c sources to .cpp where necessary (#513)
Remove hacks from harness CMakeLists.txt to force language.

Contributes to KhronosGroup/OpenCL-CTS#25
2020-02-20 21:09:36 +00:00