This fixes three problems in `test_vulkan`:
1. One negative test is violating the OpenCL specification. A call to
`clEnqueue{Wait,Signal}SemaphoresKHR` with an invalid semaphore should
return `CL_INVALID_SEMAPHORE_KHR` and not `CL_INVALID_VALUE`.
>
[CL_INVALID_SEMAPHORE_KHR](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_INVALID_SEMAPHORE_KHR)
if any of the semaphore objects specified by sema_objects is not valid.
2. When populating the list of supported external memory handle types
for Vulkan, the types are unconditionally added to the list, without
checking if the device supports it or not, this fix is namely for
`VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD`.
3. If a device does not support an optional extension (that is required
for a test), the test should skip, not throw an exception and fail. A
test failure should be reserved for the cases where a device claims
support for an extension but then fails to execute the test correctly.
---------
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
All existing tests in `test_image_streams`, that are capable of testing
image formats using the `CL_UNORM_INT_2_101010_EXT` data type, do so.
Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
The context and queue were not released when the test is not supported
in offline mode or the queue couldn't be created.
Inline test_missing_support_offline_cmpiler_ret macro, remove dead
parameter of check_functions_for_offline_compiler and slightly refactor
callSingleTestFunction to address leaks.
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
* gles: Fix compile warnings.
For 32 and 64-bit Visual Studio and the Android Q NDK.
* Fix formatting violations
Co-authored-by: spauls <spauls@qti.qualcomm.com>
* Improve Functionality of Harness
In the harness we previously were able to determine whether or
not a device supports the half or double data types, but doing so
required unintuitive function calls and would need to be repeated
per test.
A new pair of functions have been added which clearly state
what they do, and makes it easier to determine whether or not
a device supports the types.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Remove Old GetKernelArgInfo Tests (#522)
In the API test suite we have 2 versions which test the
clGetKernelArgInfo API. As part of this ticket we are redesigning
the implementation of this test. This change removes all of
the old code and makes it so that the tests simply pass. A later
commit will add the redesigned test
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Redesign GetKernelArgInfo (#522)
The previous test for this API consisted of 5K+ lines
of code which would define the test kernels and the
expected outputs from this API. This redesign
instead generates the kernels and expected outputs
leading to incresased maintanability and a significantly
reduce line-of-code count.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Address Review Comments
This commit does the following:
1) Update the Copyright to 2021
2) Fixes a typo in a comment
3) Explicitly declares a vector variable
(previously auto)
4) Output subtest result after completion rather than
all of them at the end
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Ensure Kernel Arguments do not exceed CL_DEVICE_MAX_PARAMETER_SIZE
As per upstream comments, this change ensures that the total
size of parameters passed into a kernel does not exceed the
limit specified by CL_DEVICE_MAX_PARAMETER_SIZE for the device
used.
Additionally this change replaces ASSERT_SUCCESS() with test_error()
as per upstream requests.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Address Image and Vector Failures
This change aligns vector 3 types to be sized 4.
Additionally it ensures that image arguments do not
have the address space qualifier specified because
they are by default in the __global space.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Ensure that the size of pipe arguments are correct
As mentioned in PR comments, the test previously assumed that
sizeof(char) == sizeof(pipe char). The Clang implementation
treats a pipe to take the same size as a pointer, which
is now reflected in the code.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Ensure that CL_DEVICE_MAX_PIPE_ARGS is not Exceeded
This commit refactors the code so that Pipes are handled
separately.
Additionally, it removes signed char and char signed as
scalar types to test and removes some redundent code
for modifiying the expected type when processing unsigned
scalar types.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Remove compatibility test from skip-list
There is a list of tests which should be skipped when
using an offline compiler. As get_kernel_arg_compatibility
has been removed, it should also be removed here.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Disable Pipe Tests
This change disables the Pipe tests for clGetKernelArgInfo
as pipe metadata is not accurately reported on clang
which leads to the pipe tests failing.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Implement Negative Tests for clPlatform Functions
This change introduces negative tests for clPlatform
functions as well as changes to the Harness to help with
other negative tests.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Remove magic macro from Negative Platform Tests
This change removes the negative-testing macro and all
other changes related to its usage.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Using helper functions for clCreateKernel
Uses of clCreateKernel following create program helper
functions, have been incorporated into
create_single_kernel_helper when suitable.
Contributes #31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Skip tests using clCompileProgram in offline mode
Contributes #31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Using type wrappers when using kernel helper functions
Also includes fix for windows build
Fixes#31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Remove clReleaseKernel for wrapped kernel
Fixes#31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
- [x] Skip the `features_macro` test in offline mode since it makes
calls to `create_single_kernel_helper_create_program` and fails when the
call doesn't return `CL_SUCCESS` which will happen when the offline
compiler fails to compile the kernel which is deliberately supposed to
fail compilation in this test.
The following tests make calls to `clCompileProgram` or
`clBuildProgram` and therefore require a compiler in the runtime:
* `unload_repeated`
* `unload_compile_unload_link`
* `unload_build_unload_create_kernel`
* `unload_link_different↩`
* `unload_build_threaded`
* `unload_build_info`
* `unload_program_binaries`
Skip these tests if no compiler is present in the runtime.
* Reformat common help text
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
* Reformat test harness code
This goes part of the way to fixing issue #625.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
* Permit half overflow within allowable ULP
Modify the algorithm for calculating half precision ULP error so
that it duplicates the behaviour of the single precision ULP algorithm,
in regards to allowing overflow within the defined ULP error.
In the case where the test value is infinity, but the reference is
finite, pretend the test value is 63336.0 and calculate the ULP error
against that.
Encountered this while testing half precision `hypot()` in PR !529,
for inputs `hypot(-48864.0, 43648.0)` which has reference
`65519.755799`. With RTE rounding this only just rounds to `65504` as half,
and returning INF is currently infinite ULP error. Using the leniency
introduced by this change however the error is `~0.5` within the `2` ULP
bounds defined by the spec.
* Run clang-format over changes
Code now conforms to style guidelines and allows `check-format.sh` to pass.
The test attempts to build a program from source containing invalid code, to
provoke a build failure. In offline compilation mode, this causes the offline
compiler to give an error, failing the test.
Signed-off-by: Einar Hov <einar.hov@arm.com>
* added pipes test
clang-format fixes
* simplify diffs
* added pipes test
clang-format fixes
* simplify diffs
* add Program Scope Global Variables consistency test
* switched other checks to test_assert_error
* add non-uniform work group consistency test
* added read-write images consistency test
* add Creating 2D Images from Buffers consistency test
* add Device and Host Timer Synchronization consistency test
* add Intermediate Language Programs consistency test
* add Subgroups consistency test
* add Program Initialization and Clean-Up Kernels consistency test
* add 3D Image Writes consistency test
* clang-format fixes
* switch the check for 3D image writes extension for clarity
* add Depth Images consistency test
* update test for CL_QUEUE_SIZE, must return CL_INVALID_COMMAND_QUEUE
* formatting fixes
* fix copy-paste typo
* change expected error codes to CL_INVALID_OPERATION
* address review comments
* fix formatting
* address review feedback
Since pipes are cl_mems, We can spec and test that clGetPipeInfo
returns CL_INVALID_OPERATION when pipes are not supported by
passing a non-pipe memory object to the function.
* use the CTS framework to choose the OpenCL C version
* address review feedback
* OpenCL 3.0 test CL_QUEUE_PROPERTIES_ARRAY
* add verification if requested_size <= CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE
* remove test_case - set NULL properties, get not empty array with 0 terminator
* add printing test_case description
* change logic of checking if requested properties are supported by device
depending on host/device type queue.
* fix a few bugs, rename test for consistency
* add utility function for comparing properties
Co-authored-by: Grzegorz Wawiorko <grzegorz.wawiorko@intel.com>
* Use float<->half conversion routines from the OpenCL headers
Fixes#870
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
* Use cl_half_from_double
* Fix windows build errors
* Fix more build errors
* Code formatting
* Remove TEST class
* Fix Tests Assuming Online Compilation in Offline MOde
* Update the list of tests to skip in offline mode. These tests need
to be skipped for offline-binary mode since they make API calls that
rely on a compiler being present in the runtime.
- [x] Skip `get_kernel_arg_info_compatibility` since it makes calls to
`clBuildProgram`. (these tests cannot be run in offline mode since:
*Kernel argument information is only available if the program object
associated with kernel is created with `clCreateProgramWithSource` and
the program executable was built with the `-cl-kernel-arg-info` option
specified in options argument to `clBuildProgram` or `clCompileProgram`
.*)
- [x] Skip `compiler` tests that make calls to `clCompileProgram`. These
tests could still be run in offline spirv mode if there is a compiler in
the driver.
- [x] Use offline compilation path in `contractions` in the case that
CTS is run in offline.
* Avoid shadowing `error` variable
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Removing all references to check_opencl_version as similar
get_device_cl_version() can be used instead.
Fixes#527
Change-Id: I474b6f536033707e1beb9b5b39410de24672c040
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>