The suite's `main()` function already disables the FTZ mode prior to
invoking `runTestHarnessWithCheck` and restores the FP state
afterwards, so tests don't have to do so themselves.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
OpenCL FULL profile requires that online compiler be available.
OpenCL-CTS currently queries profile as well as online compiler
availability via device queries, but doesn't check for the consistency.
Check for consistency that if CL_DEVICE_PROFILE is "FULL_PROFILE"
(or technically is not "EMBEDDED_PROFILE") then CL_DEVICE_COMPILER_AVAILABLE
is CL_TRUE for that device.
Fixes#1763
The verification uses a common function with nested loops to verify
the result of the copy operation. The upper loop limits thirdDim and
SecondDim should be set according to the image type under test. Previously
for 1D/2D they were set from dstImageInfo->depth and dstImageInfo->height.
The issue is that the depth and height are set to 0 when unused. This
caused the verification loop to be skipped.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
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
* 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.
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>
* 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>
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>
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>
* 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.
* 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>
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>
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
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>
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>
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>
Modify the external semaphore extension test
to use SYNC_FD, if available on the device.
Deleted tests that are not compatible with blocking
semaphores.
`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>
* 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>
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>
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>
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>
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>
* 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>
* 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>
* 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>
* 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>
* 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
* 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
* 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
* 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)
`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>
In preparation of re-enabling -Wsign-compare globally, fix some
instances of this warning.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
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>
* 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>
* 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>