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>
* Initial command-buffer tests
Introduce some basic testing of the
[cl_khr_command_buffer](https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_command_buffer)
extension. This is intended as a starting point from which we can iteratively build up tests
for the extension collaboratively.
* Move tests into derived classes
* Move tests from methods into derived classes implementing
a `Run()` interface.
* Fix memory leak when command_buffer isn't freed when a test
is skipped.
* Print correct error code for
`CL_DEVICE_COMMAND_BUFFER_CAPABILITIES_KHR`
* Pass `nullptr` for queue parameter to command recording entry-points
* Define command-buffer type wrapper
Other OpenCL object have a wrapper to reference count their use
and free the wrapped object. The command-buffer object can't use
the generic type wrappers which are templated on the appropriate
release/retain function, as the release/retain functions are
queried at runtime.
Instead, define our own command-buffer wrapper class where a base
object is passed on construction which contains function pointers
to the release/retain functions that can be used in the wrapper.
* Use create_single_kernel_helper_create_program
Use `create_single_kernel_helper_create_program` rather than
hardcoding `clCreateProgramWithSource` to allow for other types
of program input.
Also fix bug using wrong enum for passing properties on command-buffer
creation, should be `CL_COMMAND_BUFFER_FLAGS_KHR`
* Add out-of-order command-buffer test
Introduce a basic test for checking sync-point use
with out-of-order command-buffers.
This also includes better checking of required queue properties.
* Move media_sharing tests to test_conformance/extensions/
And rename to cl_khr_dx9_media_sharing.
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
* format code
* more format changes
Add tests for API extension for compilation
of kernels in C++ for OpenCL language.
* Test that -cl-std=CLC++ is accepted and a
basic kernel with C++ features is compiled.
* Test that API extension reports the same
language version as __OPENCL_CPP_VERSION__.
This commit also adds a separate folder for extension
tests.
Signed-off-by: Victoria Holodovsky <victoria.holodovsky@arm.com>
Co-authored-by: Victoria Holodovsky <victoria.holodovsky@arm.com>