- 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>
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.
* cl_copy_images
* cl_get_info
* cl_fill_image
* cl_read_write_image
* kernel_image_methods
* IMAGE1D_BUFFER cannot be created with (USE_|ALLOC_|COPY_)_HOST_PTR
* do not allow mipmap with 1D buffer
* adjust M to be within maximum_sizes and max_pixels
* remove unused variables
* make sure M will never be 0
* fix region[0] after refactoring removing mipmap
* fix formatting
* format with clang-format-11
* fix image1d_buffer creation with gEnablePitch
* add missing case in switch
* use align_malloc when CL version is at least 2.0
* use CL_DEVICE_NUMERIC_VERSION and align_free
* fix free of pitch buffer
* fix formatting
* fix formatting
* fix data->is_aligned
* 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
`log_error` was invoked from a template function, but the format
specifiers weren't adjusted for the template parameter types. Use a
stringstream for printing instead.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
We compute the reference values using unsigned types exclusively,
even when the input type is signed. This fixes one place where
an signed type was inadvertently used.
There appears to have been some confusion over `uint_mask` during the
initial reviews of the subgroup tests. Add a comment to clarify the
purpose of the mask.
Use a 32-bit all-ones mask (`0xffffffff`) instead of a 64-bit all-ones
mask to further clarify the intent, that is, don't delay discarding
the upper 32 bits until the assignment but mask them out immediately.
Fixes https://github.com/KhronosGroup/OpenCL-CTS/issues/1203
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>