Commit Graph

1157 Commits

Author SHA1 Message Date
niranjanjoshi121
7f0c0aee05 Replace cl_queue_properties_khr with cl_command_queue_properties (#1768)
test_conformance/api/test_queue_properties.cpp uses a cl_queue_properties_khr value
to query CL_DEVICE_QUEUE_PROPERTIES, however this should be a cl_command_queue_properties
typed variable.

Fixes issue #1640
2023-10-03 09:29:20 -07:00
Steven Winston
43d6886810 rewrite test_select to run in a few seconds. (#1665)
* rewrite test_select to run in a few seconds.

* removing the threading; reverting to the original method.

* Merge from Master, remove all suggested changes and start with a simple change report on each change's cost savings:
 BEFORE:
        real    47m8.497s
        user    48m8.860s
        sys     0m14.952s
AFTER:
        real    17m53.383s
        user    18m53.342s
        sys     0m13.297s

initSrcBuffer generates the same random noise every iteration through the loop.  There is no change to the arguments, and the host data itself doesn't need to get rewritten.  Profiling realizes a 2 times speed accel from simply relying upon the buffer to remain randomized at the next loop iteration.

* BEFORE:
        real    17m53.383s
        user    18m53.342s
        sys     0m13.297s
AFTER:
real    12m26.035s
user    13m15.505s
sys     0m15.414s

rearrange a few things in the loops to allow for vectorized / interleaved loop traversal.  NB: not all loops are vectorizable obviously; but this addresses the worst offenders.  Also note, to enable compiler to generate vectorized and interleaved loop traversal build with -o3.

* address the CI format requirements.

* address the CI format requirements.

* address the CI format requirements.
2023-10-03 09:26:48 -07:00
Sven van Haastregt
f39685030f gl: fix sometimes-uninitialized warning (#1815)
Bail out when hitting the default case, so that we don't attempt to
access the uninitialized `error` variable.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-10-02 08:11:55 -07:00
Sven van Haastregt
b143a990d9 select: fix -Wformat warnings (#1817)
* Printing of a `size_t` requires the `%z` specifier.

 * Printing of `cl_long`/`cl_ulong` 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-09-22 07:10:44 -07:00
Sreelakshmi Haridas Maruthur
7759c2669a basic: fix more unused-but-set variables (#1811) v2023-09-21-00 2023-09-21 08:30:32 -07:00
Sven van Haastregt
aa953aaa51 [NFC] cmake: do not suppress -Wsign-compare globally (#1810)
Only disable `-Wsign-compare` for tests that do not compile cleanly
with this warning enabled.  Re-enable the warning for the other tests,
so that it can catch any new occurrences.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-20 15:48:25 +01:00
Sven van Haastregt
1c616238bc test_common: Capitalize macro and clang-format (#1813)
The `CHECK_GL_ERROR` macro was lowercase before, which confused
clang-format and resulted in some odd indentations.  Capitalize the
macro and run clang-format to fix the indentation.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-20 10:19:13 +01:00
Sven van Haastregt
d20913b4e3 test_common: fix -Wformat warnings (#1771)
In preparation of re-enabling -Wformat globally, fix format string
warnings in test_common.

Printing a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-19 12:26:48 +01:00
Sven van Haastregt
d7f24a7986 Fix more -Wsign-compare warnings (#1779)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-14 11:00:30 +01:00
Sven van Haastregt
39cca992b8 math_brute_force: remove gotos in macro_unary_float (#1725)
Simplify code by returning directly instead of using goto statements.

Although intended as an NFC commit, this changes the behaviour when
verification fails: the output buffer is no longer unmapped.  Although
not ideal, this aligns the behaviour of `macro_unary_float` to the
other math_brute_force tests.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-06 13:32:19 +01:00
Ahmed
d20de8ddea Command buffer wait_for_sec_queue_event subtest, call clFinish in the correct order. (#1758)
* Fix for Command buffer wait_for_sec_queue_event subtest, call clFinish in the correct order.

queue has a command that depends on a command that resides in queue_sec, calling clFinish(queue) before clFinish(queue_sec) causes the test to hang as the queue_sec command never got a chance to finish.

* Update PR change as per the suggestion.
2023-09-05 09:09:04 -07:00
Sreelakshmi Haridas Maruthur
15b54aa0bd External memory updates (#1676)
* Vulkan: Fix descriptor sets

Use descriptor set arrays when programming
arrays for compute shader.

Change-Id: Idabab775a256a223660eb7a850e26f290453659e

* Vulkan: Fix queue propertyies

Transfer bit for queue family is not required
to be reported by the implementation, it is
implicit for compute.

Change-Id: I7424b00e25e35145433dd74b0b4dfe7eeeaf98c8

* Vulkan: Allow implementation to choose dedicated memory

Dedicated vs non-dedicated memory must be queried by
the app.  Implementations are not required to support
exportable non-dedicated memory.

Change-Id: Idbc46ace1be20f61d1b58b34756f6d79a7745911

* Fix formatting

Auto-generated formatting fix

* Fix bug in dedicated memory.

* Add check for if OpenCL assumes linear tiling

Change-Id: Idd2e24d9d69e1fbc3ccb4a279067533104185332

* Changed macro name to reflect spec

CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_HANDLE_TYPES_KHR to
CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_IMAGES_HANDLE_TYPES_KHR

Also changed some functions to not use the KHR variants.

---------

Co-authored-by: Joshua Kelly <joshkell@qti.qualcomm.com>
2023-09-05 09:04:38 -07:00
Vishal Patil
c511ac62b0 fix memory leak from argList and from wrong ordering of free and return statement (#1792) 2023-08-29 09:19:45 -07:00
John Kesapides
8fd55dc889 Fix minimum image size for cl_ext_image_requirements_info (#1790)
Some new extension formats require the width to be a multiple
of 4 or 2 (see cl_ext_image_raw10_raw12).
Change has not functional impact as the affected image is only used
for generic queries.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-08-29 09:18:11 -07:00
Ben Ashbaugh
bd548e63e6 fix a sporadic failure in the mutable_command_dimensions test (#1785) 2023-08-29 09:16:53 -07:00
Ewan Crawford
a3262eb4b6 [Command-buffer] Test finalizing empty command-buffer (#1782)
This patch adds two test cases related to command-buffer finalization:

1) That it is an error to finalize and already finalized command-buffer.
See https://github.com/KhronosGroup/OpenCL-Docs/pull/817

2) That it is not an error to create, finalize, and execute an empty
command-buffer. Closes issue #1781
2023-08-29 09:15:39 -07:00
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