The math_brute_force test has a link-check-only mode to quickly test if
all math functions are present.
In link-check-only mode, most tests return immediately after kernel
compilation, but some tests also run the kernel and read back the result
data before returning. Running the kernels takes a lot more time,
defeating the purpose of the `-l` mode.
Break out at the start of the main `for` loops in link-check-only mode
instead of returning directly, so that each test can still log its
trailing message (in most cases just a `\n`).
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The handling of NaN values in the templated function was incorrect due
to improper initialization of the input data source. Specifically, the
function ZeroNanToIntCases used a global pointer gIn, which was not
correctly set or did not point to the same data as the local input
pointer s used in the non-templated implementation.
to solve the issue I updated the templated function ZeroNanToIntCases to
take an additional parameter for the input data source.
and then passed the correct input data (s) to the templated function
during its invocation.
Co-authored-by: Banan Ashkar <banan.ashkar@mobileye.com>
MSVC on Windows was previously omitted from the list of CI platforms
that use sccache. Unify the CMAKE_CACHE_OPTIONS used for all CI
platforms.
In the case of a 100% cache hit, this cuts down the average checks time
from 8 minutes to 4 minutes, example:
https://github.com/ahesham-arm/OpenCL-CTS/actions/runs/9896449792
The `skipTestingRelaxed` check suffers the following problems:
- The use of `skipTestingRelaxed` in the `if` seems reversed: when
skipping correctness testing using the `-l` command line option, this
variable causes correctness testing to be run for relaxed-mode `tan`
regardless.
- Accuracy testing should only be skipped for derived `tan`
implementations. Non-derived `tan` implementations must still be tested
for accuracy, so the condition for setting the `skipTestingRelaxed`
variable is incomplete.
- It is unclear why only `tan` is conditionalized here. There are other
functions such as `tanpi` for which one would expect identical
behaviour.
The actual skipping of accuracy checks for derived implementations
happens in `Test()`, so just remove `skipTestingRelaxed` as it does not
seem to add any value.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The computeinfo test already checks that the cl_khr_fp16 extension is
available before querying `CL_DEVICE_HALF_FP_CONFIG`, but never actually
made the `CL_DEVICE_HALF_FP_CONFIG` query.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Since GCC 13 some headers are no longer included transitively through
C++ Standard Library headers.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
clang-format has already been disabled here. Make the function list a
bit easier to read. Make the currently commented out functions stand out
better on a line of their own.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Instead of selecting an arbitrary number for the number of parallel
build jobs, use CMake's `--parallel` option instead.
Option was introduced in version 3.12, GitHub runners currently use
CMake version 3.29.6 so this is supported.
Fixes#2003
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
The `vulkan-wrapper` helper library's purpose is to eliminate the need
to link targets directly to Vulkan, and load it dynamically instead at
runtime, using `dlopen` and `LoadLibrary`.
Remove the direct linking of the Vulkan library from targets that link
to `vulkan-wrapper`.
Fixes#1999
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Merge image_array_copy, image_array_copy3d
as they share a lot of common code.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>
According to work plan from issue #1058
Added new case `TYPE_MIXED_FORMAT_RANDOM` which focus on three factors:
-data before conversion flags - this is randomly generated ascii string
-randomly generated conversion flags - integer or floating point, for
each flag specific argument is generated
-data after conversion flags - this is randomly generated ascii string
Moreover, due to fact in case of `TYPE_MIXED_FORMAT_RANDOM` test is
generated on the fly, logging of negative result was extended.
Even on the common code path (i.e., no error paths taken),
test_computeinfo failed to release its allocated memory, preventing a
clean run with LeakSanitizer.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
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.