Commit Graph

1141 Commits

Author SHA1 Message Date
Sven van Haastregt
c23631c690 subgroups: fix Wsign-compare warnings (#1778)
The subgroup and workgroup sizes reported by clGetKernelSubGroupInfo
and clGetKernelWorkGroupInfo are of type `size_t`.  Avoid changing the
values to an `int` type as they are propagated through the tests and
then compared against `size_t` again.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-08-29 09:14:23 -07:00
Sven van Haastregt
46fde8d051 atomics: fix memory leaks on error paths (#1732)
Before this change, `add_index_bin_test` would not release `cl_mem`
resources or `malloc`ed memory when encountering an error.  Fix by
using `clMemWrapper` and `std::unique_ptr` to automatically release
resources.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-08-29 09:13:03 -07:00
Kévin Petit
ddbb0de4b9 ci: use ubuntu-22.04 instead of 20.04 (#1795)
* ci: use ubuntu-22.04 instead of 20.04

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

* bump clang-format version

Oldest supported by 22.04

* update check-format script

---------

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2023-08-22 18:13:22 +01:00
Kévin Petit
0702f2ecee Make genrand_int32 thread safe (#1797)
The initialisation code is clearly meant to be run once but the volatile
flag did not guarantee that at all:

- Volatile does not mean atomic and loading the flag vs. other writes
  was not safe.
- Multiple threads could have loaded 0 and performed the initialisation
  resulting in write collisions.

Rely on std::call_once to provide the guarantee.

This issue was flagged by TSAN.

Signed-off-by: Kévin Petit <kpet@free.fr>
2023-08-19 11:15:17 +01:00
Ewan Crawford
df53e02a12 [command-buffer] Remove deleted enum (#1798)
The enum value `CL_COMMAND_BUFFER_STATE_INVALID_KHR` no longer exists:
* https://github.com/KhronosGroup/OpenCL-Headers/pull/235
* https://github.com/KhronosGroup/OpenCL-Docs/pull/885

Replace variable initialization using this enum with a value where
all the bits are set, requiring the runtime to write to it for the
test to pass.
2023-08-17 11:15:59 +01:00
Sven van Haastregt
ddf46ca9e8 math_brute_force: always initialize oldMode (#1796)
Avoid a maybe-uninitialized warning by ensuring that `oldMode` is
always initialized to 0.  There is no need to use `memset` for this,
as `FPU_mode_type` is either an `int` or an `int64_t`.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-08-07 13:51:29 +01:00
Sreelakshmi Haridas Maruthur
aa23f345c3 Add testing for sync_fd (#1747)
Modify the external semaphore extension test
to use SYNC_FD, if available on the device.

Deleted tests that are not compatible with blocking
semaphores.
2023-08-01 11:03:00 -07:00
Sven van Haastregt
e29d0fd3a1 conversions: fix memory leak from excess gMTdata initialization (#1787)
`gMTdata` was initialized twice, but freed only once.

Drop the first initialization with a local seed, and initialize with
`gRandomSeed` instead.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-08-01 09:49:43 +01:00
John Kesapides
a01349c44e Use CTS type wrappers for test_basic test_loop (#1541)
* Use CTS type wrappers for test_basic test_loop
* Move variable declaration to first use in verify_loop

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-07-27 14:00:03 +01:00
Sven van Haastregt
0460756f6e basic/int2fp: fix missing include (#1789)
With GCC 13 some headers are no longer included transitively through
C++ Standard Library headers.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-07-23 09:36:23 +01:00
John Kesapides
25ce398037 Use CTS type wrappers for test_constant. (#1543)
Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-07-20 16:13:42 +01:00
John Kesapides
339c932c57 Use the CTS typewrappers in image_r8 (#1539)
Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-07-19 14:18:49 +01:00
John Kesapides
cd5c165946 Deduplicate test_barrier (#1542)
Merge test_barrier and test_wg_barrier.

Reformat using clang-format kernel source code.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-07-19 13:51:30 +01:00
Kévin Petit
3a1daafd5a harness: add missing stdexcept header (#1783)
Required for std::runtime_error.

Signed-off-by: Kévin Petit <kpet@free.fr>
2023-07-19 13:47:18 +01:00
Sven van Haastregt
c3babfeebb conversions: fix undefined behaviour from shift by 64 (#1788)
Avoid a shift by 64 on a `uint64_t`.  The value resulting from the
spurious shift was overwritten later, so just avoid the shift in that
case.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-07-19 09:48:59 +01:00
Nora
3c1f2814b8 add cl_khr_expect_assume to test_compiler_defines_for_extensions (#1735) 2023-07-18 16:07:17 -07:00
Sven van Haastregt
19bddc90e4 conversions: restore optimization workaround
The refactoring of the conversions test dropped the workaround added
by 59a12047a ("Fix for test_conversions failure with Clang build on
Linux #1057 (#1062)", 2021-05-11).

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-07-14 15:50:41 +01:00
Sven van Haastregt
b32d566bca conversions: fix undefined behaviour in DataInfoSpec
For conversion from integers to float, the DataInfoSpec constructor
tries to convert `CL_FLT_MAX` to an integer.  The float value cannot
be represented as an integer, which is undefined behaviour.

Fix by only doing this conversion when `InType` is a floating point
value.

While at it, use `static_cast` for the conversions.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-07-14 15:50:41 +01:00
Paweł Jastrzębski
6c841fbad8 Add image arguments tests for cl_khr_command_buffer_mutable_dispatch. (#1750)
* Add image arguments tests for cl_khr_command_buffer_mutable_dispatch.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Add fixes for MutableDispatchImage1DArguments and MutableDispatchImage2DArguments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix constant magic number.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix condition for result check.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Changes made:
- Fix kernel parameters
- Fix indentation
- Add skip condition for CL_DEVICE_IMAGE_SUPPORT

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Change array data type.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Changes made:
- Fix skip conditions
- Fix kernel arguments update
- Change random generated values for dst_image

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Remove unneeded headers.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

---------

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
2023-07-11 13:52:16 -07:00
Paweł Jastrzębski
c69bc00b56 Add arguments tests for cl_khr_command_buffer_mutable_dispatch. (#1749)
* Add arguments tests for cl_khr_command_buffer_mutable_dispatch.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Add clFinish and clEnqueueCommandBufferKHR to mutable dispatch global arguments test.

Applied review comments for mutable dispatch global arguments test:
- clFinish to ensure command-buffer has finished executing for calling clUpdateMutableCommandsKHR
- Add second clEnqueueCommandBufferKHR for the command-buffer again before calling clEnqueueReadBuffer so that the kernel runs with the new argument

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Add clFinish and clEnqueueCommandBufferKHR to remaining mutable dispatch arguments test.

Applied review comments for remaining mutable dispatch arguments test:
- clFinish to ensure command-buffer has finished executing for calling clUpdateMutableCommandsKHR

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix clang format.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix clang format.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Recover proper MutableDispatchGlobalArguments test.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Recover proper MutableDispatchNullArguments test.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix constant magic number.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review changes.

Changes made:
- Remove unneeded headers
- Remove unneeded variable
- Remove unneeded skip condition
- Fix type int -> cl_int

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix tests definitions.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix compilation error.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix clang format.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix clang format.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix clang format.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix clang format.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

---------

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
2023-07-11 13:04:30 -07:00
Paweł Jastrzębski
ae1a712e3e Add out of order tests for cl_khr_command_buffer_mutable_dispatch. (#1746)
* Add out of order tests for cl_khr_command_buffer_mutable_dispatch.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Replace CL_KERNEL_EXEC_INFO_SVM_PTRS with cl_mutable_dispatch_arg_khr command-buffer mutable buffer update.

CL_KERNEL_EXEC_INFO_SVM_PTRS limits the test to devices which support SVM.
Updating arg_list with a cl_mutable_dispatch_arg_khr struct is one of the
best supported, and also easiest to verify, configurations to change.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix skip condition.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review changes.

Changes made:
- Fix skip condition
- Add event
- Add memory verification

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

---------

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
2023-07-11 10:43:29 -07:00
Paweł Jastrzębski
64130824a8 Add global size tests for cl_khr_command_buffer_mutable_dispatch. (#1744)
* Add global size tests for cl_khr_command_buffer_mutable_dispatch.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Add kernel with observable output.

We should check that's some observable output from the kernel
as a result of the change to global work size, not just that
clGetMutableCommandInfoKHR has been updated. For example,
getting every work-item to call get_global_size() inside of
the kernel and writing it to a buffer, then reading the buffer
after the command-buffer enqueue has finished and check it
matches what we expect.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Applied review comments for mutable dispatch global arguments test:
- clFinish to ensure command-buffer has finished executing for calling clUpdateMutableCommandsKHR
- Change variable and constant names for global size

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Changes made:
- Fix skip conditions
- Remove obsolete variable
- Replace a variable with a constant

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Changes made:
- Remove explicit base class call
- Fix condition check
- Fix constant magic number

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix constant magic number.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Remove uneeded comments.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

---------

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
2023-07-11 09:41:43 -07:00
Paweł Jastrzębski
3b7fda2071 Add local size tests for cl_khr_command_buffer_mutable_dispatch. (#1745)
* Add local size tests for cl_khr_command_buffer_mutable_dispatch.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Add kernel with observable output.

We should check that's some observable output from the kernel
as a result of the change to local work size, not just that
clGetMutableCommandInfoKHR has been updated. For example,
getting every work-item to call get_local_size() inside of
the kernel and writing it to a buffer, then reading the buffer
after the command-buffer enqueue has finished and check it
matches what we expect.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

    Applied review comments for mutable dispatch local size test:
    - clFinish to ensure command-buffer has finished executing for calling clUpdateMutableCommandsKHR
    - Change variable and constant names for local size

Applied review comments for mutable dispatch global arguments test:
- clFinish to ensure command-buffer has finished executing for calling clUpdateMutableCommandsKHR

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Changes made:
- Fix skip conditions
- Remove obsolete variable
- Replace a variable with a constant

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Remove explicit base class call.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix constant magic number.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Update global size and local size to meet the spec requirements.

Make sure work-groups number is not increased after update of command-buffer.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Remove uneeded includes.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

---------

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
2023-07-11 08:56:49 -07:00
Paweł Jastrzębski
1ab4b26821 Add tests for external sharing not dependant on semaphores. (#1648)
* Add tests for external sharing not dependant on semaphores.

Additional external sharing tests that use fences instead of semaphores.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix clang-format

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Apply changes for review.

Apply changes for review:
- Make VkFence + clFinish a synchronization option to existing tests
instead of creating a separate test that uses fence.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix build break.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix resource release conditions.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix fence usage.

Fixed following fence issues:
- Add missing link to command buffer
- Add fence reset before wait

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Add Vulkan wrapper for fence.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Rework fence reset.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Change synchronisation mechanisms.

Changes made:
- wait for fence with clFinish
- queue submit with wait for fence

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Replace clFinish with vkWaitForFences.

Replaced clFinish with vkWaitForFences in Vulkan exectution context.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Replace remaining clFinish with vkWaitForFences.

Replaced remaining clFinish with vkWaitForFences in Vulkan exectution context.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments for synchoronisation simplification.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments for synchoronisation simplification for remaining tests.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix condition check.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

---------

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
2023-07-11 08:55:37 -07:00
Marcin Hajder
2686b9e2c1 Modernization of conversions test (#1719)
* Modernization of conversions test, preparation to handle cl_khr_fp16 extension

* Added missing virtual descructor

* Added corrections due to code review

* More separators removed

* Fixed clang format

* Added multiple corrections related to code review

* Corrected missing implicit test lost after modernization corrections

* Corrected single, selected test to limit number of unnecessary operations
2023-07-11 08:52:25 -07:00
Marcin Hajder
3a1388a2b4 Added cl_khr_fp16 extension support for test_vloadstore from basic (#1734)
* Added cl_khr_fp16 support for test_vloadstore from basic (issue #142, basic)

* Moved string helper procedures due to request from test_commonfns PR #1695

* restored original test sizes

* Corrected invalid initialization of reference buffer
2023-07-11 08:51:05 -07:00
Marcin Hajder
40b3eb3f7f Added cl_khr_fp16 extension support for test_op_vector_extract from spirv_new (#1765)
* Added cl_khr_fp16 extension support for test_op_vector_extract from spirv_new (issue #142)

* Added missing condition to test available cl_khr_fp16 extension
2023-07-11 08:49:44 -07:00
Marcin Hajder
1e2d3522cf Added cl_khr_fp16 extension support for test_op_vector_insert from spirv_new (#1766)
* Added cl_khr_fp16 extension support for test_op_vector_insert from spirv_new, work in progress.

* Added cl_khr_fp16 extension support for test_op_vector_insert from spirv_new (issue #142)
2023-07-11 08:48:41 -07:00
Sven van Haastregt
9e8430a6a6 [NFC] clang-format basic/test_enqueue_map.cpp (#1777)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-07-03 10:07:32 +01:00
Sven van Haastregt
9b0f78549a workgroups: fix program/kernel object leak (#1775)
`create_single_kernel_helper` is called in a loop, overwriting the
objects contained in the wrapper classes.  The wrapper class is not
aware of this, as the overwriting happens through its `operator&`.

Move the wrapper objects into the loop, so that the contained objects
get released as soon as the program and kernel objects are no longer
needed.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-30 11:22:43 +01:00
Sven van Haastregt
845ec694bb workgroups: fix -Wsign-compare warnings (#1774)
In preparation of re-enabling -Wsign-compare globally, fix some
instances of this warning.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-29 12:20:15 +01:00
Sven van Haastregt
729cd8b7a9 [NFC] device_execution: use raw string literals for block kernels (#1767)
Modernize by using raw string literals, which makes the kernel sources
easier to read/extract.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-28 09:34:07 +01:00
Ewan Crawford
75aca34e60 Test CL_COMMAND_BUFFER_CONTEXT_KHR (#1697)
Test coverage for spec PR https://github.com/KhronosGroup/OpenCL-Docs/pull/899
which introduces a new cl_khr_command_buffer query for the cl_context
2023-06-28 08:13:15 +01:00
Paweł Jastrzębski
56974a5858 Add global offset tests for cl_khr_command_buffer_mutable_dispatch. (#1743)
* Add global offset tests for cl_khr_command_buffer_mutable_dispatch.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Add kernel with observable output.

We should check that there's some observable output from the kernel
as a result of the change to global work offset, not just that
clGetMutableCommandInfoKHR has been updated. E.g we could call
get_global_offset() inside of the kernel, write something to a
buffer based on that, and read the buffer after the command-buffer
enqueue has finished.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Applied review comments for mutable dispatch global offset test:
- clFinish to ensure command-buffer has finished executing for calling clUpdateMutableCommandsKHR
- Change variable and constant names for global offset
- Remove redundant return CL_SUCCESS

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Changes made:
- Fix skip conditions
- Remove obsolete variable
- Replace a variable with a constant

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Changes made:
- Remove explicit base class call
- Fix constant magic number

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix constant magic number.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix clang-format.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix condition for result check.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

---------

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
2023-06-27 08:54:14 -07:00
Paweł Jastrzębski
fee6d6bb66 Command buffer re-enqueue testing. (#1738)
* Command buffer re-enqueue testing.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Remove reenqueue tests and add reenqueue to existing tests.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Add re-enqueue for copy and barrier tests.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix review comments.

Applied review comments for command buffer re-enqueue testing:
- Add second clEnqueueCommandBufferKHR for all tests
- Reinitialise memory before second enqueue of command buffers
- Add different patterns for second enqueue of command buffers

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix verification patterns for second enqueue tests.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Reinitialise output memory for second command buffer re-enqueue.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix cast for conversion from 'const cl_char' to 'const cl_uint.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix compilation error for MSVC.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Reinitialise in_mem and out_mem with zero.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

* Fix cast for conversion from 'const cl_int' to 'const cl_uint'.

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>

---------

Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
2023-06-27 08:47:24 -07:00
Marcin Hajder
73ead9da04 Added cl_khr_fp16 extension support for test_op_negate from spirv_new (#1762)
* Added cl_khr_fp16 extension support for test_op_negate from spirv_new (issue #142)

* Added clang format fix
2023-06-27 08:43:44 -07:00
Marcin Hajder
43c244f01d Added cl_khr_fp16 extension support for test vector_times_scalar from spirv_new (#1757)
* Added cl_khr_fp16 support for vector_times_scalar from spirv_new (issue #142, spirv_new)

* Logging correction
2023-06-27 08:42:56 -07:00
Marcin Hajder
2495eca9fa Added cl_khr_fp16 extension support for test_commonfns (#1695)
* Added cl_khr_fp16 extension support for commonfns test (issue #142, commonfns)

* Added missing header due to presubmit check

* Corrected radians/degrees ulp calculations + cosmetic fixes

* Corrected presubmit code format

* Corrections related to code review

* Moved string format helper to test_common in separate header

* Added clang format for last commit

* Corrections related to code review

* Modified mix verification procedure for half type to only report max error

* Removed redundant condition for logging mix verification

* Corrected generator limits for half tests
2023-06-27 08:42:02 -07:00
Marcin Hajder
60f025a7da Added cl_half support for test_select (#1617)
* Added cl_half support for test_select (issue #142, select)

* Added corrections due to code review + performance optimization + replaced C object with wrappers

* minor fix

* Corrected use of user event

* Removed unnecessary user event
2023-06-27 08:40:35 -07:00
Sven van Haastregt
2e88013b34 compiler: fix memory leak from unnecessary strdup (#1761)
The result of the `strdup` was never freed.  The string duplication
isn't necessary, so remove it.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-21 22:08:21 -07:00
Sven van Haastregt
50f9f06323 test_common: fix -Wsign-compare warnings (#1759)
In preparation of re-enabling `-Wsign-compare` globally, avoid mixing
signed and unsigned integers in comparisons in test_common.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-21 15:19:21 +01:00
Marcin Hajder
df3ec8deec Added cl_khr_fp16 extension support for test_int2fp from basic (#1742)
* Added cl_khr_fp16 and cl_khr_fp64 support for float2int and int2float tests from basic

* removed debug output

* Replaced procedure to generate random half values in specific range (issue #142, basic)

* Added cosmetic fixes due to code review comments

* Moved string helper procedures due to request for test_commonfns PR #1695
2023-06-20 08:44:45 -07:00
Marcin Hajder
0e229b8f01 Added cl_khr_fp16 extension support for test_fpmath from basic (#1718)
* Added half and double support for fpmath test from basic (issue #142, basic)

* Cosmetic corrections due to code review

* Removed unnecessary casting

* Added corrections due to code review

* Tuning range of input generation to avoid hitting infinity

* Moved string helpers procedures due to request from test_commonfns PR #1695
2023-06-20 08:42:57 -07:00
Sven van Haastregt
44b2578ac7 basic: fix unused-but-set variables (#1764)
Remove the unused `numItems` variable.

As this fixes all occurrences of this warning in test_basic, remove
the suppression flag.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-16 10:53:08 +01:00
Marcin Hajder
16a75dc0af Added cl_khr_fp16 extension support for test_vector_creation from basic (#1728)
* Added cl_khr_fp16 extension support for vector_creation test from basic

* Added corrections related to vendor's review

* Added protection to avoid similar creation cases

* Added comment for recent correction

* cosmetics

* Corrected factor array to restore lost capacity of original test..

leaving only 16-sizes vector tests limited.
2023-06-13 08:41:39 -07:00
Marcin Hajder
095091bc57 Added cl_khr_fp16 extension support for test_vec_type_hint from basic (#1724)
* Added cl_khr_fp16 extension support for test_vec_type_hint from basic (issue #142, basic)

* Added correction to fix casting problem
2023-06-12 23:39:22 -07:00
Sven van Haastregt
475a37abbf [NFC] Do not use reserved names for include guards (#1737)
Names that begin with an underscore followed by an uppercase letter
are reserved for the C++ implementation.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-09 11:25:20 +01:00
Sven van Haastregt
c8061ab21a mem_host_flags: use size_t for element count (#1755)
More recent GCC versions (e.g. 12.2, 13.1) report that the argument to
`new[]` in the `Init` methods exceeds the maximum object size,
seemingly related to the negative range of the widened `int`.

Use an unsigned type to avoid the warning and propagate the signedness
change to other uses of the `num_elements` member.

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

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-08 13:27:20 +01:00
Romaric Jodin
1011f8ea81 fix async strided test outputing error during verify (#1754)
This bug was introduced by
https://github.com/KhronosGroup/OpenCL-CTS/pull/1711

Ref google/clspv#1127
2023-06-07 15:53:12 +01:00
Sven van Haastregt
658a8b62fb [CI] Build Vulkan loader with USE_GAS=ON (#1756)
https://github.com/KhronosGroup/Vulkan-Loader/pull/1212 broke builds
that set `USE_GAS=OFF`.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-07 15:07:25 +01:00