Commit Graph

1542 Commits

Author SHA1 Message Date
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
Sven van Haastregt
89cd9660be computeinfo: fix memory leak (#2002)
Even on the common code path (i.e., no error paths taken),
test_computeinfo failed to release its allocated memory, preventing a
clean run with LeakSanitizer.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-08 13:34:39 +02:00
Julia Jiang
6b4d57d85c Fix cts build error on mariner OS (#1872) 2024-07-02 09:40:42 -07:00
Ben Ashbaugh
38ae617ca4 add testing for OpExpectKHR with boolean sources (#1904)
Adds a missing test case for OpExpectKHR with boolean sources.
2024-07-02 09:39:33 -07:00
Sven van Haastregt
f775377e6a image_streams: fix -Wformat warnings (#1948)
The main sources of warnings were:

 * Printing of a `size_t` which requires the `%zu` specifier.

* Printing of 64-bit values which is now done using the `PRI*64` macros
to ensure portability across 32 and 64-bit builds.

* Calling log_error with a format string of `"%f %f %f %f"` but
specifying only three arguments.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-02 09:38:36 -07:00
Sven van Haastregt
2d8028668f [NFC] api: remove duplicate and unused macros (#1949)
The removed macros were never used.

Use the more common `ARRAY_SIZE` macro instead of defining an identical
`NELEMS` macro.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-02 09:37:49 -07:00
Sven van Haastregt
269e8185f6 math_brute_force: update README.txt for half testing (#1985)
Half precision math functions are fully tested as of #1975.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-02 09:37:13 -07:00
Haonan Yang
07ddc66d8a Fix typo for log. (#1995)
This aligns with unary_float.cpp.
2024-07-02 09:36:18 -07:00
Julia Jiang
02471c8f56 Fix build errors related with variable defined array length and gl te… (#1957)
…sts logged error
2024-07-02 09:34:53 -07:00
Michal Babej
769984b023 fix bugs in negative command_buffer tests (#1969)
- when calling command buffer APIs, test with `command_queue != NULL`
should return `CL_INVALID_VALUE` only if the device doesn't support
`cl_khr_command_buffer_multi_device` (added `Skip`)

- some tests enqueued commands with multiple invalid arguments, e.g.
`clCommandCopyImageToBufferKHR` with two images and invalid sync points.
AFAIK the order of argument checking is not defined, so implementation
can return any valid error value for such API calls, but the tests
assumed only one particular error would be returned. Fix the API calls
to be unambiguous.
2024-07-02 09:32:12 -07:00
Karol Herbst
89923f8004 Extend printf tests with more %% corner cases (#1986)
We've had a couple of bugs inside mesa/rusticl processing %% correctly.
I've added those cases locally to make sure all corner cases are
properly handled.
2024-07-02 09:30:03 -07:00
Chuang-Yu Cheng
1cd0266ca1 spirv_new: fix test_decorate to use the device's default rounding (#1987)
The verification code assumes the hardware uses CL_HALF_RTE, which
causes a mismatch computation results when the hardware uses RTZ. Fix to
use the hardware's default rounding mode.
2024-07-02 09:29:00 -07:00
Marcin Hajder
340b7c956a Added new cl_khr_semaphore tests to verify clEnqueueWaitSemaphoresKHR negative results (#1965)
According to work plan from
https://github.com/KhronosGroup/OpenCL-CTS/issues/1691

After consultations with @bashbaug I skipped this case:

`CL_INVALID_VALUE if any of the semaphore objects specified by
sema_objects requires a semaphore payload and sema_payload_list is NULL`
2024-07-02 08:43:52 -07:00
Sven van Haastregt
fcbccab4d1 [NFC] math_brute_force: drop unneeded gotos (#1843)
Simplify code by returning directly instead of using goto statements.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-06-27 09:46:33 +02:00
Harald van Dijk
c7b682f12a spirv_new: fix test_decorate. (#1980)
test_decorate was checking for half-precision NAN incorrectly, calling
cl_half_from_float where cl_half_to_float was intended, causing a wrong
expected result.

test_decorate was also printing the expected and actual results
reversed, printing "got -1, want 0", when our implementation already
returned 0.
2024-06-25 09:47:55 -07:00
paulfradgley
ac6931198d Fixed incorrect usage of clGetDeviceIDs num_devices (#1952)
clGetDeviceIDs 'num_devices' output parameter is described as:
> num_devices returns the number of OpenCL devices available that match
device_type.

but the _test_events
out_of_order_event_waitlist_multi_queue_multi_device_ test expects that
after calling:
`clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL, 2, two_device_ids,
&number_returned);`

the content of number_returned needs to be 2, but it should be valid to
return a larger number.

---------

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2024-06-25 09:46:49 -07:00
Kévin Petit
a281046e0e Bump clang-format version to 14 (#1983)
Default version coming with Ubuntu 22.04 that the CI now uses.
2024-06-25 09:44:31 -07:00
Harald van Dijk
80a02cbd48 Disable implicit conversion of copysign arguments. (#1970)
In binary_float.cpp, copysign is special cased. All the reference
functions there take double arguments, except for reference_copysign
which takes float. This commit copies that approach to special case
copysign in binary_double.cpp as well: all the reference functions there
take long double arguments, but this commit changes reference_copysignl
to take double. The rationale for this in binary_float applies equally
to binary_double: conversions of NAN are not required to preserve its
sign bit. On architectures where conversion of NAN resets the sign bit,
copysign fp64 would return incorrect reference results.
2024-06-25 09:42:58 -07:00
Pedro Olsen Ferreira
e2c7e901b8 Add special test for generic address space atomics (#1959)
The atomic operations are tested with generic pointers but in a way
where the compiler can infer the original pointer address space. This
commit adds tests specifically for the case where the compiler cannot
make inferences.
Test that the correct address is used with atomics when the address is
group variant and invariant.
2024-06-25 09:41:23 -07:00
Ewan Crawford
8e6c519354 Negative test for CL_INVALID_QUEUE_PROPERTIES (#1935)
Test that verifies `CL_INVALID_QUEUE_PROPERTIES` is returned from
`clCreateCommandQueue`, `clCreateCommandQueueWithProperties`, and
`clCreateCommandQueueWithPropertiesKHR` to match spec wording

> CL_INVALID_QUEUE_PROPERTIES if values specified in properties are
valid but are not supported by the device.
2024-06-25 09:40:32 -07:00
Sven van Haastregt
2b266434b7 cl_khr_kernel_clock: use create_single_kernel_helper (#1978)
`create_single_kernel_helper` invokes `clBuildProgram` and sets
`-cl-std` to the latest version supported by the context.

The vast majority of tests are using `create_single_kernel_helper`
instead of the `..._create_program` variant, so use the former for the
sake of consistency.

---------

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-06-18 09:44:40 -07:00
Sven van Haastregt
b6941b6c61 Add fp16 testing to conversions and bruteforce (#1975)
Merge the `fp16-staging` branch into `main`, adding fp16 (`half`)
testing to the conversions and math bruteforce tests.

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Guo, Yilong <yilong.guo@intel.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Co-authored-by: Marcin Hajder <marcin.hajder@gmail.com>
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Wawiorko, Grzegorz <grzegorz.wawiorko@intel.com>
Co-authored-by: Sreelakshmi Haridas Maruthur <sharidas@quicinc.com>
Co-authored-by: Harald van Dijk <harald@gigawatt.nl>
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
Co-authored-by: Haonan Yang <haonan.yang@intel.com>
Co-authored-by: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com>
Co-authored-by: niranjanjoshi121 <43807392+niranjanjoshi121@users.noreply.github.com>
Co-authored-by: Wenwan Xing <wenwan.xing@intel.com>
Co-authored-by: Yilong Guo <yilong.guo@intel.com>
Co-authored-by: Romaric Jodin <89833130+rjodinchr@users.noreply.github.com>
Co-authored-by: joshqti <127994991+joshqti@users.noreply.github.com>
Co-authored-by: Pekka Jääskeläinen <pekka.jaaskelainen@tuni.fi>
Co-authored-by: imilenkovic00 <155085410+imilenkovic00@users.noreply.github.com>
Co-authored-by: John Kesapides <46718829+JohnKesapidesARM@users.noreply.github.com>
Co-authored-by: Aharon Abramson <aharon.abramson@mobileye.com>
2024-06-18 09:43:11 -07:00
Ahmed
b3c89ebde0 Fixes for Image_from_buffer_alignment_negative when alignments are 1 (#1971)
The Image_from_buffer_alignment_negative test creates images with
incorrect pitches by adding 1 and tests whether the image creation
fails.

Devices that return 1 for either of
CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT,
CL_IMAGE_REQUIREMENTS_SLICE_PITCH_ALIGNMENT_EXT or
CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT will successfully
create the image and therefore fail the test.

This change allows to skip the image creation in this case as the error
condition (pitch % pitch_alignment != 0) will not be triggered for these
devices.
2024-06-18 09:40:14 -07:00
Sreelakshmi Haridas Maruthur
c8f91c5ead gl: enable cl_khr_fp16 for image write tests (#1974)
Co-authored-by: riteshv <riteshv@qti.qualcomm.com>
2024-06-18 09:30:34 -07:00
Marcin Hajder
582fea57dc Extended printf test with new strings cases (#1951)
According to work plan from issue #1058

Corrections to general test:
-removed duplication of separate tests for each element of
`PrintfTestType` vector, instead `doTest` procedure would iterate over
vector related to specific `PrintfTestType` automaticaly
-fixed procedure to assemble kernel source so it can accept only one
parameter of the function ( eg. `printf("%%");` )
-incorporated important modifications from #1940 to avoid expected
conflicts
-warnings fixes, minor corrections, clang format

Extension for string testing:
-special symbols
-nested symbols
-all ascii characters 
-added new type of test `TYPE_FORMAT_STRING` to verify format string
only (according to request from the issue)
2024-06-18 08:44:18 -07:00
Kamil-Goras-Mobica
d379b58ab6 Added negative tests for clCommandCopy[Buffer, BufferRect, BufferToImage]KHR (#1941)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-06-11 08:42:29 -07:00
Marcin Hajder
806dd2fb61 Added new query for cl_khr_semaphore test to verify device handle list (#1942)
This PR addresses the first part of #1691 issue and #1875 issue.
2024-06-04 23:10:37 +05:30
Sven van Haastregt
a130f3d179 relationals: fix out of bounds accesses in shuffle test (#1961)
The values in `src` are indices into an array in `get_order_string()`.
Not initializing `src` resulted in out of bounds accesses there.

It seems that when the out of bounds accesses happened, the result of
`get_order_string()` was not actually used, so at least the test was not
using random data. Fix the issue as it prevents a clean run of this test
with e.g. AddressSanitizer.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-06-04 09:38:44 -07:00
Shilei Tian
556025ba14 Escape subnormal values (#1953)
Currently we don't escape subnormal values when generating image data.
In sampler read tests, we use `!=` to check the two values even when it
is floating-point data, which requires the two values are bitwise equal.
However, a sampler might flush subnormal values, causing the test case
to fail.

In this patch, when generating random image data, we escape subnormal
values.
2024-05-30 15:19:00 -07:00
Sven van Haastregt
75be6a3125 cl_khr_kernel_clock: fix builtin function names (#1968)
According to the
[specification](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html#kernel-clock-functions),
the work_group and sub_group variants have an `_` in them.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
v2024-05-29-01
2024-05-29 15:14:17 -07:00
Sven van Haastregt
1d3ad8d791 mem_host_flags: check returned pointer for NULL (#1924)
The specification states that `clEnqueueMapImage` and
`clEnqueueMapBuffer` should return NULL on error. Ensure this is
checked.

This testing gap was caught by a compiler warning about `dataPtr` being
written but not read. With this fix, there are no more
Wunused-but-set-variable warnings in this test, so reenable the warning.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-05-29 15:11:32 -07:00
saurabhnv
6807e165d7 Import OpenCL exported semaphore in Vulkan (#1898)
Except for SYNC_FD, current implementation doesn't import exported
OpenCL semaphore in Vulkan and ends up doing signal and wait on
essentially two unrelated semaphores (one created in OpenCL and one in
Vulkan).
Since OpenCL exports the semaphore, import that in Vulkan to perform
signal/wait on the same underlying payload.
2024-05-28 10:20:25 -07:00
pkaur19
1433ffe515 Vulkan interop coverage (#1887)
Added Code changes for 1D, 1DList, 3D, 3DList and test cases.
2024-05-28 10:14:01 -07:00
Kamil-Goras-Mobica
d53d7bc559 Added negative tests for clCommandFill[Buffer, Image]KHR (#1944)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-28 08:39:01 -07:00
Kamil-Goras-Mobica
d3e3bdabaa Negative tests clCommandSvmMem[cpy, Fill]KHR (#1956)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-22 09:18:36 +01:00
Romaric Jodin
fe76832ec8 add missing header (#1966)
test_common/harness/integer_ops_test_info.h is using std::vector but is
not including the header.

This is breaking on Google internal CI.
2024-05-21 13:00:13 -07:00
Ahmed
cdf8d5e35e Add cl_khr_kernel_clock tests (#1960)
Adds cl_khr_kernel_clock test.

Also fixes failure in the compiler defines for extension compiler
subtest when cl_khr_kernel_clock is supported.
2024-05-21 08:49:49 -07:00
Sreelakshmi Haridas Maruthur
5ce18c3f5a basic: workaround MSVC compiler bug with post-increment operator (#1939)
Prevent the compiler from optimizing away initialization loops
2024-05-21 08:47:47 -07:00
Grzegorz Wawiorko
b377b8537b test allocations: restore small number of work items in case of reduction (#1932) 2024-05-21 08:46:14 -07:00
joshqti
4fceb78b93 Add acquire/release (#1899)
Add acquire/release commands where appropriate. This is related to 1886.
2024-05-21 08:45:41 -07:00
John Kesapides
fb39357911 Raw10/12 CTS tests (#1830)
Add support for cl_ext_image_raw10_raw12 testing
on test_image_streams.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-05-21 08:44:28 -07:00
niranjanjoshi121
0353c0bdbe Add negative test for test_svm size check (#1802)
Isuue #875 clarified that CL_INVALID_BUFFER_SIZE should be returned if
clCreateBuffer is passed a pointer returned by clSVMAlloc as its
host_ptr and the size of the buffer exceeds the size of the SVM
allocation.

Add a new negative test to ensure CL_INVALID_BUFFER_SIZE is returned
when the size of buffer exceeds the size of the SVM allocation.

Fixes #1701
2024-05-21 08:43:55 -07:00
Kamil-Goras-Mobica
9500c30492 Negative tests for commandCopyImage[ToBuffer]KHR (#1943)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-21 08:40:08 -07:00
Marcin Hajder
88a707dd13 Corrections for printf test with floating point limits arguments (#1940)
According to work plan from issue #1058
2024-05-21 08:38:04 -07:00
Kamil-Goras-Mobica
e6fec7417f Added negative tests for clCommandBarrierWithWaitListKHR (#1937)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-14 08:43:23 -07:00
Kamil-Goras-Mobica
5093ce5be5 Added negative test commandNDRangeKernel (#1936)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-14 08:42:46 -07:00
Sreelakshmi Haridas Maruthur
aa70c06d8f Fix build breakage introduced by #1911 (#1958) 2024-05-07 10:03:02 -07:00
Sven van Haastregt
46255db86f compiler: fix memory leak (#1950)
The `test_compiler compiler_defines_for_extensions` test did not free
all `malloc`'ed memory.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-04-26 16:32:03 +02:00
Kamil-Goras-Mobica
4c085dec4a Added negative tests for clEnqueueCommandBufferKHR (#1931)
* Added negative tests for clEnqueueCommandBufferKHR

* Added blocking the clEnqueueCommandBufferKHR call on a user event

* Added finalizing buffer before enqueuing
2024-04-21 23:45:33 -07:00