Commit Graph

22 Commits

Author SHA1 Message Date
gorazd-sumkovski-arm
21b0a09ef0 Extend IGetErrorString() (#2080)
Add cases for `CL_INCOMPATIBLE_COMMAND_QUEUE_KHR`,
`CL_INVALID_COMMAND_BUFFER_KHR` and
`CL_INVALID_SYNC_POINT_WAIT_LIST_KHR`.

Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
2024-09-12 16:17:11 +02:00
Sven van Haastregt
b6941b6c61 Add fp16 testing to conversions and bruteforce (#1975)
Merge the `fp16-staging` branch into `main`, adding fp16 (`half`)
testing to the conversions and math bruteforce tests.

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Guo, Yilong <yilong.guo@intel.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Co-authored-by: Marcin Hajder <marcin.hajder@gmail.com>
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Wawiorko, Grzegorz <grzegorz.wawiorko@intel.com>
Co-authored-by: Sreelakshmi Haridas Maruthur <sharidas@quicinc.com>
Co-authored-by: Harald van Dijk <harald@gigawatt.nl>
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
Co-authored-by: Haonan Yang <haonan.yang@intel.com>
Co-authored-by: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com>
Co-authored-by: niranjanjoshi121 <43807392+niranjanjoshi121@users.noreply.github.com>
Co-authored-by: Wenwan Xing <wenwan.xing@intel.com>
Co-authored-by: Yilong Guo <yilong.guo@intel.com>
Co-authored-by: Romaric Jodin <89833130+rjodinchr@users.noreply.github.com>
Co-authored-by: joshqti <127994991+joshqti@users.noreply.github.com>
Co-authored-by: Pekka Jääskeläinen <pekka.jaaskelainen@tuni.fi>
Co-authored-by: imilenkovic00 <155085410+imilenkovic00@users.noreply.github.com>
Co-authored-by: John Kesapides <46718829+JohnKesapidesARM@users.noreply.github.com>
Co-authored-by: Aharon Abramson <aharon.abramson@mobileye.com>
2024-06-18 09:43:11 -07:00
John Kesapides
fb39357911 Raw10/12 CTS tests (#1830)
Add support for cl_ext_image_raw10_raw12 testing
on test_image_streams.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-05-21 08:44:28 -07:00
Ben Ashbaugh
02bf24d2b1 remove min max macros (#1310)
* remove the MIN and MAX macros and use the std versions instead

* fix formatting

* fix Arm build

* remove additional MIN and MAX macros from compat.h
2021-09-13 13:25:32 +01:00
Marco Antognini
76ace61314 Fix leaks in callSingleTestFunction (#1224)
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>
2021-06-09 11:08:08 +01:00
Sreelakshmi Haridas Maruthur
6c8045911a gles: Fix compile warnings. (#1070)
* 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>
2021-05-18 18:10:24 +01:00
Chetan Mistry
a43d96de69 Redesign clGetKernelArgInfo (#522) (#1056)
* 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>
2021-05-13 09:18:12 +01:00
Chetan Mistry
f6b501352d Implement Negative Test for Platform Layer Functions (#1076)
* 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>
2021-02-05 16:36:16 +00:00
ellnor01
25d9ff5d6e Using helper functions for clCreateKernel (#1064)
* 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>
2021-01-07 11:34:42 +00:00
Jack Frankland
e8c55e59bc Skip features_macro Test in Offline Mode (#1034)
- [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.
2020-11-06 11:32:13 +00:00
Kévin Petit
c8163e931f Fix a few typos and remove unused code (#1041)
Fixes #845
Fixes #844

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-11-06 11:24:15 +00:00
Jack Frankland
e7a23536e5 Skip Compiler Unload Tests in Binary Mode (#1025)
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.
2020-10-30 14:29:19 +00:00
Stuart Brady
af7d914514 Reformat test harness code (#940)
* 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>
2020-10-30 14:13:52 +00:00
Ewan Crawford
55976fad35 Permit half overflow within allowable ULP (#600)
* 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.
2020-10-28 10:13:40 +00:00
Chetan Mistry
7a735b74e3 Replace cl_ushort with cl_half (#885) (#1000)
* test_common: Replace cl_ushort with cl_half (#885)

Change-Id: I507eca2084629c3b6f3e7331f062f006edbce434
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* buffers, pipes, profiling: Replace cl_ushort with cl_half (#885)

Change-Id: Id9799322b636af6aa0eec3d4e846d7af8c7f9602
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* images/kernel_read_write: Replace cl_ushort with cl_half (#885)

Change-Id: I922ddb593b6e5631d0f4ea1522c7f75f8770be40
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* half: Replace cl_ushort with cl_half (#885)

Change-Id: I484a5bb2b33a7e87805fc6079953c66e5f8d9239
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
2020-10-02 16:29:05 +01:00
Einar Hov
172322e155 Add async_build test to list of tests to skip during offline compilation mode (#950)
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>
2020-09-10 16:58:29 +01:00
Ben Ashbaugh
75ce4c5b0e API Feature Consistency Test, Part 2 (#912)
* 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
2020-09-08 17:24:09 +01:00
Ben Ashbaugh
e075026819 test CL_QUEUE_ARRAY_PROPERTIES query (#925)
* 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>
2020-09-01 10:16:18 +01:00
Kévin Petit
ed50fcad2d Use float<->half conversion routines from the OpenCL headers (#884)
* 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
2020-08-14 13:50:14 +01:00
Jack Frankland
8e9ab19a3b Update List of Skipped Tests in Offline Mode (#840)
* 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>
2020-07-22 22:52:38 -07:00
ellnor01
c19897ff0f Remove check_opencl_version function (#734)
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>
2020-04-15 16:03:19 +01:00
James Price
bce4e48c89 Rename harness .c sources to .cpp where necessary (#513)
Remove hacks from harness CMakeLists.txt to force language.

Contributes to KhronosGroup/OpenCL-CTS#25
2020-02-20 21:09:36 +00:00