Commit Graph

239 Commits

Author SHA1 Message Date
Kévin Petit
be1278d5b2 Add utility macro to skip test when an extension is not supported (#2178)
Use in cl_khr_external_semaphore suite as an example.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2024-12-17 09:54:51 -08:00
Kévin Petit
5b7af4b36d [NFC] Change the name of the default device provided by the new registration framework (#2186)
The code base uses a mix of 'device' and 'deviceID'. I suggest we
standardise on 'device' which is shorter and slightly more prevalent.

Contributes to #2181

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2024-12-12 13:24:04 -08:00
Sreelakshmi Haridas Maruthur
3bdd2f99b5 cl_fill_image: Use CL_DEVICE_VERSION instead of CL_DEVICE_NUMERIC_VER… (#2043)
…SION

CL_DEVICE_NUMERIC_VERSION is only available from OpenCL 3.0 Use
CL_DEVICE_VERSION instead.
2024-12-03 08:55:37 -08: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
joshqti
1102e0bccf Fix snorm (#2033)
When comparing scanlines for SNORM images, take into account that -1.0
can be exactly represented in two different ways.

---------

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2024-11-26 09:24:35 -08:00
Sven van Haastregt
2358b46553 [NFC] kernelHelpers: remove unused macros and prototypes (#2156)
None of these are referenced anywhere in the code, so remove them.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-11-22 11:41:15 -08:00
Kamil-Goras-Mobica
265cc18843 Corrected build under msvc compiler #1833 (#2121)
Fixes #1833 according to task description.
2024-11-12 08:55:57 -08:00
Qichao Gu
ccd455040a Enable building OpenCL-CTS with Intel DPC++/C++ compiler ICX on Windows (#2088)
Currently Intel® C++ Compiler Classic (ICC) is supported to build
OpenCL-CTS on Windows. This compiler has been discontinued since the
second half of 2023. Instead, Intel recommends that users transition to
use the LLVM-based Intel® oneAPI DPC++/C++ Compiler (ICX).
This change is to enable users to build OpenCL-CTS with ICX on Windows.
2024-11-05 08:52:16 -08:00
Ben Ashbaugh
d8228f0d72 remove using namespace std and use std namespace explicitly (#2125)
Removes `using namespace std` and adds `std::` explicitly instead, which
is usually on calls to `min`.

This is generally best practice, and it also might be helpful when there
are the same function names in the std namespace and in the global
namespace (e.g. #1833).
2024-10-29 09:44:49 -07:00
gorazd-sumkovski-arm
e678277c93 Add testing of CL_UNORM_INT_2_101010_EXT (#2112)
All existing tests in `test_image_streams`, that are capable of testing
image formats using the `CL_UNORM_INT_2_101010_EXT` data type, do so.

Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
2024-10-22 09:54:46 -07:00
ellnor01
617e7cb233 Re-enabling narrowing errors (#1144)
Fixes narrowing conversion build errors in test_common

Removing disable of narrowing errors in main CMakeLists.txt
and moving it down to specific test_conformance suite's 
CMakeLists.txt where there are many more build errors revealed
from this fix. 

Fixes a few simple issues under test_conformance in the process.

Contributes #787

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

---------

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2024-10-08 09:54:32 -07: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
gorazd-sumkovski-arm
bcfd8f82cd Extend testing of CL_UNORM_INT_101010_2 (#2031)
All existing tests in `test_image_streams`, that are capable of testing
image formats using the `CL_UNORM_INT_101010_2` data type, now do so.
2024-09-16 08:45:16 -07:00
gorazd-sumkovski-arm
21b0a09ef0 Extend IGetErrorString() (#2080)
Add cases for `CL_INCOMPATIBLE_COMMAND_QUEUE_KHR`,
`CL_INVALID_COMMAND_BUFFER_KHR` and
`CL_INVALID_SYNC_POINT_WAIT_LIST_KHR`.

Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
2024-09-12 16:17:11 +02:00
Sven van Haastregt
ce680690de Fix Windows build with MSVC 19.41 (#2065)
Include `cmath` instead of `math.h` in C++ mode under MSVC, to avoid
build errors inside the header.  Ideally we would not condition this
on `_MSC_VER`, but issue 1833 currently prevents doing so.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-09-06 12:26:55 +02:00
Marcin Hajder
0a00a1f5b0 Added printf test for double type cases (#2022)
according to work plan for issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/1058
2024-08-27 08:41:05 -07:00
Ahmed
b4c3bf2af2 Fixes for basic explicit_s2v and commonfns degrees for cl_half (#2024)
Basic explicit_s2v:

The verification step was always using round to even when converting a
float to half even for round to zero cores.

Commonfns degrees:

The verification step was only taking into account infinities and not
values that over/underflow. This resulted in an incorrect error
calculation. E.g:

double cpu_result = 175668.85998711039;
cl_half gpu_result = 31743; // this is 65504 when converting to float,
we overflowed.
float error = (cpu_result - gpu_result) * some_factor;

The fix adds the check if( (cl_half) reference == test ) before
calculating the error.
2024-08-13 09:52:07 -07:00
arm-wk
f47354680f Limit buffers sizes to leave some memory for the platform (#1172)
Some conformance tests use directly the size returned by the runtime
for max memory size to allocate buffers.
This doesn't leave enough memory for the system to run the tests.
2024-08-06 09:32:08 -07:00
Sven van Haastregt
70884151c9 [NFC] Remove config.hpp (#2020)
The defines inside this header were not used anywhere.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-23 20:11:56 +01:00
Sven van Haastregt
b6941b6c61 Add fp16 testing to conversions and bruteforce (#1975)
Merge the `fp16-staging` branch into `main`, adding fp16 (`half`)
testing to the conversions and math bruteforce tests.

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Guo, Yilong <yilong.guo@intel.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Co-authored-by: Marcin Hajder <marcin.hajder@gmail.com>
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Wawiorko, Grzegorz <grzegorz.wawiorko@intel.com>
Co-authored-by: Sreelakshmi Haridas Maruthur <sharidas@quicinc.com>
Co-authored-by: Harald van Dijk <harald@gigawatt.nl>
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
Co-authored-by: Haonan Yang <haonan.yang@intel.com>
Co-authored-by: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com>
Co-authored-by: niranjanjoshi121 <43807392+niranjanjoshi121@users.noreply.github.com>
Co-authored-by: Wenwan Xing <wenwan.xing@intel.com>
Co-authored-by: Yilong Guo <yilong.guo@intel.com>
Co-authored-by: Romaric Jodin <89833130+rjodinchr@users.noreply.github.com>
Co-authored-by: joshqti <127994991+joshqti@users.noreply.github.com>
Co-authored-by: Pekka Jääskeläinen <pekka.jaaskelainen@tuni.fi>
Co-authored-by: imilenkovic00 <155085410+imilenkovic00@users.noreply.github.com>
Co-authored-by: John Kesapides <46718829+JohnKesapidesARM@users.noreply.github.com>
Co-authored-by: Aharon Abramson <aharon.abramson@mobileye.com>
2024-06-18 09:43:11 -07:00
Shilei Tian
556025ba14 Escape subnormal values (#1953)
Currently we don't escape subnormal values when generating image data.
In sampler read tests, we use `!=` to check the two values even when it
is floating-point data, which requires the two values are bitwise equal.
However, a sampler might flush subnormal values, causing the test case
to fail.

In this patch, when generating random image data, we escape subnormal
values.
2024-05-30 15:19:00 -07:00
Romaric Jodin
fe76832ec8 add missing header (#1966)
test_common/harness/integer_ops_test_info.h is using std::vector but is
not including the header.

This is breaking on Google internal CI.
2024-05-21 13:00:13 -07:00
John Kesapides
fb39357911 Raw10/12 CTS tests (#1830)
Add support for cl_ext_image_raw10_raw12 testing
on test_image_streams.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-05-21 08:44:28 -07:00
Sreelakshmi Haridas Maruthur
aa70c06d8f Fix build breakage introduced by #1911 (#1958) 2024-05-07 10:03:02 -07:00
Romaric Jodin
be8b56d949 Test IMAGE1D_BUFFER in more scenario (#1806)
* cl_copy_images

* cl_get_info

* cl_fill_image

* cl_read_write_image

* kernel_image_methods

* IMAGE1D_BUFFER cannot be created with (USE_|ALLOC_|COPY_)_HOST_PTR

* do not allow mipmap with 1D buffer

* adjust M to be within maximum_sizes and max_pixels

* remove unused variables

* make sure M will never be 0

* fix region[0] after refactoring removing mipmap

* fix formatting

* format with clang-format-11

* fix image1d_buffer creation with gEnablePitch

* add missing case in switch

* use align_malloc when CL version is at least 2.0

* use CL_DEVICE_NUMERIC_VERSION and align_free

* fix free of pitch buffer

* fix formatting

* fix formatting

* fix data->is_aligned
2024-04-16 08:48:05 -07:00
Ahmed Hesham
0deddf2ce7 Fix failing image tests for CL_UNORM_INT_101010_2 (#1917)
Add support for `CL_UNORM_INT_101010_2` in the `get_pixel_size` helper
function. This fixes the following tests:
* memInfo_image_from_buffer_positive
* image_from_buffer_alignment_negative
* imageInfo_image_from_buffer_positive

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2024-03-20 11:30:36 +00:00
David Heidelberg
77293c83bd musl-libc doesn't provide GNU version of strerror_r but uses BSD/XSI one (#1911)
* harness: correct include and sort

warning redirecting incorrect #include <sys/errno.h> to <errno.h>

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-03-18 16:37:21 +01: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
Ben Ashbaugh
1260e7f5e0 fix the license header on the spirv-new tests (#1865)
The source files for the spirv-new tests were using the older Khronos
license instead of the proper Apache license.  Fixed the license in
all source files.
2024-01-16 09:58:34 -08:00
niranjanjoshi121
b041ec0a9a Replace OBSOLETE_FORAMT with OBSOLETE_FORMAT (#1776)
* Replace OBSOLETE_FORAMT with OBSOLETE_FORMAT

In imageHelpers.cpp and few other places in image tests, OBSOLETE_FORMAT is misspelled as OBSOLETE_FORAMT.
Fix misspelling by replcaing it with OBSOLETE_FORMAT.

Fixes #1769

* Remove code guarded by OBSOLETE_FORMAT

Remove code guarded by OBSOLETE_FORMAT
as suggested by review comments

Fixes #1769

* Fix formating issues for OBSOLETE_FORMAT changes

Fix formatting issues observed in files while removing
code guarded by OBSOLETE_FORMAT

Fixes #1769

* Some more formatting fixes

Some more formatting fixes to get CI clean

Fixes #1769

* Final Formating fixes

Final formatting fixes for #1769
2023-12-28 18:52:13 +00:00
joshqti
f5bd92b83e Semaphore types bug fixes revised (#1822)
* Added support for SYNC_FD and other handle types

* Fix consistency test

Deleted test cases that are no longer testable
according to the spec.

* Fix multi-import tests

-Delete obsolete code relating to offsets
-Propagate dedicated memory change

* Fix error handling

Some subtests did not fail on incorrect result.
Changes to macros to fail, so this does not occur
again.

* Delete invalid test cases

Test cases are not related to this extension.

* External memory test

Add support for any handle type supported by
the platform.

Change-Id: I6765fde5e7929988f49bfbf2df2f41d5263b6abc

* Update multi-import tests to use new semaphore types

* Fix formatting

* Addressed review comments. Deleted VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_NT_KMT as it appears to be redundant.
2023-11-29 16:02:59 +05:30
Aharon Abramson
be626ca1fa add MIPS architecture (#1837) 2023-11-07 09:36:45 -08:00
Marcin Hajder
72bb711646 Added cl_khr_fp16 extension support for test_explicit_s2v from basic (#1713)
* Added cl_khr_fp16 support for test_explicit_s2v from basic (issue #142, basic)

* Cosmetic corrections

* cosmetic fix

* Added correction to distinguish signed and unsigned char types for ARM architecture tests

* Added missing pieces of convertion procedure to support half

* Corrected condition to verify if additional pragma is necessary (issue #142, basic)

* Add NaN check for half to float conversion

* check-format fixes

* Add NaN check for all float types

Use std::isnan for float/double types.

Change-Id: I005bddccaa3f8490ac59b2aa431ed315733ad143

* Fix Ubuntu build error with isnan macro definition

Change-Id: I671ed826a9631fbbc66d0aa9b674ab00124c7967

* Check format fixes

* NAN define not needed anymore

---------

Co-authored-by: Vasu Penugonda <vpenugon@qti.qualcomm.com>
Co-authored-by: Sreelakshmi Haridas <sharidas@quicinc.com>
2023-10-17 09:38:36 -07:00
Michal Babej
af2710355d add tests for clCommandSVMMemcpyKHR & clCommandSVMMemfillKHR (#1821)
* add tests for clCommandSVMMemcpyKHR & clCommandSVMMemfillKHR

* Fix typo SVMMemfill -> SVMMemFill

* fix clCommandSVMMemFillKHR calls to match extension

* add Khronos license + minor fixes

* review fixes
2023-10-10 09:22:50 -07:00
Kévin Petit
0702f2ecee Make genrand_int32 thread safe (#1797)
The initialisation code is clearly meant to be run once but the volatile
flag did not guarantee that at all:

- Volatile does not mean atomic and loading the flag vs. other writes
  was not safe.
- Multiple threads could have loaded 0 and performed the initialisation
  resulting in write collisions.

Rely on std::call_once to provide the guarantee.

This issue was flagged by TSAN.

Signed-off-by: Kévin Petit <kpet@free.fr>
2023-08-19 11:15:17 +01:00
Kévin Petit
3a1daafd5a harness: add missing stdexcept header (#1783)
Required for std::runtime_error.

Signed-off-by: Kévin Petit <kpet@free.fr>
2023-07-19 13:47:18 +01:00
Marcin Hajder
2495eca9fa Added cl_khr_fp16 extension support for test_commonfns (#1695)
* Added cl_khr_fp16 extension support for commonfns test (issue #142, commonfns)

* Added missing header due to presubmit check

* Corrected radians/degrees ulp calculations + cosmetic fixes

* Corrected presubmit code format

* Corrections related to code review

* Moved string format helper to test_common in separate header

* Added clang format for last commit

* Corrections related to code review

* Modified mix verification procedure for half type to only report max error

* Removed redundant condition for logging mix verification

* Corrected generator limits for half tests
2023-06-27 08:42:02 -07: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
Marcin Hajder
0e229b8f01 Added cl_khr_fp16 extension support for test_fpmath from basic (#1718)
* Added half and double support for fpmath test from basic (issue #142, basic)

* Cosmetic corrections due to code review

* Removed unnecessary casting

* Added corrections due to code review

* Tuning range of input generation to avoid hitting infinity

* Moved string helpers procedures due to request from test_commonfns PR #1695
2023-06-20 08:42:57 -07:00
Sven van Haastregt
475a37abbf [NFC] Do not use reserved names for include guards (#1737)
Names that begin with an underscore followed by an uppercase letter
are reserved for the C++ implementation.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-09 11:25:20 +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
Sven van Haastregt
aa34b4b8c3 [NFC] Remove unused depth_lod variables (#1696)
Remove the remaining unused variables in the test harness.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-04-25 09:16:10 -07:00
Marcin Hajder
f0f887d07f printf test cases for cl_khr_command_buffer extenstion (#1592)
* Added printf test case for cl_khr_command_buffer extenstion according to point 1.6 from:

https://github.com/KhronosGroup/OpenCL-CTS/issues/1369

* Corrections related to macos and windows build

* Added missing header

* Added corrections related to code review of draft PR:

https://github.com/KhronosGroup/OpenCL-CTS/pull/1592

refers to issue #1369, p.1.6:

https://github.com/KhronosGroup/OpenCL-CTS/issues/1369

* minor fix for previous commit

* printf capability condition moved to ::Skip method (#1369, p.1.6):

https://github.com/KhronosGroup/OpenCL-CTS/issues/1369

* Applied minor corrections related to code review (#1369, p.1.6):

https://github.com/KhronosGroup/OpenCL-CTS/issues/1369

* Added correction to replace string literals with sequence of characters printf arguments (issue #1369, printf)

* Added clang formatting.

* Added header related to android build (issue #1369, printf)

* Fixed memory leak

* Fixed memory leak in test_printf

* Added cosmetic fix for last commit
2023-04-04 08:12:05 +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
Marcin Hajder
20ab003053 Added cl_half support for test_printf (#1622)
* Added support to test half floats with printf calls (issue #142, printf)

* Added corrections related to rounding and casting halfs (issue #142, printf)

* Reusing similar function (issue #142, printf)

* Corrected path without cl_khr_fp16 support (issue #142, printf)

* Cosmetic fix for order of vector tests (issue #142, printf)

* Added correction related to vendor test review (issue #142, printf)
2023-03-28 08:57:03 -07:00
Sven van Haastregt
9e0369b307 [NFC] Remove unused printMe variable (#1674)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-03-16 06:23:06 +00:00
Sven van Haastregt
9798a96a9f [NFC] Fix some sign-compare warnings (#1670)
In `os_helpers.cpp`, the preceding `if` already handles negative
values, so cast to unsigned.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-03-12 11:06:55 +00:00
Ben Ashbaugh
e71a7bce68 Revert "Image streams optimization (#1616)" (#1638)
This reverts commit b73c3149ad.
2023-02-28 09:06:34 -08:00