Commit Graph

1542 Commits

Author SHA1 Message Date
Kamil-Goras-Mobica
308fa6e78c Added negative tests for clRetainCommandBufferKHR, clReleaseCommandBu… (#1928)
* Added negative tests for clRetainCommandBufferKHR, clReleaseCommandBufferKHR, clFinalizeCommandBufferKHR

* Added blocking the clEnqueueCommandBufferKHR call on a user event

* Changed cl_event to clEventWrapper
2024-04-19 14:01:38 -07:00
Sven van Haastregt
7dc9593d88 test_vulkan: don't throw from destructors (#1947)
Only report an error (and include the error code), but don't throw an
exception as that would call `terminate`.  Failure to release
resources is not fatal in other parts of the CTS.

This fixes `-Wterminate` warnings:

  warning: ‘throw’ will always call ‘terminate’ [-Wterminate]
  note: in C++11 destructors default to ‘noexcept’

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-04-16 10:11:08 -07:00
Pedro Olsen Ferreira
43237f74a8 Remove dead code (#1946)
This is 7-year old CMake code that never did anything because the
function invocation is missing the PROPERTIES keyword.
Adding the keyword results in build errors, so just drop the dead code
since everything seems to be working without it anyway.
2024-04-16 08:54:28 -07:00
Pedro Olsen Ferreira
a977e35e0b Delete stale files (#1945)
These aren't included or built anywhere.
2024-04-16 08:53:59 -07:00
David Tobolik
61a220ff33 fix: move suggested_local_size to test_api (#1916) 2024-04-16 08:49:24 -07:00
Romaric Jodin
be8b56d949 Test IMAGE1D_BUFFER in more scenario (#1806)
* cl_copy_images

* cl_get_info

* cl_fill_image

* cl_read_write_image

* kernel_image_methods

* IMAGE1D_BUFFER cannot be created with (USE_|ALLOC_|COPY_)_HOST_PTR

* do not allow mipmap with 1D buffer

* adjust M to be within maximum_sizes and max_pixels

* remove unused variables

* make sure M will never be 0

* fix region[0] after refactoring removing mipmap

* fix formatting

* format with clang-format-11

* fix image1d_buffer creation with gEnablePitch

* add missing case in switch

* use align_malloc when CL version is at least 2.0

* use CL_DEVICE_NUMERIC_VERSION and align_free

* fix free of pitch buffer

* fix formatting

* fix formatting

* fix data->is_aligned
2024-04-16 08:48:05 -07:00
Kamil-Goras-Mobica
7fa567c7a5 Corrections for negative tests for function CreateCommandBufferKHR (#1915) 2024-04-16 08:40:44 -07:00
Sven van Haastregt
1139f54bde device_execution: fix -Wformat warnings (#1938)
Printing of a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-04-15 13:37:07 +02:00
joshqti
48b987827e Fix cross-context semaphore signals (#1886)
Multi-context test was not correctly
testing cross-context functionality.
Use semaphore import/export mechanism
to signal across contexts.
2024-04-09 08:59:49 -07:00
Kamil-Goras-Mobica
d0300d176f Added negative tests for clGetCommandBufferInfoKHR (#1929)
* Added negative tests for clGetCommandBufferInfo

* Replaced param_value_size values from 0 to sizeof() - 1
2024-04-09 08:54:44 -07:00
Marcin Hajder
f2a30737b6 Corrections for mutable arguments tests (#1921)
* Corrections to mutable arguments tests

-added verification of device capabilities against mutable arguments
-corrected fail of 2 tests with Construction Kit
-general cleanup

* cleanup corrections

* restored relaxed version of mutable arguments tests

* corrections to strengthen the test around SVM arguments
2024-04-09 08:50:03 -07:00
Sven van Haastregt
5fe1cc01c0 spirv_new: fix -Wformat warnings (#1933)
`log_error` was invoked from a template function, but the format
specifiers weren't adjusted for the template parameter types.  Use a
stringstream for printing instead.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-04-05 12:28:20 +02:00
Ben Ashbaugh
27e47e9e87 fix the type used for bitfield_extract_signed (#1913)
We compute the reference values using unsigned types exclusively,
even when the input type is signed.  This fixes one place where
an signed type was inadvertently used.
2024-04-04 13:08:41 -07:00
Sven van Haastregt
48003e9d32 [NFC] subgroups: clarify bs128 to uint4 conversion (#1893)
There appears to have been some confusion over `uint_mask` during the
initial reviews of the subgroup tests.  Add a comment to clarify the
purpose of the mask.

Use a 32-bit all-ones mask (`0xffffffff`) instead of a 64-bit all-ones
mask to further clarify the intent, that is, don't delay discarding
the upper 32 bits until the assignment but mask them out immediately.

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

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-04-04 15:12:10 +02:00
saurabhnv
7f1caf4aa9 Shader -> SPIR-V at CTS build time (#1849) (#1878)
* Shader -> SPIR-V at CTS build time (#1849)

Instead of relying on prebuilt checked-in SPIR-V files, compile
available shaders at CTS build time.

* Add dependency on glslc (available as part of VULKAN_SDK).
* Add optional build flag BUILD_GLSL_SHADERS, OFF by default.

* Remove pre-built SPIR-V files

* Compile Shader -> SPIR-V at CTS build time

* Use glslangValidator for shader -> spirv

* Add glslangValidator tool for shader -> spirv

* Refactor glslangValidator tool retrieval

* Address review comments

* Use add_subdirectory() instead of include()
* Use glslang instead of glslangValidator
* Update Github actions CI to install Vulkan SDK
2024-04-02 10:16:45 -07:00
Sven van Haastregt
83203db6e2 half: fix -Wformat warnings (#1927)
Avoid casting to `uint64_t` in some places; instead keep the types as
`size_t` and use the `%z` length modifier, or as
`uint32_t` and use the `%u` specifier.

For printing of 64-bit types, use the `PRI*64` macros from <cinttypes>
to ensure portability across 32 and 64-bit builds.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-03-27 14:46:27 +01:00
Marcin Hajder
96361171ed Added test to cover iterative mutable argument update (#1925)
* Added test to cover iterative mutable argument update

According to issue description #1481

* cosmetic correction

* clang format fix

* Corrections due to code review
2024-03-26 08:39:18 -07:00
Marcin Hajder
349427e4aa Added test to cover overwritten update of mutable parameters (#1922)
* Added test to cover overwritten update of mutable parameters

According to issue description #1481

* cosmetic corrections

* Corrections due to code review
2024-03-26 08:38:38 -07:00
Sven van Haastregt
049b719eea relationals: fix -Wformat-truncation warning (#1918)
`inOrderStr` and `outOrderStr` are both written into `orderName`,
which may not fit as all three are the same size.  Decrease the sizes
of `inOrderStr` and `outOrderStr`.  The new sizes are still
sufficiently large to hold the result of `get_order_string`.

This commit only affects the error path and does not change the
printed output.  Error logs before and after this commit should not
differ.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-03-20 13:54:50 +01:00
Ahmed Hesham
0deddf2ce7 Fix failing image tests for CL_UNORM_INT_101010_2 (#1917)
Add support for `CL_UNORM_INT_101010_2` in the `get_pixel_size` helper
function. This fixes the following tests:
* memInfo_image_from_buffer_positive
* image_from_buffer_alignment_negative
* imageInfo_image_from_buffer_positive

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2024-03-20 11:30:36 +00:00
Marcin Hajder
da4a30d394 Added new test to cover multiple commands dispatch in one enqueued update (#1919)
* Added new test to cover multiple comands dispatch in one enqueued update

According to issue description #1481

* clang format correction

* Few minor corrections

* cosmetic corrections
2024-03-19 08:42:42 -07:00
Marcin Hajder
8f3ef0891d Added new tests for simultaneous use with mutable dispatch (#1912)
* Added new tests for simultaneous use with mutable dispatch

-cross queue simultaneous use
-in-order queue with simultaneous use

According to issue description #1481

* Several corrections applied:

-reordered Skip conditions to check valid simultaneous_use_support flag
-removed unnecessary SetUpKernel call
-initialize kernel and memory buffers from BasicCommandBufferTest
instead BasicMutableCommandBufferTest

* Corrections for command buffer creation to request simultaneous property
2024-03-19 08:41:41 -07:00
Ben Ashbaugh
109c0a1ddd configure depdendabot github actions version updates (#1923) 2024-03-19 07:10:19 -07:00
David Heidelberg
77293c83bd musl-libc doesn't provide GNU version of strerror_r but uses BSD/XSI one (#1911)
* harness: correct include and sort

warning redirecting incorrect #include <sys/errno.h> to <errno.h>

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-03-18 16:37:21 +01:00
Sven van Haastregt
4c318a1617 [CI] Upgrade to actions/checkout@v4 (#1920)
Node.js 16 actions are deprecated, so update to v4 which uses Node 20.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-03-18 10:38:35 +01:00
Sven van Haastregt
d8ad10d1ea device_execution: fix CL_QUEUE_* in error messages (#1896)
When reporting errors from `clCreateCommandQueueWithProperties`,
report the correct property names.  In particular:

`CL_QUEUE_DEVICE` should be `CL_QUEUE_ON_DEVICE`.
`CL_QUEUE_DEFAULT` should be `CL_QUEUE_ON_DEVICE_DEFAULT`.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-03-12 09:36:02 -07:00
Marcin Hajder
ffb0265abd Added command buffer test with all mutable parameters dispatch (#1905)
* Added command buffer with full mutable dispatch test

According to #1481 issue description, point 2.1

* Corrected the test to handle all available mutable properties

According to #1481 issue description, point 2.1
2024-03-12 09:33:57 -07:00
niranjanjoshi121
6530ae45b5 Add NULL CL_MEM_HOST_PTR check for all flag combinations (#1850)
* Add NULL CL_MEM_HOST_PTR check for clGetMemObjectInfo

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

* Add NULL CL_MEM_HOST_PTR check for all flag combinations

As part of suggestions to #1801, add NULL CL_MEM_HOST_PTR
check for all flag combinations.

Fixes #1752

* Fix formatting issues
2024-03-12 09:31:46 -07:00
BZZiv
90cefbb38e Bug fix in test_async_copy_fence - wrong events usage (#1736) 2024-03-12 09:25:22 -07:00
Yilong Guo
a045f76eed [subgroups][non_uniform_broadcast] Fix broadcasting index generation (#1680)
* [subgroups][non_uniform_broadcast] Fix broadcasting index generation

The subgroup size may not be greater than `NR_OF_ACTIVE_WORK_ITEMS`.
Broadcasting index needs to be reduced in that case.

Otherwise, if subgroup size == `NR_OF_ACTIVE_WORK_ITEMS` == 4, then we
will encounter "divide-by-zero" error when evaluating `bcast_index %
(n - NR_OF_ACTIVE_WORK_ITEMS)`.

* Revert "[subgroups][non_uniform_broadcast] Fix broadcasting index generation"

This reverts commit 9bbab539de.

* [subgroups][non_uniform_broadcast] Fix broadcasting index generation

Dynamically activate half of the work items in the current subgroup
instead of hardcoding as `NR_OF_ACTIVE_WORK_ITEMS`.

* Apply suggestion
2024-03-12 09:25:06 -07:00
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