* Added negative tests for clEnqueueCommandBufferKHR
* Added blocking the clEnqueueCommandBufferKHR call on a user event
* Added finalizing buffer before enqueuing
* Added negative tests for clRetainCommandBufferKHR, clReleaseCommandBufferKHR, clFinalizeCommandBufferKHR
* Added blocking the clEnqueueCommandBufferKHR call on a user event
* Changed cl_event to clEventWrapper
* Corrections to mutable arguments tests
-added verification of device capabilities against mutable arguments
-corrected fail of 2 tests with Construction Kit
-general cleanup
* cleanup corrections
* restored relaxed version of mutable arguments tests
* corrections to strengthen the test around SVM arguments
* Added test to cover iterative mutable argument update
According to issue description #1481
* cosmetic correction
* clang format fix
* Corrections due to code review
* Added test to cover overwritten update of mutable parameters
According to issue description #1481
* cosmetic corrections
* Corrections due to code review
* Added new test to cover multiple comands dispatch in one enqueued update
According to issue description #1481
* clang format correction
* Few minor corrections
* cosmetic corrections
* Added new tests for simultaneous use with mutable dispatch
-cross queue simultaneous use
-in-order queue with simultaneous use
According to issue description #1481
* Several corrections applied:
-reordered Skip conditions to check valid simultaneous_use_support flag
-removed unnecessary SetUpKernel call
-initialize kernel and memory buffers from BasicCommandBufferTest
instead BasicMutableCommandBufferTest
* Corrections for command buffer creation to request simultaneous property
* Added command buffer with full mutable dispatch test
According to #1481 issue description, point 2.1
* Corrected the test to handle all available mutable properties
According to #1481 issue description, point 2.1
* Minor fixes in mutable dispatch tests.
* Fix size of newWrapper in MutableDispatchSVMArguments.
* Fix errnoneus clCommandNDRangeKernelKHR call.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* * Set the row_pitch for imageInfo in MutableDispatchImage1DArguments
and MutableDispatchImage2DArguments. The row_pitch is
used by get_image_size() to calculate the size of
the host pointers by generate_random_image_data.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
---------
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* Updated semaphore tests to use clSemaphoreReImportSyncFdKHR.
Additionally updated common semaphore code to handle spec updates
that restrict simultaneous importing/exporting of handles.
* Fix build issues on CI
* gcc build issues
* Make clReImportSemaphoreSyncFdKHR a required API
call if cl_khr_external_semaphore_sync_fd is present.
* Implement signal and wait for all semaphore types.
* Added support for SYNC_FD and other handle types
* Fix consistency test
Deleted test cases that are no longer testable
according to the spec.
* Fix multi-import tests
-Delete obsolete code relating to offsets
-Propagate dedicated memory change
* Fix error handling
Some subtests did not fail on incorrect result.
Changes to macros to fail, so this does not occur
again.
* Delete invalid test cases
Test cases are not related to this extension.
* External memory test
Add support for any handle type supported by
the platform.
Change-Id: I6765fde5e7929988f49bfbf2df2f41d5263b6abc
* Update multi-import tests to use new semaphore types
* Fix formatting
* Addressed review comments. Deleted VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_NT_KMT as it appears to be redundant.
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>
* 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.
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
Modify the external semaphore extension test
to use SYNC_FD, if available on the device.
Deleted tests that are not compatible with blocking
semaphores.
* 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 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>
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>
Semaphore spec has been updated to reflect the fact that semaphores
will be in the appropriate - pending signal or pending wait - state
when returning from clEnqueueSignalSemaphore or
clEnqueueWaitSemaphore commands: KhronosGroup/OpenCL-Docs#882
Deleted the following tests to match the updated spec:
semaphores_order_1 - Test calls EnqueueWaitSemaphore before calling
EnqueueSignalSemaphore and expects this wait to succeed.
This behavior is not compatible with the recent
spec updates to semaphores.
semaphores_order_2 & semaphores_order_3 - Calling
clEnqueueSignalSemaphoresKHR with a dependency on a user event may
cause the implementation to block until the user event is complete.
This is unsafe usage of clEnqueueSignalSemaphoresKHR and may
lead to deadlock.
semaphores_invalid_command - This test checks for specific behavior
when waiting on a semaphore in an invalid state.
According to the spec, this is undefined behavior,
and therefore cannot be tested directly.
Co-authored-by: Joshua Kelly <joshkell@qti.qualcomm.com>
* Add check for CL_COMMAND_BUFFER_STATE_EXECUTABLE_KHR after completion.
Added check for state CL_COMMAND_BUFFER_STATE_EXECUTABLE_KHR in state info tests.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Add wait for event.
Wait for event to guarantee that a command-buffer has finished executing by this point.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Add new event to wait for.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
---------
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Added initial commit for issue #1369, p.1.4
* Added support for clGetCommandBufferInfoKHR test cases (issue #1369, p.1.3)
* Added correction for CL_COMMAND_BUFFER_QUEUES_KHR query test (issue #1369, p.1.4)
* Added corrections related to changed orders of operations Skip/SetUp and code review (issue #1369, clGetCommandBufferInfoKHR)
* Added cosmetic correction related to printout messages (issue #1369, clGetCommandBufferInfoKHR)
* Corrected info_prop_array test to accept scenario without simultaneous use (issue #1369, p.1.4)
* Added protection test agains POCL unexpected values (issue #1369, p.1.4)
* Added corrections related to Ben's code review
* Add mutable dispatch tests.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Mutable dispatch buffer tests redesigned to inherit from command buffer tests.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Add remaining tests for clGetMutableCommandInfoKHR.
Added tests for missing queries:
* CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR
* CL_MUTABLE_DISPATCH_KERNEL_KHR
* CL_MUTABLE_DISPATCH_DIMENSIONS_KHR
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Minor code cleanup.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Introduce review changes.
Introduce changes requested in review:
- Remove bitwise chceck for CL_DEVICE_MUTABLE_DISPATCH_CAPABILITIES_KHR
- Add error check for clFinalizeCommandBufferKHR
- Add global_work_size to clCommandNDRangeKernelKHR for CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR
- Move BasicMutableCommandBufferTest to a separate header file
- Change name of file command_buffer_test_mutable_dispatch.cpp to mutable_command_info.cpp
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Set global_work_size on every use of clCommandNDRangeKernelKHR.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Apply changes for review.
- Add error check for init_extension_functions()
- Check mutable_capabilities for non-zero
- Replace clKernelWrapper with cl_kernel for CL_MUTABLE_DISPATCH_KERNEL_KHR test
- Replace clCommandBufferWrapper with cl_command_buffer_khr for CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR test
- Remove unneded test_command_buffer declarations
- Check type for CL_MUTABLE_COMMAND_COMMAND_TYPE_KHR
- Remove retain() from operator= in clCommandBufferWrapper
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Apply changes for review.
Apply changes for review:
- Fix header guards
- Add copyright header
- Change checks for test_kernel, test_queue
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
---------
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Add external semaphore tests.
Added basic test to check the functionality of cl_ext_external_semaphore_test extension.
Tests rely on Vulkan API as the producer of the external semaphore functionality. The
Vulkan wrapper has been copied from the Vulkan CTS tests and minor changes have been
introduced. A separate copy of the Vulkan wrapper is for breaking any dependencies
between different CTS modules and thus make the build system simpler.
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>
* Move vulkan wrapper to a separate library.
Vulkan wrapper is extracted as a separate module and can be used in different
CTS tests as a shared library.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Add cl_ext_external_samaphore tests based on cl_khr_semaphore tests.
Added cl_khr_semaphore adjusted to creating semaphores in Vulkan context
and importing them through export semaphore functionality in OpenCL
(cl_ext_external_samaphore).
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Cleanup.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Fix build issues.
* Add missing directories for build cl_ext_external_semaphore.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Set Vulkan lib directory.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Change extension directory name.
Changed extensions directory name from cl_ext_external_semaphore to cl_khr_external_semaphore.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Remove unneeded compile options.
Removed VK_USE_PLATFORM_WIN32_KHR option from cl_khr_external_semaphore
compilation arguments.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
---------
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Added initial commit for event sync test cases (issue #1369, p.3.3)
* Added test cases for return event scenarios with and without out-of-order, work in progress (#1369, p.3.3)
* Added support for return event test cases for both regular and out-of-order command queue (#1369, p.3.3)
* Added user event test cases, cosmetic corrections (#1369, p.3.3)
* Added correction for windows build (#1369, p.3.3)
* Corrected proper testing of test fail/skip conditions (#1369, p.3.3)
* Added corrections related to PR review (#1369, p.3.3)
* Added correction related to change of order Skip/SetUp (issue #1369, event sync)
* Added clang format correction for previous commit
* Reordered initialization of attributes.
* Added test cases for profiling command-buffers according to issue description #1369, p.3.2:
https://github.com/KhronosGroup/OpenCL-CTS/issues/1369
* Added cosmetic fixes (#1369, p.3.2)
* Corrected the path of initialization profiling event for simultaneous test (#1369, p.3.2):
https://github.com/KhronosGroup/OpenCL-CTS/issues/1369
* clang format fix
* Added correction related to macos build error (#1369, p.3.2)
* Applied corrections related to code review (#1369, p.3.2)
* Corrected query of queue properies (issue #1369, command buffer profiling)
* Reverted formating of unrelated header
* Added code review corrections for type consistency and fail condition (issue #1369, p.3.2)
* Reordered initialization of attributes.
* Reverted correct order of initialization.
* Add test for clGetEventInfo info queries.
Test clGetEventInfo() info queries from event returned by command-buffer
enqueue for the single command-queue to command-buffer case:
* CL_EVENT_COMMAND_TYPE is CL_COMMAND_COMMAND_BUFFER_KHR
* CL_EVENT_COMMAND_QUEUE
* CL_EVENT_CONTEXT
* CL_EVENT_COMMAND_EXECUTION_STATUS
* CL_EVENT_REFERENCE_COUNT
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
* Fix return TEST_FAIL instead of -1.
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
---------
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
The `command_buffer` member is initialized with `this`, and should
thus be initialized after all other members have been initialized, to
avoid any potential uninitialized data accesses by `command_buffer`'s
constructor. This is currently not a problem, but would become a
problem when `command_buffer`'s constructor accesses the object
through its parameter.
Fixes a -Wreorder warning.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Added tests for 1.1 individual command entry-points.
* Adding fixes pointed out in review: checks for CL_DEVICE_IMAGE_SUPPORT, remove redundant buffers, synchronisation issues, fixed clang-format, other minor issues.
* Fix compilation issues for Windows and macOS, fix clang-format.
* Fix compilation issue for Windows.
* Removed redundant blocking and event operations.
* Style fixes for test skip conditions.
* Fix clang format.
* Fixed function names, file names, comments and barrier test.
* Restored Individual command entry-points tests after merge with main.
* Fix clang format.
* Superficial fixes for review.
* Fix Skip() condition for barrier test
* Fix typos
* Fix new line
Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>