Commit Graph

1372 Commits

Author SHA1 Message Date
Ben Ashbaugh
94257defea add SPIR-V 1.4 testing for Image Operands and Loop Controls (#2034)
This PR adds targeted testing for SPIR-V 1.4 features. Specifically,
this PR adds testing for:

1. The new Image Operand for SignExtend and ZeroExtend.
2. The new Loop Controls MinIterations, MaxIterations,
IterationMultiple, PeelCount, and PartialCount.
2024-10-22 09:47:31 -07:00
Sven van Haastregt
d1fe1ec252 conversions: fix condition for adding -cl-denorms-are-zero (#2067)
Commit b6941b6c ("Add fp16 testing to conversions and bruteforce
(#1975)", 2024-06-18) introduced a behavioural change for non-half
tests. The `-cl-denorms-are-zero` option could be added for non-half
tests such as `char_rtn_float` even when `gForceFTZ` was `false`. Fix
the condition by also taking the input and output types into account.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-22 09:45:03 -07:00
xinjin01
63ce937aac Fix bug in mutable_command_full_dispatch (#2118)
The test is missing clFinish after clEnqueueSVMUnmap. Add clFinish after
clEnqueueSVMUnmap.

Signed-off-by: Xin Jin <xin.jin@arm.com>
2024-10-17 07:39:38 -07:00
Ben Ashbaugh
c071db7637 fixes a narrowing warning (treated as an error) affecting some platforms (#2117)
Looks like https://github.com/KhronosGroup/OpenCL-CTS/pull/2063 has a
"narrowing" warning that is now treated as an error and is hence causing
CI builds to fail.

Applies the same fix as
https://github.com/KhronosGroup/OpenCL-CTS/pull/2107 to fix this
warning.
2024-10-16 09:18:59 +02:00
joshqti
115068e2c4 vulkan: Choose where Shaders are generated (#2114)
- generate shader files in VULKAN_TEST_RESOURCES directory
- allows for outside CMakeLists to specify arbitrary destination

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-10-15 10:17:41 -07:00
joshqti
881635a187 vulkan: Propagate fix to multiImport diffCtx (#2075)
Vulkan descriptors are being programmed incorrectly, use fix from 1676
in other subtest

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-10-15 10:09:56 -07:00
Qichao Gu
9f54727924 Fix integer overflow in 1D buffer image tests (#2092) 2024-10-15 10:01:36 -07:00
Marcin Hajder
2998463eb4 Added missing test cases for CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR queries (#2063)
According to comments from issue #1875

---------

Co-authored-by: Nikhil Joshi <nikhilj@nvidia.com>
2024-10-15 08:44:23 -07:00
Ahmed Hesham
1527c4e425 Fix warning now treated as error (#2107)
Following the re-enablement of narrowing warnings, this fixes a
compilation error when running the `ubuntu 22.04 arm` GitHub action.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2024-10-08 13:11:46 -07:00
Ewan Crawford
b64f429b4a Add new extensions to conformance csv files (#2096)
The extension tests in `test_conformance/extensions` have not matching
entries in the `opencl_conformance_tests_*.csv` files. This means that
they are missed from conformance runs by vendors who use these files.

I've included the new extensions in the full and quick CSV files as they
don't have vast combinations of tests to run like bruteforce or
conversions.

I've put `cl_khr_dx9_media_sharing` in the
`test_conformance/opencl_conformance_tests_d3d.csv` CSV as like the
other tests there the test binary is conditional built only on a Windows
platform.

I've created a new `opencl_conformance_tests_vulkan.csv ` file for
testing the `cl_khr_external_semaphore` extension, as creation of the
binary is conditional on the Vulkan SDK being enabled environment. Any
other tests that require the Vulkan SDK in future can also be added
there.
2024-10-08 09:58:31 -07:00
Michal Babej
c40c8d56f6 a few fixes (thread safety & cl_khr_command_buffer UB) (#1840)
some fixes we've been carrying in our CTS fork:

* fix UB in `command_buffer_event_sync.cpp`: enqueue of two commands in
two separate queues, with both using the same buffer argument, and no
synchronization between the commands.
* fix UB in `command_buffer_test_barrier.cpp`: missing synchronization
between zeroing command and command-buffer using two separate queues
* make `test_thread_dimensions.cpp` thread-safe to avoid spurious
errors.
2024-10-08 09:55:21 -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
Sreelakshmi Haridas Maruthur
7d86714c10 bruteforce: Fix retry logic for cases with subnormals (#2091)
Replace the occurrences of 0.0f == test' with 0.0f == HTF(test)'. The
types of 0.0f and test are not the same, so the equality comparison will
get undesired result when the test represents a -0.0h (i.e., test is
32768=0x8000). In this situation, 0.0f == test will be false, but 0.0f
== HTF(test) will be true.

Revise each if-statement to match the OpenCL s7.5.3 Item 4, specifically
modify to check that the result is subnormal instead of checking that it
is zero. "If the result of 3. is a sub-normal before rounding, the
result may be flushed to zero"

Co-authored-by: tnimburk <tnimburk@qti.qualcomm.com>
2024-10-08 09:53:55 -07:00
Marcin Hajder
d339fd4356 Extended printf test to verify length sub-specifiers (#2083)
According to work plan for issue #1058
2024-10-08 08:38:18 -07:00
Jaroslaw Warchulski
9cf439488a Fix printing in test_api_min_max (#2102)
before: Filling constant buffer with 553805440 cl_ints (-2079745536
bytes).
after: Filling constant buffer with 553805440 cl_ints (2215221760
bytes).
2024-10-03 11:58:28 +02:00
joshqti
7cadf60117 vulkan: Use Vulkan 1.1 (#2076)
Increase Vulkan version to 1.1, which is required to support
vkGetBufferMemoryRequirements2.
2024-10-01 22:26:57 +05:30
Sreelakshmi Haridas Maruthur
3a5502539c bruteforce: Fix comparions of unsigned shorts with 0.0f (#2095)
Comparing test (of type cl_half) with 0.0f is incorrect because cl_half
is a typedef of uint16_t (or unsigned short in c)

Co-authored-by: Tejswini Nimburkar <tnimburk@qti.qualcomm.com>
2024-10-01 09:27:42 -07:00
Michal Babej
2be73b2be1 fix generic_address_space, command_buffer_event_sync, test_compiler and images/test_1D_buffer (#2062)
fixes several issues:

* `generic_address_space` test: add check for program scope variables.
The test uses both generic AS and program-scope variables, however it
only checked the generic-AS presence in `clGetDeviceInfo`.
* `compiler/test_compiler_defines_for_extensions.cpp`: add
`cl_khr_command_buffer_multi_device` to the list of recognized
extensions
* `command_buffer_event_sync.cpp`: add delays for testing
`clSetEventCallback` - according to specification, these can be executed
asynchronously (in a separate thread) by the OpenCL implementation,
hence the event callback is not quaranteed to be called before
`clFinish()` returns. Existing test `events/test_callbacks.cpp` also
waits for callback with loops of usleep.
* `images/kernel_image_methods/test_1D_buffer.cpp`: fix allocation size
being too small for the 1D buffer backing the image

---------

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2024-10-01 09:26:39 -07:00
Grzegorz Wawiorko
97cf4c7e25 Math bruteforce test - enable erf/erfc functions (#1289)
It was disabled because lack of reference implementation. However the
reference implementation exists. Then no reason to start testing these
functions.
2024-10-01 09:25:45 -07:00
ellnor01
7e859cc296 Queue profiling and Device timebase equality test (#1150)
Adds test to confirm that the timestamp returned from
clGetEventProfilingInfo for an event on a device and a device
timestamp queried from the same device are in the same timebase.

Fixes #753

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

---------

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2024-10-01 09:25:16 -07:00
Kamil-Goras-Mobica
bcd54787e7 Added fp16 and fp64 api consistency tests (#2058)
#1578
2024-10-01 08:51:37 -07:00
Marcin Hajder
0395a1efef Correction for printing long type variables in 32-bit system (#2094)
Due to change request from #2037
2024-10-01 08:45:39 -07:00
John Kesapides
cd74e02643 Use CTS type wrappers for test_global_linear_id. (#1545)
Signed-off-by: John Kesapides <john.kesapides@arm.com>

---------

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-09-24 18:02:32 +01: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
Ahmed Hesham
0c7fbc46e6 Fix 1D buffer image tests (#2073)
Buffer size needs to be greater than or equal the image row pitch which
was not the case.
2024-09-24 08:53:00 -07:00
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
energystoryhhl
2d077cf12b Add flag to track wether glut has been initialized (#2023)
glutInit double called in CTS CLGL test case code, which will lead
to an error:

freeglut (./test_gl): illegal glutInit() reinitialization attempt
root cause is in: test_conformance/gl/main.cpp:343

            if (glEnv->Init(&argc, (char **)argv, CL_TRUE))
the glEnv->Init has already called in same file line:260, the function
glutInit in glEnv->Init can not be called twice, then a error will occur
although all the gl / CLGL cases are passed. Then in the full quick CTS
running it will appear:

(12-Jul 03:54:01) BEGIN OpenCL-GL Sharing :
           PASSED sub-test.
           PASSED 23 of 23 tests.
(12-Jul 04:01:48) FAILED OpenCL-GL Sharing : (467s, test 34/53)
Although all the gl/CLGL cases are passed, but this group test is judged
to failed.

This issue already been found in
https://github.com/KhronosGroup/OpenCL-CTS/pull/1885
And fixed partly by:
02471c8f56

But I found in setup_osx.cpp, the glutInit still has double init issue,
I add the same fix like previous fix,
can you please help to review?

Signed-off-by: Honglei Huang <Honglei1.Huang@amd.com>
Co-authored-by: Honglei Huang <Honglei1.Huang@amd.com>
2024-09-20 14:34:10 +02: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
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
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
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
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