- Use `CMAKE_VS_PLATFORM_NAME` in tandem with `CMAKE_SYSTEM_PROCESSOR`
to
set `CLConform_TARGET_ARCH`. `CMAKE_VS_PLATFORM_NAME` provides cross
compilation information that `CMAKE_SYSTEM_PROCESSOR` lacks, like
targeting `ARM64EC`.
- Curb the inclusion of `SSE` headers when targeting non-x86 targets.
Unlike related PR #2344 that simply warns about unsupported FTZ, this PR
attempts to correctly handle FTZ on RISC-V.
RISC-V 'f' extension does not support any way to enable/disable flushing
subnormals to zero, implementations are required to always support
subnormals. Therefore this PR re-uses FTZ handling code from PPC, where
flushing also has to be explicitly performed.
The following tests create an OpenCL semaphore using (fd == -1) then
call `clEnqueueSignalSemaphoresKHR` on that semaphore. (fd == -1) refers
to an object that has already signaled and enqueueing a signal command
on it will lead to undefined behavior.
Quoting OpenCL specification:
```
The special value -1 for fd is treated like a valid sync file descriptor
referring to an object that has already signaled.
```
And
```
Signaling the same binary semaphore twice without an interleaving wait
may lead to undefined behavior.
```
- external_semaphores_simple_1
- external_semaphores_reuse
- external_semaphores_cross_queues_ooo
- external_semaphores_cross_queues_io
- external_semaphores_cross_queues_io2
This commit changes the tests to avoid signaling an already signaled
semaphore and correctly re-import the semaphore's fd after enqueueing a
wait successfully.
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Co-authored-by: Michael Rizkalla <michael.rizkalla@arm.com>
Fixes vulkan validation layer error:
Vulkan validation layer: Validation Error: [
VUID-vkCmdDispatch-None-08114 ] Object 0: handle = 0xb9181f0000000029,
type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0x30b6e267 |
vkCmdDispatch(): the descriptor VkDescriptorSet 0xb9181f0000000029[]
[Set 0, Binding 1, Index 1, variable "bufferPtrList"] is being used in
dispatch but has never been updated via vkUpdateDescriptorSets() or a
similar call. The Vulkan spec states: Descriptors in each bound
descriptor set, specified via vkCmdBindDescriptorSets, must be valid as
described by descriptor validity if they are statically used by the
VkPipeline bound to the pipeline bind point used by this command and the
bound VkPipeline was not created with
VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
(https://vulkan.lunarg.com/doc/view/1.4.304.0/windows/1.4-extensions/vkspec.html#VUID-vkCmdDispatch-None-08114)
The `DeviceAddrFromAPI` variable is of type `cl_mem_device_address_ext`.
But on 32-bit systems `sizeof(void*) = 4 < 8 =
sizeof(cl_mem_device_address_ext)`. Pass `sizeof(DeviceAddrFromAPI)`
instead.
Fixes vulkan validation layer error:
Vulkan validation layer: Validation Error: [
VUID-VkShaderModuleCreateInfo-pCode-08740 ] | MessageID = 0x6e224e9 |
vkCreateComputePipelines(): pCreateInfos[0].stage SPIR-V Capability Int8
was declared, but one of the following requirements is required
(VkPhysicalDeviceVulkan12Features::shaderInt8). The Vulkan spec states:
If pCode is a pointer to SPIR-V code, and pCode declares any of the
capabilities listed in the SPIR-V Environment appendix, one of the
corresponding requirements must be satisfied
(https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-08740)
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.