Commit Graph

1449 Commits

Author SHA1 Message Date
joshqti
239159fd26 Re-enable simple_semaphore_2 (#2123)
Re-enable a disabled external semaphore test.
Delete obsolete subtests that remain in comments.
2024-11-12 10:10:07 -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
Ben Ashbaugh
b149060d52 add SPIR-V 1.4 testing for various miscellaneous additions (#2122)
This PR adds targeted testing for a few remaining miscellaneous SPIR-V
1.4 features:

* Variables in the Function storage class can have a NonWriteable
decoration.
* OpCopyMemorySized can have two optional memory operands.
* OpSelect can have composite operands that are not vectors.
2024-11-11 12:39:00 -08:00
Ahmed Hesham
10130a1261 Fix payload value query for external semaphores (#2127)
When creating a CL semaphore object from a Vulkan semaphore one, we
explicitly pass `-1` as the file descriptor value in the case of
`VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD`. According to the CL
specification:

>     The special value -1 for fd is treated like a valid sync file
>     descriptor referring to an object that has already signaled. The
>     import operation will succeed and the semaphore will have a
>     temporarily imported payload as if a valid file descriptor had
>     been provided.

The test currently checks that the semaphore payload is unsignalled,
unconditionally, which is incorrect.

Changed the test to check for the correct expected payload value.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2024-11-05 23:44:41 +05:30
joshqti
5d4b51b4f2 vulkan: Remove redundant negative testing (#2078)
- negative testing for semaphore functions is accomplished in semaphore
tests, as well as create image in the api test

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-11-05 23:41:52 +05:30
saurabhnv
ef73a1d1ae Import Vulkan resources via named NT handle (#1895)
Add coverage to import Vulkan resources (memory and semaphore) in
Windows via named NT handles.
If no name is given during resource creation, then use NT handles for
import.
If a name is given, have an option to either use that name or get the NT
handle and use that for import.
Resolves KhronosGroup/OpenCL-Docs#943
2024-11-05 10:09:07 -08:00
xinjin01
e211470035 Fix CTS mutable_dispatch memory leak (#2129)
Current class wrapper of the CTS test framework allows getting the
pointer of the private member object. This puts the object at risk of
losing its original value if the pointer gets reassigned, causing a
memory leak and potentially other problems.

This happens to the "clMemWrapper kernel" used by
mutable_command_work_groups tests, where the "clMemWrapper kernel" gets
initialised by the default basic setup function and then it gets
reassigned by the build_program_create_kernel_helper() helper function
through pointer.

This patch fixes this issue by updating mutable_command_work_groups
tests: instead of calling basic setup function and then initialise the
"clMemWrapper kernel" object again in the helper function, it now
overrides the basic setup function to make sure the "clMemWrapper
kernel" will be assigned only once.

Signed-off-by: Xin Jin <xin.jin@arm.com>
2024-11-05 08:53:55 -08:00
David Neto
040dc5f69e kernel_image_methods: Fix size checks in 1Dbuffer case (#2106)
Image height is initialized to 0. But the size calculation should assume
a height of 1.
2024-11-05 08:53:27 -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
Marcin Hajder
6563c9062c Added test to verify required features coupling (#2115)
Fixes #1366 according to task description.
2024-11-05 08:38:45 -08:00
Ben Ashbaugh
c4119f07c1 add SPIR-V 1.4 testing for UserSemantic (#2053)
This PR adds targeted testing for more SPIR-V 1.4 features.
Specifically, this PR adds testing for OpDecorateString,
OpMemberDecorateString, and the UserSemantic decoration.
2024-10-31 07:12:30 -07: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
Sven van Haastregt
8369028c92 cl_khr_semaphore: fix -Wformat warnings (#2124)
Add a `format` parameter to the macro, to be able to specify how to
print the expected and actual parameter values.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-29 09:43:30 -07:00
Harald van Dijk
7d3e1f0b82 Fix check for CL_DEVICE_HALF_FP_CONFIG. (#2108)
When cl_khr_fp16 is not supported, this property is not available.

Note that the spec is different for
CL_DEVICE_{PREFERRED,NATIVE}_VECTOR_WIDTH_HALF: those properties are
always available and return 0 if cl_khr_fp16 is not supported, so those
checks are left as is.
2024-10-29 09:41:16 -07:00
tomasz-platek
66fd9e4742 Fix for out of bounds access (#2105)
Rounding up the clusters_results size to avoid out of bounds access when
subgroup_size is not a multiple of cluster_size.
2024-10-29 09:39:42 -07:00
Sven van Haastregt
dd2454685b [NFC] math_brute_force: use getAllowedUlpError for half (#2086)
Call `getAllowedUlpError` to obtain the allowed ULP error for all of the
half type (fp16) tests. The aim is to standardise obtaining the desired
ULP requirement and pave the way for adding the Embedded Profile ULP
errors.

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

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-29 09:37:51 -07:00
Ben Ashbaugh
bc5f6cdfe8 add SPIR-V 1.4 testing for OpPtrEqual, OpPtrNotEqual, OpPtrDiff (#2054)
This PR adds targeted testing for the SPIR-V 1.4 instructions
OpPtrEqual, OpPtrNotEqual, and OpPtrDiff.
2024-10-29 09:36:26 -07:00
Kamil-Goras-Mobica
b1dfe8a640 Add testing for CL_KERNEL_LOCAL_MEM_SIZE #1235 (#2089)
#1235
2024-10-29 08:55:46 -07:00
Sven van Haastregt
6337d9be46 semaphore: fix mistyped "platform" in log messages (#2128)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-28 17:03:12 -07:00
joshqti
899cbf5cd2 vulkan: accept device selection (#2113)
- read CL_DEVICE_TYPE_ when specified like other conformance tests
- reject non-GPU device types

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-10-22 22:44:57 +05:30
Sven van Haastregt
5b3bfeeca8 [NFC] relationals: fix -Wformat-security warnings (#2084)
Fix a "format string is not a string literal (potentially insecure)"
warning.

There is no security issue here as the format string argument is
constructed using a stringstream right before. Fix this occurrence
anyway to allow enabling the warning globally.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-22 18:00:38 +01: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
Aharon Abramson
482a6bcff0 Some events are not released in test_mem_host_flags (#2104)
In test_mem_host_flags, some events are not released. In fact, they are
not used, so they can be removed altogether.
2024-10-22 09:52:31 -07:00
gorazd-sumkovski-arm
6a2c0b1cff Fix bug in mutable_command_full_dispatch (#2082)
This test did not pass the `-cl-std=` flag when building the program. As
a result, for an OpenCL 3.0 device, the program will be "compiled using
the highest OpenCL C 1.x language version supported" by the device.
However this will force uniform work-group sizes which leads to a
`CL_INVALID_WORK_GROUP_SIZE` error.

To fix this, use the `create_single_kernel_helper()` helper function
which will automatically get the device version and pass that to
`-cl-std=` when building the program.

---------

Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
2024-10-22 09:51:46 -07:00
gorazd-sumkovski-arm
1a17853e75 Command buffer testing fixes (#2081)
Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
2024-10-22 09:50:20 -07:00
joshqti
5026b1be00 vulkan: Use image row pitch (#2077)
When importing a Vulkan external image, query and
pass OpenCL a row pitch if OpenCL is assuming linear for the imported
external handle type. Additionally fix a bug where OpenCL is being told
to create mipmapped images at all times.

---------

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-10-22 09:48:41 -07:00
Ben Ashbaugh
ec6394488a add SPIR-V 1.4 testing for no integer wrap decorations (#2041)
This PR adds targeted testing for SPIR-V 1.4 features. Specifically,
this PR adds testing for the NoSignedWrap and NoUnsignedWrap
decorations.

We can reuse large parts of the testing for the
`cl_khr_spirv_no_integer_wrap_decoration` extension to test the SPIR-V
1.4 feature.
2024-10-22 09:47:57 -07:00
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