Fixes vulkan validation layer error:
Vulkan validation layer: Validation Error: [
VUID-vkDestroyDevice-device-05137 ] Object 0: handle =
0xf56c9b0000000004, type = VK_OBJECT_TYPE_DEVICE_MEMORY; | MessageID =
0x4872eaa0 | vkCreateDevice(): OBJ ERROR : For VkDevice
0x5555598c2400[], VkDeviceMemory 0xf56c9b0000000004[] has not been
destroyed. The Vulkan spec states: All child objects created on device
must have been destroyed prior to destroying device
(https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-vkDestroyDevice-device-05137)
Clarify that the first number is the work-item.
Print hexadecimal numbers with a `0x` prefix.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This change extends the test coverage for
https://github.com/KhronosGroup/OpenCL-Docs/pull/1280
The change tests:
1. Writing to immutable buffers.
2. Writing to buffer/image from immutable buffers.
3. Reading from immutable buffers.
This change adds the following tests:
1. `test_negative_imagearraycopy`
2. `test_negative_imagearraycopy3d`
3. `test_immutable_bufferreadwriterect`
4. `test_immutable_arrayreadwrite`
5. `test_write_from_immutable_buffer_to_buffer`
6. `test_immutable_buffer_map_*`
and extends the following tests:
1. `test_arrayimagecopy3d`
2. `test_arrayimagecopy`
3. `test_imagearraycopy3d`
4. `test_imagearraycopy`
5. `test_buffer_copy`
6. `test_buffer_partial_copy`
Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
This PR adds negative tests for the following API functions:
- clCreateContext
- clCreateContextFromType
- clRetainContext
- clReleaseContext
- clSetContextDestructorCallback
Also, define a new macro `test_object_failure_ret` to test for an
expected error code and the returned object is `NULL` as a result of a
failure.
Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
Add test for clCreateSubBuffer using a buffer created from a
AHardwareBuffer
Signed-off-by: Alex Davicenko <alex.davicenko@arm.com>
Co-authored-by: Alex Davicenko <alex.davicenko@arm.com>
Introduce `HostHalf` wrapper class to eliminate explicit
`cl_half_from_float`
and `cl_half_to_float` conversions throughout the test code. The wrapper
provides semantic value constructors/operators and automatic
conversions,
simplifying half-precision arithmetic operations.
Key improvements:
- `HostHalf` class with operator overloading for arithmetic and
comparisons
- Type traits `is_host_atomic_fp_v` and `is_host_fp_v` for generic FP
handling
- Unified floating-point atomic operations (add/sub/min/max/exchange)
- Removed 300+ lines of half-specific conditional branches
- Consistent calculation for all FP types
Due to discussion from #2542 and following work from closed PR #2568
This change refactors the external semaphore tests by unifying
`external_semaphores_import_export_fd` with
`external_semaphores_cross_context` tests, removing duplicated logic and
avoiding OS-specific conditions. The updated test now covers all
import/export handle types consistently across single- and multi-context
scenarios.
What was wrong:
enqueue_copy_buffer_to_image (and the related write/fill tests) mis-set
imageInfo.rowPitch to width*height*pixelSize. Because get_image_size
multiplies row pitch by height, this wrongly calculates the intended
buffer size.
How it’s fixed: set rowPitch to the true per-line pitch
(width*pixelSize) for all buffer-backed image cases so the calculated
sizes match the actual data layout and stay within the expected memory
footprint.
Signed-off-by: Xin Jin <xin.jin@arm.com>
The tests checks that invalid parameters for
clSetKernelArgDevicePointerEXT are reported successfully and ensure that
a kernel can access a buffer from their respective device address on
each device in a multi device context.
Signed-off-by: Guillaume Trebuchet <guillaume.trebuchet@arm.com>
Add lifetime test for AHardwareBuffer in which for both CL Buffers and
CL Images the following steps are taken
- Create AHB
- Create mem object from the AHB
- Release the AHB
- Read and write from and to the mem object
- Verify the reads and write have happened sucessfully
The CL implementation should maintain a reference count to the AHB since
the AHB must not be deallocated for the test to pass.
Signed-off-by: Alex Davicenko <alex.davicenko@arm.com>
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Co-authored-by: Alex Davicenko <alex.davicenko@arm.com>
std::min(list) is defined in algorithm. Some setup might work without
it, but other require it to find the proper definition.
Otherwise it can lead to compilation error:
```
OpenCL-CTS/test_conformance/extensions/cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch/mutable_command_full_dispatch.cpp:141:22: error: no matching function for call to 'min'
141 | group_size = std::min(
| ^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate function template not viable: requires 2 arguments, but 1 was provided
233 | min(const _Tp& __a, const _Tp& __b)
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate function template not viable: requires 3 arguments, but 1 was provided
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
* OpenCL C (and SPIR-V) require that the failure memory order is not
stronger than the success memory order.
Also see Khronos internal memory model issue #181
CC @bashbaug
This fix is necessary to install the minimum version of OpenCL in the
profiling_timebase test. This test uses clGetDeviceAndHostTimer,
available only since version 2.1.
fix#2582
Add support for build options available only after a certain version:
- -cl-uniform-work-group-size after 2.0
- -cl-no-subgroup-ifp after 2.1
Add specific test for cl-uniform-work-group-size
- Check that test can be executed when work group size is uniform.
- Check that test returns the proper error code when work group size is
not uniform.
Ref #2563
The maximum value for the workgroup size in a specific dimension can be
lower than the overall maximum workgroup size. This patch queries for
the maximum work item size in the first dimension and limits the
group_size by that value as well.
Signed-off-by: Ole Strohm <ole.strohm@arm.com>
A 3D required work-group size is always valid, but a 1D or 2D required
work-group size is only valid when the work-group size in those
dimensions is equal to one.
fixes#2575
Fixes a warning in the mutable dispatch test with some compilers:
```
3>C:\git\OpenCL-CTS\test_conformance\extensions\cl_khr_command_buffer\cl_khr_command_buffer_mutable_dispatch\mutable_command_basic.h(82,16): warning C4805: '==': unsafe mix of type 'int' and type 'bool' in operation
```
Also fixes a misspelled variable name while we're at it.
see #2501
This tests the following scenarios:
1. Execute a kernel with a required work-group size, passing `NULL` as
the local work size.
2. Query the suggested work-group size for a kernel with a required
work-group size.
Add a wrapper around AHB for proper resource deallocation and refactor
existing tests to use the wrapper.
Add a negative test for AHB to test for error codes when calling
clCreateImageWithProperties and clCreateBufferWithProperties.
---------
Signed-off-by: Alex Davicenko <alex.davicenko@arm.com>
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Co-authored-by: Alex Davicenko <alex.davicenko@arm.com>
Use the explicit version of the atomic_load/store and atomic_fetch_add
with memory order relaxed and memory scope workgroup to allow devices
that only support the minimum CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES which
are (CL_DEVICE_ATOMIC_ORDER_RELAXED | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP)
to run the tests.
The test should only require the relaxed ordering and memory scope
workgroup anyway.
From the specificiation:
"The non-explicit atomic_store function requires support for OpenCL C
2.0, or OpenCL C 3.0 or newer and both the
__opencl_c_atomic_order_seq_cst and __opencl_c_atomic_scope_device
features"
"The non-explicit atomic_load function requires support for OpenCL C 2.0
or OpenCL C 3.0 or newer and both the __opencl_c_atomic_order_seq_cst
and __opencl_c_atomic_scope_device features."
"The non-explicit atomic_fetch_key functions require support for OpenCL
C 2.0, or OpenCL C 3.0 or newer and both the
__opencl_c_atomic_order_seq_cst and __opencl_c_atomic_scope_device
features."
**For mutable_dispatch_image_1d_arguments &
mutable_dispatch_image_2d_arguments:**
As the images are created using CL_UNSIGNED_INT8, the kernel does not
use correct instructions, as they are designed for signed variable. This
fix consists of modifying the kernel code to use unsigned instructions
and auxiliary variables .