Commit Graph

1143 Commits

Author SHA1 Message Date
Joerg
1cede6dc2b Skip testing mipmaps if extension is not available (#2085)
'./test_image_streams test_mipmaps CL_FILTER_NEAREST' already skips many
tests, but doesn't do so for cl_ext_image_raw10_raw12, causing it to
fail.

Add a check similar to how it is done in the other tests already.

On a device which doesn't support mipmap'd access:
W/o fix
```
./test_image_streams test_mipmaps CL_FILTER_NEAREST
...
1Darray passed
2Darray...
-----------------------------------------------------
This device does not support cl_khr_mipmap_image.
Skipping mipmapped image test. 
-----------------------------------------------------

-----------------------------------------------------
This device does not support cl_khr_mipmap_image.
Skipping mipmapped image test. 
-----------------------------------------------------

2Darray passed
cl_image_requirements_size_ext_negative...
...
image_from_buffer_read_positive passed
cl_ext_image_raw10_raw12...
---- Supported 2D read formats for this device for cl_ext_image_raw10_raw12---- 
  CL_R    CL_UNSIGNED_INT_RAW10_EXT 0
  CL_R    CL_UNSIGNED_INT_RAW12_EXT 0
------------------------------------------- 
read_image (normalized float coords, uint results) *****************************
[CL_R    CL_UNSIGNED_INT_RAW10_EXT 1] - CL_FILTER_NEAREST - CL_ADDRESS_CLAMP_TO_EDGE - NORMALIZED
ERROR: clBuildProgram failed! (CL_BUILD_PROGRAM_FAILURE from <>/OpenCL-CTS/test_common/harness/kernelHelpers.cpp:844)
Build options:  -cl-std=CL3.0
Original source is: ------------
#pragma OPENCL EXTENSION cl_khr_mipmap_image: enable
__kernel void sample_kernel( read_only image2d_t input, sampler_t imageSampler, __global float *xOffsets, __global float *yOffsets, __global uint4 *results , float lod)
{
   int tidX = get_global_id(0), tidY = get_global_id(1);
   unsigned int lod_int = (unsigned int) lod;
   int width_lod = (get_image_width(input) >> lod_int) ?(get_image_width(input) >> lod_int):1 ;
   int offset = tidY*width_lod + tidX;
   float2 coords = (float2)( (float)( xOffsets[offset] ), (float)( yOffsets[offset] ) );
   results[offset] = read_imageui( input, imageSampler, coords , lod);
}Build not successful for device <>, status: CL_BUILD_ERROR
Build log for device <> is: ------------
<source>:1:26: warning: unsupported OpenCL extension 'cl_khr_mipmap_image' - ignoring
#pragma OPENCL EXTENSION cl_khr_mipmap_image: enable
                         ^

<source>:9:22: error: no matching function for call to 'read_imageui'
   results[offset] = read_imageui( input, imageSampler, coords , lod);
                     ^~~~~~~~~~~~

error: Compiler frontend failed (error code <unknown>)
```


With fix:
```
./test_image_streams test_mipmaps CL_FILTER_NEAREST
....
image_from_buffer_read_positive...
image_from_buffer_read_positive passed
cl_ext_image_raw10_raw12...
---- Supported 2D read formats for this device for cl_ext_image_raw10_raw12---- 
  CL_R    CL_UNSIGNED_INT_RAW10_EXT 0
  CL_R    CL_UNSIGNED_INT_RAW12_EXT 0
------------------------------------------- 
-----------------------------------------------------
This device does not support cl_khr_mipmap_image.
Skipping mipmapped image test. 
-----------------------------------------------------

cl_ext_image_raw10_raw12 passed
PASSED sub-test.
PASSED 18 of 18 tests.
```
2024-09-24 08:52:10 -07:00
Marcin Hajder
661a7b08ae Added printf test for long type cases (#2037)
according to work plan for issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/1058
2024-09-24 08:42:49 -07:00
Marcin Hajder
8c647c1cf4 Added new tests to verify negative results of clEnqueueSignalSemaphoresKHR (#2006)
According to work plan from issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/1691
2024-09-24 08:41:45 -07:00
Sven van Haastregt
97045f85a1 [NFC] math_brute_force: remove warning options (#2061)
All of these are already set in the top-level `CMakeLists.txt` nowadays,
so no need to repeat them in the test's own `CMakeLists.txt`.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-09-19 07:59:43 -07:00
Cui, Dele
9f88b0b229 Specify precision in the format flag for float4 hexadecimal output (#2064)
This will ensure consistent output on any conforming implementation.
Note that the specification does not define the output style when
precision is missing.

---------

Signed-off-by: Cui, Dele <dele.cui@intel.com>
2024-09-19 09:30:10 +02:00
Ben Ashbaugh
dd2117f5fc fix a few array-based mutable command buffer issues (#2074)
fixes a few minor issues introduced by #1984.

edit: Tested with the updated command buffer emulation layer on a device
that supports out-of-order queues and SVM and all of the
`test_cl_khr_mutable_dispatch` tests pass.
2024-09-17 09:34:17 -07:00
Sven van Haastregt
c083a87b35 [NFC] math_brute_force: add type argument to getAllowedUlpError (#2017)
Add a type argument so that in the future we can request the ULP
requirement for fp16 and fp64 types through `getAllowedUlpError` too.

Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/867

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-09-16 08:48:04 -07:00
Aharon Abramson
a773a379d9 Update test_event_dependencies.cpp (#2049)
In test_event_enqueue_wait_for_events_run_test:
* Decrease TEST_COUNT to 10
* Add clFinish to queues
2024-09-16 08:46:54 -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
Ben Ashbaugh
a395174037 compile Vulkan SPIR-V shaders in CMAKE_CURRENT_BINARY_DIR (#2055)
fixes #2040 

* Compiles the Vulkan SPIR-V files in a directory based off of
CMAKE_CURRENT_BINARY_DIR.
* Changes the search path for the Vulkan SPIR-V files to this directory
rather than a semi-arbitrary set of directories.
2024-09-16 14:28:03 +01:00
Sven van Haastregt
c32a76786c cl_khr_mutable_dispatch: fix -Wformat warnings (#2071)
Printing of a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-09-06 15:48:19 -07:00
Ben Ashbaugh
b57f90eeab Add properties parameter to all command-buffer commands (update) (#2072)
This is an update to #2050, with updates from the main branch.

---------

Co-authored-by: Ewan Crawford <ewan@codeplay.com>
2024-09-06 08:22:37 -07:00
Ewan Crawford
0bdc5d082f Array based clUpdateMutableCommandsKHR changes (#1984)
CTS changes to reflect the spec changes merged in
https://github.com/KhronosGroup/OpenCL-Docs/pull/1045 and requires
header updates from
https://github.com/KhronosGroup/OpenCL-Headers/pull/245

Tested using OCK implementation from
https://github.com/codeplaysoftware/oneapi-construction-kit/pull/501
2024-09-06 07:36:17 -07:00
Sven van Haastregt
9116bb7acb [NFC] math_brute_force: move TestInfoBase to common.h (#2059)
The various forms of `TestInfoBase` have many members in common, so
avoid duplicating the struct definition and move it to `common.h`.

Provide a description and initializer for every struct member, and drop
initializations done with `memset`.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-09-03 18:30:13 +01:00
Marcin Hajder
eb7a30ae42 Modernization of tests from test_semaphores.cpp to align with new SemaphoreTestBase infrastructure (#2029) 2024-09-03 22:53:22 +05:30
saurabhnv
7131f87974 Fix external semaphore test when exportability is not supported (#2045)
An implementation may not support exportable semaphore, subtests
available in cl_khr_external_semaphore assumes support for exportable
semaphore, resulting in failure on such implementation. Allow
implementations to use importable semaphore in such cases.
2024-09-03 10:18:39 -07:00
Sven van Haastregt
90f523ea57 api: fix -Wformat warnings (#2025)
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>
2024-09-02 12:02:28 +02:00
Haonan Yang
a7162188d6 [NFC] Use std::vector to store large size array. (#2060)
windows default stack size is 1M, BUFFER_SIZE is 2 * 1024 * 1024, use
array with BUFFER_SIZE elemets on stack can exceed available stack size
limits.
2024-08-29 14:45:40 +02:00
Sven van Haastregt
c0db608eac printf: add missing vector length modifiers (#2044)
The length modifier is required with a vector specifier.

Fixes https://github.com/KhronosGroup/OpenCL-CTS/issues/2039

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-08-29 14:45:15 +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
Kamil-Goras-Mobica
6cbe8cae35 Added two tests not calling event calback upon error status (#2028)
#1900 
Tested on POCL, callback is not called.
2024-08-20 08:55:03 -07:00
Kamil-Goras-Mobica
746544af80 Strengthen testing of CL_DEVICE_TYPE query and use of CL_DEVICE_TYPE* (#1977)
Issue: #1930
2024-08-20 08:54:06 -07:00
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
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
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
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
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