Commit Graph

1472 Commits

Author SHA1 Message Date
joshqti
b8981f5fb8 [basic] Enable image format aware scanline comparison. (#2042)
Use format aware memory comparison instead of memcmp.
2024-08-13 09:54:09 -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
Marcin Hajder
aa49f3bb53 Added few missing format cases for zero and blank space padding (#2016)
according to work plan for issue #1058
2024-08-13 09:50:07 -07:00
Karol Herbst
21ee05ecaf math_brute_force: stop relying on volatile for IsTininessDetectedBeforeRounding (#2038)
This makes it literally impossible for drivers to constant fold the
IsTininessDetectedBeforeRounding kernel. Sure, drivers might have should
respect volatile here, but I'm not convinced this is actually required
by the spec in a very strict sense, because here there are no
side-effects possible in the first place.

And as far as I know, constant folding is allowed to give different
results than an actual GPU calculation would.

In any case, passing the constants via kernel arguments makes this
detection more reliable and one doesn't have to wonder why the fma test
is failing.

Side note: this was the last bug (known as of today) I had to fix in
order being able to make a CL CTS submission for Apple Silicon devices.
2024-08-13 09:18:33 -07:00
niranjanjoshi121
a406b34091 Fix error return and TEST_PASS for negative SVM tests (#2027)
Fix error return and TEST_PASS for negative SVM tests
Fix review comments from #1802 

Fixes #1964
v2024-08-08-00
2024-08-06 22:50:21 +05:30
Marcin Hajder
d1434ae5aa Added new cl_khr_semaphore tests to verify clCreateSemaphoreWithPropertiesKHR negative results (#1962)
According to work plan from #1691, new clSemaphoreWrapper introduced to
avoid duplication of code
2024-08-06 22:48:45 +05:30
gorazd-sumkovski-arm
3c81548cba Fix issues in test_external_semaphores_cross_queues_io2 (#2036)
1. Fix memory leak by making `context2` use the context wrapper.
2. Create two separate events to associate with the two calls to
`clEnqueueSignalSemaphoresKHR()`, as events cannot be reused.

Also delete the unused helper function
`semaphore_external_cross_queue_helper()` (which was a duplicate of
`external_semaphore_cross_queue_helper()` anyway).
2024-08-06 09:33:30 -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
ellnor01
995e46590e Add clSetCommandQueueProperty test (#1182)
Add test to check that clSetCommandQueueProperty
successfully changes command queue properties.

Fixes #904

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

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2024-08-06 09:31:01 -07:00
Sven van Haastregt
1a9d41867e math_brute_force: only test correctly rounded divide/sqrt for fp32 (#1997)
Skip the correctly rounded divide (divide_cr) and sqrt (sqrt_cr) tests
for fp16 and fp64.

The corresponding build option to enable correctly rounded divide and
sqrt is named `-cl-fp32-correctly-rounded-divide-sqrt` and the
description refers only to "single precision floating-point", so this
option should not apply to fp16 or fp64.

The specification states that fp16 and fp64 divide and sqrt must be
correctly rounded for the full profile, without needing any additional
build options. This is already tested by the regular divide and sqrt
tests. For the embedded profile the ULP requirement is non-zero, but
there is no build option to request a correctly rounded implementation
anyway.

Fixes https://github.com/KhronosGroup/OpenCL-CTS/issues/1901 .
Relates to https://github.com/KhronosGroup/OpenCL-CTS/issues/1996 .

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-08-06 09:29:08 -07:00
ellnor01
13848621f1 Unduplicate kernel_read_write image tests (read) (#1552)
The kernel_read_write tests have a lot of duplicate code. These are the
next steps to reducing the duplication, by using the functions in
test_common.cpp as common for 1D, 1D array and 2D array.

---------

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
Co-authored-by: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com>
2024-08-06 09:28:39 -07:00
Sven van Haastregt
5be093e0c8 math_brute_force: skip all enqueues in -l mode (#1993)
The math_brute_force test has a link-check-only mode to quickly test if
all math functions are present.

In link-check-only mode, most tests return immediately after kernel
compilation, but some tests also run the kernel and read back the result
data before returning. Running the kernels takes a lot more time,
defeating the purpose of the `-l` mode.

Break out at the start of the main `for` loops in link-check-only mode
instead of returning directly, so that each test can still log its
trailing message (in most cases just a `\n`).

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-08-06 09:26:38 -07:00
banan328
8974d74db7 conversions: fix ZeroNanToIntCases from https://github.com/KhronosGroup/OpenCL-CTS/pull/1975 (#2030)
The handling of NaN values in the templated function was incorrect due
to improper initialization of the input data source. Specifically, the
function ZeroNanToIntCases used a global pointer gIn, which was not
correctly set or did not point to the same data as the local input
pointer s used in the non-templated implementation.

to solve the issue I updated the templated function ZeroNanToIntCases to
take an additional parameter for the input data source.
and then passed the correct input data (s) to the templated function
during its invocation.

Co-authored-by: Banan Ashkar <banan.ashkar@mobileye.com>
2024-08-06 09:21:55 -07:00
banan328
89a720d3f7 Added new tests for CL_MUTABLE_DISPATCH_ASSERT_NO_ADDITIONAL_WORK_GROUPS_KHR flag with mutable dispatch (#1991)
Added new tests for
CL_MUTABLE_DISPATCH_ASSERT_NO_ADDITIONAL_WORK_GROUPS_KHR with mutable
dispatch according to this test plan
https://github.com/KhronosGroup/OpenCL-CTS/issues/1897

Co-authored-by: Banan Ashkar <banan.ashkar@mobileye.com>
2024-08-06 09:19:49 -07:00
Marcin Hajder
19cb042985 Extended printf test to support more vector cases (#2019)
according to work plan for issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/1058
2024-08-06 08:45:58 -07:00
Kévin Petit
284f7578e6 Remove outdated readme-spir-v-binaries.txt (#2026)
Completely outdated. Confuses people.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2024-07-29 09:07:21 +01: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
David Neto
0be82dce5e [printf] Test empty format string, and empty arg string (#2018)
Issue: #1058
2024-07-23 20:11:34 +01:00
David Neto
5b5e43e1fb [printf]: input value should be exactly representable as 32-bit float (#2015)
Fixed: #2009
2024-07-18 14:08:43 -07:00
Ahmed Hesham
070052c890 Use sccache on all CI platforms (#2014)
MSVC on Windows was previously omitted from the list of CI platforms
that use sccache. Unify the CMAKE_CACHE_OPTIONS used for all CI
platforms.

In the case of a 100% cache hit, this cuts down the average checks time
from 8 minutes to 4 minutes, example:
https://github.com/ahesham-arm/OpenCL-CTS/actions/runs/9896449792
2024-07-16 09:54:24 -07:00
Sven van Haastregt
39fa6e6d1b math_brute_force: remove spurious tan skip check (#1992)
The `skipTestingRelaxed` check suffers the following problems:

- The use of `skipTestingRelaxed` in the `if` seems reversed: when
skipping correctness testing using the `-l` command line option, this
variable causes correctness testing to be run for relaxed-mode `tan`
regardless.

- Accuracy testing should only be skipped for derived `tan`
implementations. Non-derived `tan` implementations must still be tested
for accuracy, so the condition for setting the `skipTestingRelaxed`
variable is incomplete.

- It is unclear why only `tan` is conditionalized here. There are other
functions such as `tanpi` for which one would expect identical
behaviour.

The actual skipping of accuracy checks for derived implementations
happens in `Test()`, so just remove `skipTestingRelaxed` as it does not
seem to add any value.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-16 09:53:18 -07:00
Sven van Haastregt
8558eb88d7 computeinfo: add CL_DEVICE_HALF_FP_CONFIG (#2001)
The computeinfo test already checks that the cl_khr_fp16 extension is
available before querying `CL_DEVICE_HALF_FP_CONFIG`, but never actually
made the `CL_DEVICE_HALF_FP_CONFIG` query.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-16 09:52:18 -07:00
Marcin Hajder
7b0f4ee861 Added new cl_khr_semaphore tests to verify clReleaseSemaphoreKHR/clRetainSemaphoreKHR negative results (#1976)
According to work plan from issue #1691

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2024-07-16 20:38:28 +05:30
Sven van Haastregt
881560a0fe printf: add missing cstdint include (#2011)
Since GCC 13 some headers are no longer included transitively through
C++ Standard Library headers.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-12 17:23:59 +02:00
Sven van Haastregt
6d60301d20 [NFC] math_brute_force: reformat function list manually (#2008)
clang-format has already been disabled here. Make the function list a
bit easier to read. Make the currently commented out functions stand out
better on a line of their own.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-11 17:25:02 +02:00
Ahmed Hesham
1858922dac Use the --parallel build option in CI workflows (#2004)
Instead of selecting an arbitrary number for the number of parallel
build jobs, use CMake's `--parallel` option instead.

Option was introduced in version 3.12, GitHub runners currently use
CMake version 3.29.6 so this is supported.

Fixes #2003

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2024-07-09 09:59:28 -07:00
Ahmed Hesham
47546a5c4c Drop linking Vulkan directly (#2000)
The `vulkan-wrapper` helper library's purpose is to eliminate the need
to link targets directly to Vulkan, and load it dynamically instead at
runtime, using `dlopen` and `LoadLibrary`.

Remove the direct linking of the Vulkan library from targets that link
to `vulkan-wrapper`.

Fixes #1999

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2024-07-09 09:57:39 -07:00
John Kesapides
dd029cab8f Deduplicate test_imagedim (#1546)
Signed-off-by: John Kesapides <john.kesapides@arm.com>

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-07-09 09:56:42 -07:00
John Kesapides
cabdf6a5fc Use CTS type wrappers for test_basic test_if. (#1540)
Signed-off-by: John Kesapides
[john.kesapides@arm.com](mailto:john.kesapides@arm.com)
2024-07-09 09:55:57 -07:00
John Kesapides
cb9b8db894 Deduplicate test_basic image_array_copy (#1538)
Merge image_array_copy, image_array_copy3d
as they share a lot of common code.

Signed-off-by: John Kesapides <john.kesapides@arm.com>

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-07-09 09:55:16 -07:00
Marcin Hajder
8cd2b7d799 Extended printf test with new mixed format cases (#1988)
According to work plan from issue #1058

Added new case `TYPE_MIXED_FORMAT_RANDOM` which focus on three factors:

-data before conversion flags - this is randomly generated ascii string
-randomly generated conversion flags - integer or floating point, for
each flag specific argument is generated
-data after conversion flags - this is randomly generated ascii string

Moreover, due to fact in case of `TYPE_MIXED_FORMAT_RANDOM` test is
generated on the fly, logging of negative result was extended.
2024-07-09 08:47:31 -07:00
Marcin Hajder
c1af7c3301 Added new tests to verify negative results of clGetSemaphoreInfoKHR (#1981)
According to work plan from issue #1691
2024-07-09 08:46:37 -07:00
Sven van Haastregt
89cd9660be computeinfo: fix memory leak (#2002)
Even on the common code path (i.e., no error paths taken),
test_computeinfo failed to release its allocated memory, preventing a
clean run with LeakSanitizer.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-08 13:34:39 +02:00
Julia Jiang
6b4d57d85c Fix cts build error on mariner OS (#1872) 2024-07-02 09:40:42 -07:00
Ben Ashbaugh
38ae617ca4 add testing for OpExpectKHR with boolean sources (#1904)
Adds a missing test case for OpExpectKHR with boolean sources.
2024-07-02 09:39:33 -07:00
Sven van Haastregt
f775377e6a image_streams: fix -Wformat warnings (#1948)
The main sources of warnings were:

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

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

* Calling log_error with a format string of `"%f %f %f %f"` but
specifying only three arguments.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-02 09:38:36 -07:00
Sven van Haastregt
2d8028668f [NFC] api: remove duplicate and unused macros (#1949)
The removed macros were never used.

Use the more common `ARRAY_SIZE` macro instead of defining an identical
`NELEMS` macro.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-02 09:37:49 -07:00
Sven van Haastregt
269e8185f6 math_brute_force: update README.txt for half testing (#1985)
Half precision math functions are fully tested as of #1975.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-02 09:37:13 -07:00
Haonan Yang
07ddc66d8a Fix typo for log. (#1995)
This aligns with unary_float.cpp.
2024-07-02 09:36:18 -07:00
Julia Jiang
02471c8f56 Fix build errors related with variable defined array length and gl te… (#1957)
…sts logged error
2024-07-02 09:34:53 -07:00
Michal Babej
769984b023 fix bugs in negative command_buffer tests (#1969)
- when calling command buffer APIs, test with `command_queue != NULL`
should return `CL_INVALID_VALUE` only if the device doesn't support
`cl_khr_command_buffer_multi_device` (added `Skip`)

- some tests enqueued commands with multiple invalid arguments, e.g.
`clCommandCopyImageToBufferKHR` with two images and invalid sync points.
AFAIK the order of argument checking is not defined, so implementation
can return any valid error value for such API calls, but the tests
assumed only one particular error would be returned. Fix the API calls
to be unambiguous.
2024-07-02 09:32:12 -07:00
Karol Herbst
89923f8004 Extend printf tests with more %% corner cases (#1986)
We've had a couple of bugs inside mesa/rusticl processing %% correctly.
I've added those cases locally to make sure all corner cases are
properly handled.
2024-07-02 09:30:03 -07:00
Chuang-Yu Cheng
1cd0266ca1 spirv_new: fix test_decorate to use the device's default rounding (#1987)
The verification code assumes the hardware uses CL_HALF_RTE, which
causes a mismatch computation results when the hardware uses RTZ. Fix to
use the hardware's default rounding mode.
2024-07-02 09:29:00 -07:00
Marcin Hajder
340b7c956a Added new cl_khr_semaphore tests to verify clEnqueueWaitSemaphoresKHR negative results (#1965)
According to work plan from
https://github.com/KhronosGroup/OpenCL-CTS/issues/1691

After consultations with @bashbaug I skipped this case:

`CL_INVALID_VALUE if any of the semaphore objects specified by
sema_objects requires a semaphore payload and sema_payload_list is NULL`
2024-07-02 08:43:52 -07:00
Sven van Haastregt
fcbccab4d1 [NFC] math_brute_force: drop unneeded gotos (#1843)
Simplify code by returning directly instead of using goto statements.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-06-27 09:46:33 +02:00
Harald van Dijk
c7b682f12a spirv_new: fix test_decorate. (#1980)
test_decorate was checking for half-precision NAN incorrectly, calling
cl_half_from_float where cl_half_to_float was intended, causing a wrong
expected result.

test_decorate was also printing the expected and actual results
reversed, printing "got -1, want 0", when our implementation already
returned 0.
2024-06-25 09:47:55 -07:00
paulfradgley
ac6931198d Fixed incorrect usage of clGetDeviceIDs num_devices (#1952)
clGetDeviceIDs 'num_devices' output parameter is described as:
> num_devices returns the number of OpenCL devices available that match
device_type.

but the _test_events
out_of_order_event_waitlist_multi_queue_multi_device_ test expects that
after calling:
`clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL, 2, two_device_ids,
&number_returned);`

the content of number_returned needs to be 2, but it should be valid to
return a larger number.

---------

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2024-06-25 09:46:49 -07:00
Kévin Petit
a281046e0e Bump clang-format version to 14 (#1983)
Default version coming with Ubuntu 22.04 that the CI now uses.
2024-06-25 09:44:31 -07:00
Harald van Dijk
80a02cbd48 Disable implicit conversion of copysign arguments. (#1970)
In binary_float.cpp, copysign is special cased. All the reference
functions there take double arguments, except for reference_copysign
which takes float. This commit copies that approach to special case
copysign in binary_double.cpp as well: all the reference functions there
take long double arguments, but this commit changes reference_copysignl
to take double. The rationale for this in binary_float applies equally
to binary_double: conversions of NAN are not required to preserve its
sign bit. On architectures where conversion of NAN resets the sign bit,
copysign fp64 would return incorrect reference results.
2024-06-25 09:42:58 -07:00
Pedro Olsen Ferreira
e2c7e901b8 Add special test for generic address space atomics (#1959)
The atomic operations are tested with generic pointers but in a way
where the compiler can infer the original pointer address space. This
commit adds tests specifically for the case where the compiler cannot
make inferences.
Test that the correct address is used with atomics when the address is
group variant and invariant.
2024-06-25 09:41:23 -07:00