The main sources of warnings were:
* Printing of a `size_t` which requires the `%zu` specifier.
* Printing of 64-bit values which is now done using the `PRI*64` macros
to ensure portability across 32 and 64-bit builds.
* Calling log_error with a format string of `"%f %f %f %f"` but
specifying only three arguments.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The removed macros were never used.
Use the more common `ARRAY_SIZE` macro instead of defining an identical
`NELEMS` macro.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
- when calling command buffer APIs, test with `command_queue != NULL`
should return `CL_INVALID_VALUE` only if the device doesn't support
`cl_khr_command_buffer_multi_device` (added `Skip`)
- some tests enqueued commands with multiple invalid arguments, e.g.
`clCommandCopyImageToBufferKHR` with two images and invalid sync points.
AFAIK the order of argument checking is not defined, so implementation
can return any valid error value for such API calls, but the tests
assumed only one particular error would be returned. Fix the API calls
to be unambiguous.
We've had a couple of bugs inside mesa/rusticl processing %% correctly.
I've added those cases locally to make sure all corner cases are
properly handled.
The verification code assumes the hardware uses CL_HALF_RTE, which
causes a mismatch computation results when the hardware uses RTZ. Fix to
use the hardware's default rounding mode.
According to work plan from
https://github.com/KhronosGroup/OpenCL-CTS/issues/1691
After consultations with @bashbaug I skipped this case:
`CL_INVALID_VALUE if any of the semaphore objects specified by
sema_objects requires a semaphore payload and sema_payload_list is NULL`
test_decorate was checking for half-precision NAN incorrectly, calling
cl_half_from_float where cl_half_to_float was intended, causing a wrong
expected result.
test_decorate was also printing the expected and actual results
reversed, printing "got -1, want 0", when our implementation already
returned 0.
clGetDeviceIDs 'num_devices' output parameter is described as:
> num_devices returns the number of OpenCL devices available that match
device_type.
but the _test_events
out_of_order_event_waitlist_multi_queue_multi_device_ test expects that
after calling:
`clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL, 2, two_device_ids,
&number_returned);`
the content of number_returned needs to be 2, but it should be valid to
return a larger number.
---------
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
In binary_float.cpp, copysign is special cased. All the reference
functions there take double arguments, except for reference_copysign
which takes float. This commit copies that approach to special case
copysign in binary_double.cpp as well: all the reference functions there
take long double arguments, but this commit changes reference_copysignl
to take double. The rationale for this in binary_float applies equally
to binary_double: conversions of NAN are not required to preserve its
sign bit. On architectures where conversion of NAN resets the sign bit,
copysign fp64 would return incorrect reference results.
The atomic operations are tested with generic pointers but in a way
where the compiler can infer the original pointer address space. This
commit adds tests specifically for the case where the compiler cannot
make inferences.
Test that the correct address is used with atomics when the address is
group variant and invariant.
Test that verifies `CL_INVALID_QUEUE_PROPERTIES` is returned from
`clCreateCommandQueue`, `clCreateCommandQueueWithProperties`, and
`clCreateCommandQueueWithPropertiesKHR` to match spec wording
> CL_INVALID_QUEUE_PROPERTIES if values specified in properties are
valid but are not supported by the device.
`create_single_kernel_helper` invokes `clBuildProgram` and sets
`-cl-std` to the latest version supported by the context.
The vast majority of tests are using `create_single_kernel_helper`
instead of the `..._create_program` variant, so use the former for the
sake of consistency.
---------
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The Image_from_buffer_alignment_negative test creates images with
incorrect pitches by adding 1 and tests whether the image creation
fails.
Devices that return 1 for either of
CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT,
CL_IMAGE_REQUIREMENTS_SLICE_PITCH_ALIGNMENT_EXT or
CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT will successfully
create the image and therefore fail the test.
This change allows to skip the image creation in this case as the error
condition (pitch % pitch_alignment != 0) will not be triggered for these
devices.
According to work plan from issue #1058
Corrections to general test:
-removed duplication of separate tests for each element of
`PrintfTestType` vector, instead `doTest` procedure would iterate over
vector related to specific `PrintfTestType` automaticaly
-fixed procedure to assemble kernel source so it can accept only one
parameter of the function ( eg. `printf("%%");` )
-incorporated important modifications from #1940 to avoid expected
conflicts
-warnings fixes, minor corrections, clang format
Extension for string testing:
-special symbols
-nested symbols
-all ascii characters
-added new type of test `TYPE_FORMAT_STRING` to verify format string
only (according to request from the issue)
The values in `src` are indices into an array in `get_order_string()`.
Not initializing `src` resulted in out of bounds accesses there.
It seems that when the out of bounds accesses happened, the result of
`get_order_string()` was not actually used, so at least the test was not
using random data. Fix the issue as it prevents a clean run of this test
with e.g. AddressSanitizer.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Currently we don't escape subnormal values when generating image data.
In sampler read tests, we use `!=` to check the two values even when it
is floating-point data, which requires the two values are bitwise equal.
However, a sampler might flush subnormal values, causing the test case
to fail.
In this patch, when generating random image data, we escape subnormal
values.
The specification states that `clEnqueueMapImage` and
`clEnqueueMapBuffer` should return NULL on error. Ensure this is
checked.
This testing gap was caught by a compiler warning about `dataPtr` being
written but not read. With this fix, there are no more
Wunused-but-set-variable warnings in this test, so reenable the warning.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Except for SYNC_FD, current implementation doesn't import exported
OpenCL semaphore in Vulkan and ends up doing signal and wait on
essentially two unrelated semaphores (one created in OpenCL and one in
Vulkan).
Since OpenCL exports the semaphore, import that in Vulkan to perform
signal/wait on the same underlying payload.
Isuue #875 clarified that CL_INVALID_BUFFER_SIZE should be returned if
clCreateBuffer is passed a pointer returned by clSVMAlloc as its
host_ptr and the size of the buffer exceeds the size of the SVM
allocation.
Add a new negative test to ensure CL_INVALID_BUFFER_SIZE is returned
when the size of buffer exceeds the size of the SVM allocation.
Fixes#1701
The `test_compiler compiler_defines_for_extensions` test did not free
all `malloc`'ed memory.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* 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
Only report an error (and include the error code), but don't throw an
exception as that would call `terminate`. Failure to release
resources is not fatal in other parts of the CTS.
This fixes `-Wterminate` warnings:
warning: ‘throw’ will always call ‘terminate’ [-Wterminate]
note: in C++11 destructors default to ‘noexcept’
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This is 7-year old CMake code that never did anything because the
function invocation is missing the PROPERTIES keyword.
Adding the keyword results in build errors, so just drop the dead code
since everything seems to be working without it anyway.