Commit Graph

1212 Commits

Author SHA1 Message Date
Sven van Haastregt
ee504ba861 spirv_new: avoid GLOB for sources in CMakeLists (#1907)
Using `GLOB` here breaks incremental builds when switching between
branches (e.g. when trying out a pull request).  The CMake
documentation discourages use of `GLOB` to collect a list of source
files, so list all source files explicitly.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-03-11 10:13:13 +01:00
Sven van Haastregt
1f0fa08c4f vectors: fix -Wformat warnings (#1910)
Use the `z` length modifier for printing `size_t` types.

Also fix a typo in the error messages.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-03-08 08:08:41 -08:00
Harald van Dijk
6a60db558b Fix uninitialised memory use. (#1909)
CL_DEVICE_MAX_WORK_GROUP_SIZE is specified to fill in a size_t. By
asking it to fill in an uninitialised cl_long, on platforms where size_t
is smaller than cl_long, the high bits of the cl_long remain
uninitialised.
2024-03-08 08:07:09 -08:00
rafaykhurram
26c89df31b subgroups: Add missing algorithm header (#1906)
* Was causing a build error with GN
* fill_and_shuffle_safe_values() in subhelpers.cpp calls std::shuffle()
* std::shuffle is defined in <algorithm>
2024-03-07 13:34:16 +01:00
Sven van Haastregt
e0a31a03fc Fix -Wformat warnings in various tests (#1868)
All of these warnings stem from printing `size_t` types, which should
be done using the `z` length modifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
v2024-02-27-00
2024-02-27 09:59:39 -08:00
Ben Ashbaugh
0052af2227 add tests for cl_khr_expect_assume (#1888)
* initial support for cl_khr_expect_assume

Tests expect with 64-bit SPIR-V binaries.

* add support for assume testing with 64-bit binaries

* add 32-bit SPIR-V files

* fix formatting

* address review comments
2024-02-27 09:57:52 -08: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
Marcin Hajder
a4b5a30210 Added cl_khr_fp16 extension support for test_decorate from spirv_new (#1770)
* Added cl_khr_fp16 extension support for test_decorate from spirv_new, work in progres

* Complemented test_decorate saturation test to support cl_khr_fp16 extension (issue #142)

* Fixed clang format

* scope of modifications:

-changed naming convention of saturation .spvasm files related to
test_decorate of spirv_new
-restored float to char/uchar saturation tests
-few minor corrections

* fix ranges for half testing

* fix formating

* one more formatting fix

* remove unused function

* use isnan instead of std::isnan

isnan is currently implemented as a macro, not as a function, so
we can't use std::isnan.

* fix Clang warning about inexact conversion

---------

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2024-02-13 09:22:32 -08:00
Sven van Haastregt
e1877465cb [NFC] subgroups: remove unnecessary extern keywords (#1892)
In C and C++ all functions have external linkage by default.

Also remove the unused `gMTdata` and `test_pipe_functions`
declarations.

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

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-02-09 07:56:39 -08:00
Ben Ashbaugh
a256e4ad05 add test for cl_khr_spirv_linkonce_odr (#1226)
* initial version of the test with placeholders for linkonce_odr linkage

* add OpExtension SPV_KHR_linkonce_odr extension

* add check for extension

* switch to actual LinkOnceODR linkage

* fix formatting

* add a test case to ensure a function with linkonce_odr is exported

* add back the extension check

* fix formatting

* undo compiler optimization and actually add the call to function a
2024-02-06 09:56:49 -08:00
John Kesapides
d394b0f274 Minor fixes in mutable dispatch tests. (#1829)
* Minor fixes in mutable dispatch tests.

* Fix size of newWrapper in MutableDispatchSVMArguments.
* Fix errnoneus clCommandNDRangeKernelKHR call.

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

* * Set the row_pitch for imageInfo in MutableDispatchImage1DArguments
and MutableDispatchImage2DArguments. The row_pitch is
used by get_image_size() to calculate the size of
the host pointers by generate_random_image_data.

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

---------

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-01-30 09:23:42 -08:00
imilenkovic00
ac7a14ece1 api tests fix: Use MTdataHolder in test_get_image_info (#1871) 2024-01-30 09:22:17 -08:00
Ben Ashbaugh
7dbf31e57f fix the reported platform information for math brute force (#1884)
When the math brute force test printed the platform version it always
printed information for the first platform in the system, which could
be different than the platform for the passed-in device.  Fixed by
querying the platform from the passed-in device instead.
2024-01-30 09:21:38 -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
Pekka Jääskeläinen
8bb89b165c subgroups: fix for testing too large WG sizes (#1620)
It seemed to be a typo; the comment says that it
tries to fetch local size for a subgroup count with
above max WG size, but it just used the previous
subgroup count.

The test on purpose sets a SG count to be a larger
number than the max work-items in the work group.
Given the minimum SG size is 1 WI, it means that there
can be a maximum of maximum work-group size of SGs (of
1 WI of size). Thus, if we request a number of SGs that
exceeds the local size, the query should fail as expected.
2024-01-30 09:13:22 -08:00
joshqti
b5f030faa1 Updated semaphore tests to use clSemaphoreReImportSyncFdKHR. (#1854)
* Updated semaphore tests to use clSemaphoreReImportSyncFdKHR.

Additionally updated common semaphore code to handle spec updates
that restrict simultaneous importing/exporting of handles.

* Fix build issues on CI

* gcc build issues

* Make clReImportSemaphoreSyncFdKHR a required API
call if cl_khr_external_semaphore_sync_fd is present.

* Implement signal and wait for all semaphore types.
2024-01-23 23:39:14 +05:30
Sven van Haastregt
0bdd0fd2fa compiler: fix grammar in error message (#1877)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-01-17 08:05:10 -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
Ben Ashbaugh
0a32b5ca9d fix macos builds by avoiding double compilation of function_list.cpp for test_spir (#1866)
* modernize CMakeLists for test_spir

* add the operating system release to the sccache key

* include the math brute force function list vs. building it twice
2024-01-16 09:54:53 -08:00
Romaric Jodin
7d3db1bd07 fix return code when readwrite image is not supported (#1873)
This function (do_test) starts by testing write and read individually.
Both of them can have errors.

When readwrite image is not supported, the function returns
TEST_SKIPPED_ITSELF potentially masking errors leading to the test
returning EXIT_SUCCESS even with errors along the way.
2024-01-16 09:52:08 -08:00
Yilong Guo
f924273cdd Enable LARGEADDRESSAWARE for 32 bit compilation (#1858)
* Enable LARGEADDRESSAWARE for 32 bit compilation

32-bit executables built with MSVC linker have only 2GB virtual memory
address space by default, which might not be sufficient for some tests.

Enable LARGEADDRESSAWARE linker flag for 32-bit targets to allow tests
to handle addresses larger than 2 gigabytes.

https://learn.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses?view=msvc-170

Signed-off-by: Guo, Yilong <yilong.guo@intel.com>

* Apply suggestion

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>

---------

Signed-off-by: Guo, Yilong <yilong.guo@intel.com>
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
v2024-01-09-04
2024-01-09 09:51:59 -08:00
Sven van Haastregt
ebe8aa0fcc math_brute_force: fix exp/exp2 rlx ULP calculation (#1848)
Fix the ULP error calculation for the `exp` and `exp2` builtins in
relaxed math mode for the full profile.

Previously, the `ulps` value kept being added to while verifying the
result buffer in a loop.  `ulps` could even become a `NaN` when the
input argument being tested was a `NaN`.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-01-09 09:50:34 -08:00
Wenwan Xing
6606fc2e7b Fix bug of conversion from long to double (#1847)
* Fix bug of conversion from long to double

It the input is long type, it should be load as long type, not ulong.

* update long2float
2024-01-09 09:48:56 -08:00
Sven van Haastregt
115bbb3ca2 [NFC] conversions: reenable Wunused-but-set-variable (#1845)
Remove an assigned-to but unused variable.

Reenable the Wunused-but-set-variable warning for the conversions
suite, as it now compiles cleanly with this warning enabled.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-01-09 09:47:04 -08:00
Grzegorz Wawiorko
05ba82ad9a Enhancement: Thread dimensions user parameters (#1384)
* Fix format in the test scope

* Add user params to limit testing

Add parameters to reduce amount of testing.
Helpful for debugging or for machines with lower performance.

* Restore default value

* Print info only if testing params bigger than 0.
2024-01-09 09:43:36 -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
Sven van Haastregt
b36b2d592c integer_ops: fix -Wformat warnings (#1860)
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>
2023-12-20 17:57:35 +01:00
Sven van Haastregt
47d5d371cd geometrics: fix Wsign-compare warnings (#1855)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-12-14 16:26:16 +01:00
Ahmed Hesham
344a88301d Limit individual allocation size using the global memory size (#1835)
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2023-12-12 09:44:56 -08:00
Sreelakshmi Haridas Maruthur
c8ebba8699 c11_atomics: Reduce the loopcounter for sequential consistency tests (#1853)
Reduce the loop from 1000000 to 500000 since the former value
makes the test run too long and cause system issues on certain
platforms
2023-12-12 09:38:14 -08:00
Sreelakshmi Haridas Maruthur
352e707836 thread_dimensions: Avoid combinations of very small LWS and very large GWS (#1856)
Modify the existing condition to include extremely small LWS like
1x1 on large GWS values
2023-12-12 09:35:18 -08:00
Haonan Yang
a73f2b38fb Fix windows stack overflow. (#1839) 2023-12-12 09:33:09 -08:00
Sreelakshmi Haridas Maruthur
9a8fd1f667 allocations: Move results array from stack to heap (#1857)
* allocations: Fix stack overflow

* check format fixes
2023-12-12 09:32:45 -08:00
Kévin Petit
0fa6f236be Increase the number of work items used by the allocations test (#1852)
* Increase the number of work items used by the allocations test

The test uses a fixed number of work items to process very large
buffers and images. As devices support more and more memory, this
leads to an ever-increasing amount of work done in each work item.
This results in some implementations and devices hitting timeout
issues.

Furthermore, a greater number of work items can provide performance
benefits on some devices.

Long term, this test should be redesigned to scale the number
of threads dynamically as a function of the max allocation size.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>

* formatting and add parentheses

---------

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
v2023-12-12-00
2023-12-05 17:09:22 +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
Kévin Petit
5815e2ce33 Reduce the Vulkan interop buffer kernel workgroup size to 128 (#1846)
Vulkan guarantees 128 is always supported.

Relates to #1828

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2023-11-23 19:06:50 +05:30
Ben Ashbaugh
eec46a087a switch to the new memory and semaphore specific device handle lists (#1814)
* switch to the new memory and semaphore specific device handle lists

* remove support for older headers

* dummy commit
2023-11-14 11:28:09 -08:00
Ahmed Hesham
8b1a44f93f Reduce the Vulkan interop buffer kernel workgroup size to 256 (#1828)
Using `local_size_x = 512` in the shader used in the Vulkan interop
tests fails on older hardware because this exceeds the maximum barrier
size limit.

Changed to 256, which is still a multiple of 32 and 64,
and is below the hardware limitations. The tests are not performance
tests anyways, so the performance penalty, if any, is acceptable.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2023-11-15 00:03:46 +05:30
StrahinjaStamenkovic
482126d611 subgroup_functions_ext: fix missing flag initialization (#1826) 2023-11-14 09:10:57 -08:00
Sven van Haastregt
ea6e536ed3 c11_atomics: align signedness of host types (#1816)
Some `HOST_` types were declared with signedness different from the
`HOST_ATOMIC_` counterparts, leading to sign-compare warnings when
comparing between types.  Fix by aligning the signedness.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-11-14 09:09:45 -08:00
Sven van Haastregt
f08b3f6aee profiling: fix -Wformat warnings (#1838)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-11-09 10:27:44 +00:00
Aharon Abramson
be626ca1fa add MIPS architecture (#1837) 2023-11-07 09:36:45 -08:00
Sven van Haastregt
42434d04d0 c11_atomics: fix uninitialized member accesses (#1819)
Initialize the `_memoryOrder` and `_memoryScope` members to avoid
`CBasicTestMemOrderScope::MaxHostThreads()` accessing uninitialized
data.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-11-07 09:32:16 -08:00
John Kesapides
115e999a38 Image2d_from_buffer_positive comparison fix (#1569)
Only check against 2D image types as per the spec.
Move some device checks out of the loop.
Only perform the checks when element_size is a power of two.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-11-07 09:31:18 -08:00
John Kesapides
7e4b59dfaa Delete unused file test_float2int.cpp (#1831)
Remove left over file from (#1537)

https://github.com/KhronosGroup/OpenCL-CTS/pull/1537#issuecomment-1642088122

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-10-30 13:01:34 +00:00
Sreelakshmi Haridas Maruthur
40aaa2bcf2 conversions: Build fix for x86 toolchain (#1827) 2023-10-17 09:49:35 -07:00
Karol Herbst
c6dd6f2aa3 make atomic tests in prog var testing optional (#1799)
This is helpful for testing progvars on implementations not implementing
all the optional atomic features.
2023-10-17 09:40:44 -07: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
niranjanjoshi121
c73d6a341b Add NULL CL_MEM_HOST_PTR check for clGetMemObjectInfo (#1801)
The spec requires implementations return NULL for CL_MEM_HOST_PTR
when the flags passed at memory object creation time do not contain
CL_MEM_USE_HOST_PTR

CTS was not checking this. Add the same check.

Fixes #1752
v2023-10-10-00
2023-10-10 09:25:10 -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