Commit Graph

171 Commits

Author SHA1 Message Date
James Price
ce1687a408 Add missing cstdint include (#1259) 2021-05-21 10:07:12 +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
Marco Antognini
17a0d09567 Cleanup usage of static, extern and typedef (#1256)
* Cleanup usage of static, extern and typedef

Remove static on functions defined headers, as it can result in
duplication in binaries.

Remove unnecessary extern keyword on a function declaration, as it is
the default behavior and can be puzzling when reading the code.

Remove the unused declaration of my_ilogb, which is never defined.

Remove unnecessary usage of typedef, as they are only increasing the
cognitive load of the code for no purpose.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Improve usage of inline and static in harness

Functions declared in header as static can trigger unused warnings when
(indirectly) included in translation units that do not use such
functions. Use inline instead, which also avoids duplicating symbols in
binaries.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-05-18 18:09:46 +01:00
Kévin Petit
e7c5694cf5 Fix image pixel reference calculation for CL_{INTENSITY,LUMINANCE} formats (#1247)
As per 6.15.15.7, the first three components have to be set to the luminance
value and all components to the intensity value.

Signed-off-by: Kévin Petit <kpet@free.fr>
2021-05-14 09:44:38 +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
Kévin Petit
ad8ab3fe90 Remove OpenCL C++ tests (#1241)
* Remove OpenCL C++ tests

Agreed in the 2021/05/11 teleconference.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>

* fix CI
2021-05-13 09:13:03 +01:00
Pierre Moreau
d7f87492bd testHarness: Print error string when clFinish fails (#1243) 2021-05-12 11:39:45 +01:00
Sven van Haastregt
dbd3e787fe Do not dereference null pointer for no matching tests (#1191)
When invoking for example

    test_c11_atomics test-that-does-not-exist

parseAndCallCommandLineTests() would attempt to dereference
`resultTestList` which is still a null pointer.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2021-03-18 21:46:05 +00:00
Stuart Brady
6f2cd12a0b Deduplicate logging of pixel differences (#1175)
clCopyImage and clFillImage contain near-duplicate code for logging of
pixel difference errors.  Move this into imageHelpers.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-03-09 09:09:52 +00: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
Nikhil Joshi
bfca863cb8 Handle NULL hostptr in conformance image tests (#1087)
* Fix enqueue_flags test to use correct barrier type.

Currently, enqueue_flags test uses CLK_LOCAL_MEM_FENCE.
Use CLK_GLOBAL_MEM_FENCE instead as all threads across work-groups
need to wait here.

* Add check for support for Read-Wrie images

Read-Write images have required OpenCL 2.x.
Read-Write image tests are already being skipped
for 1.x devices.
With OpenCL 3.0, read-write images being optional,
the tests should be run or skipped
depending on the implementation support.

Add a check to decide if Read-Write images are
supported or required to be supported depending
on OpenCL version and decide if the tests should
be run on skipped.

Fixes issue #894

* Fix formatting in case of Read-Write image checks.

Fix formatting in case of Read-write image checks.
Also, combine two ifs into one in case of
kerne_read_write tests

* Fix some more formatting for RW-image checks

Remove unnecessary spaces at various places.
Also, fix lengthy lines.

* Handle NULL hostptr in conformance image tests

As per the spec, clCreateBuffer and clCreateImage return
CL_INVALID_HOST_PTR if host_ptr is NULL
and CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are set in flags
or if host_ptr is not NULL
but CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are not set in flags."

Host pointer should be NULL when USE/COPY_HOST_PTR is not set in flags.

* Revert "Handle NULL hostptr in conformance image tests"

This reverts commit 49fa049f9b.

* Move cl_mem_flag and host_ptr check to ImageHelper

Add a check to see if cl_mem_flag has
USE_HOST_PTR or COPY_HOST_PTR.
Override host_ptr with NULL if none of them
are specified.
2021-01-29 14:18:13 +00:00
John Kesapides
c587b45a2b Minor fixes for CL_ARGB channel order. (#1128)
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Change-Id: I4f6bbce14535f6156365a5a46c4739d6a7257ab2
2021-01-29 14:15:16 +00:00
James Price
03a0989998 Use std::vector for format lists in images suite (#1105)
* Use std::vector for format lists in images suite

Avoids memory deallocation issues and generally simplifies the code.

* Fixup formatting with git-clang-format
2021-01-14 13:27:59 +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
Chetan Mistry
5f869e1c98 Move TEST_SKIPPED_ITSELF to test_status in testHarness (#1089)
TEST_SKIPPED_ITSELF was originally located in
threadTesting.h but this no longer makes sense.
This change moves the definition to the test_status
struct in testHarness so that it can be used in the same
way that test_status' can be used.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
2021-01-04 15:20:19 +00:00
ellnor01
5ae5e7a1fa Remove imageSupportRequired parameter to runTestHarness (#1077)
* Tests requiring image support use runTestHarnessWithCheck

Removing special case for images in runTestHarness.

Fixes #710

* Remove imageSupportRequired argument

Tests which require image support now specify this while
calling runTestHarnessWithCheck.

Fixes #710

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-12-09 16:12:40 +00:00
Sreelakshmi Haridas Maruthur
16ddfbb1ae gles: Fix compile errors. (#976)
* fix gles build error

* fix format check fail

* fix Werror and link error

* gles: Makefile changes

Change-Id: Ie493a730e6004f9251bbf9b534f758e0dc920191

Co-authored-by: Guang <891528583@qq.com>
2020-11-09 11:04:57 +00:00
ellnor01
63f01be181 Reimplement buffer tests (#1007)
* Reimplement buffer tests

Reintegrated and fixed test code for buffer tests buffer_read_half and
buffer_write_half tests.

Added mem_alloc_ref_flags test code, as was previously non-existent,
to test CL_MEM_ALLOC_HOST_PTR. This flag was otherwise untested and
as similar tests within the suite are used to test other cl_mem_flags
it has been assumed that this was the purpose of the test.

Fixes #439

Change-Id: I5accf986be7436d09377d0bfd7afd5de2235c329
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* move mem_read_write_flags to a common function

Code under mem_*_flags tests have a lot of duplication, this is
the first step of moving test code to a common function.

Contributes #439

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* move mem_write_only_flags test code to a common function

Code under mem_*_flags tests have a lot of duplication

Contributes #439

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* move mem_read_only_flags test code to a common function

Code under mem_*_flags tests have a lot of duplication

Contributes #439

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* move mem_copy_host_flags test code to a common function

Code under mem_*_flags tests have a lot of duplication, moved
mem_copy_host_flags code and rearranged function where appropriate

mem_ref_alloc_flags test also uses common function.

Contributes #439

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Remove unused NOT_IMPLEMENTED_TEST macro

This define is not in use anymore, since tests have been
reimplemented in #439. Tests should be working and implemented
or not registered.

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-11-06 11:33:36 +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
Kévin Petit
0e67969989 Fix build warning/error introduced by 8d443029 (#1042)
"control reaches end of non-void function"

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-11-06 10:09:33 +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
Kenneth Benzie
8d44302935 Return a non-zero exit-code when a sub-test fails (#951)
When running sub-tests explicitly on the command line and that sub-test
fails, the test harness returns `0` from `main()`. This is problematic
in automated testing environments as failed tests can be hidden.

This patch iterates over all the test results in the `resultTestList`
after all sub-tests have completed, if any of the tests failed a
non-zero value is returned from `parseAndCallCommandLineTests()` which
is then propagated up the call stack to `main()`.
2020-10-19 23:08:40 -07:00
Stuart Brady
90c9ea5d7c Fix compilation failure with -Werror=narrowing (#901)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-10-19 13:58:35 +01:00
Kévin Petit
020eea9e52 Don't require support for 3D image writes in tests that don't need it (#1003)
Also fix PASSIVE_REQUIRE_* macros to report tests as skipped instead of passed.

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-10-05 13:20:51 -04: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
Kévin Petit
3320035581 Align with updated conformance process (#989)
- Remove the requirement to detail values for device queries and list
  extensions in the submission template. They are printed by computeinfo.
- Require that tests skipped in accordance with the conformance
  process be listed in the submission template.
- Remove support for OPENCL_1_0_DEVICE. This variable doesn't control
  anything anymore and the updated conformance process no longer refers
  to it.
- Require that implementations running via a loader document the loader
  that was used.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-09-29 13:51:49 -07:00
Ben Ashbaugh
beaecb71a3 add checks for OpenCL C versions (#968)
* add test_compiler test for OpenCL C versions

* add checks for required OpenCL C versions

* bugfix: only OpenCL C 2.0 is required for OpenCL 2.1 and 2.2

* pass reference to feature struct vs. pointer

* address review comments regarding C++ identifiers and 3d image writes
2020-09-28 00:26:57 +01:00
Ben Ashbaugh
951d010eaf add a new test to verify reported image formats (#963) 2020-09-28 00:22:49 +01:00
Grzegorz Wawiorko
e1cf741f1c Test feature macro OpenCL 3.0 (#762)
* Test feature macro OpenCL 3.0

* Test feature macro OpenCL 3.0 - refactor to template function

* Use test_error and format fix issues

* Fix returned value type for CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE

* Code format fix

* Feature macro test - refactor code to have one test case

* add consistency checking comparing supported features to CL_DEVICE_OPENCL_C_FEATURES
* fix minor issues

* Feature macro test  - fix test version

* Feature macro test  - add -cl-std=CL3.0 build option

* Feature macro test  - compilation errors

* Feature macro test  - compilation errors OSX

* Feature macro test  - fix adding build options

* Feature macro test  - share function OutputBuildLogs

* Feature macro test  - back removed cases

* Feature macro test  - review fixes

* Feature macro test  - split check image formats

* Feature macro test  - fixed version
2020-09-24 20:34:56 +01:00
Jack Frankland
9178524d02 Change Behaviour of C11 Atomic Tests for OpenCL-3.0 (#944)
* Change setup code in `KernelCode()` to use `_explicit` builtin
variants that are common to both OpenCL-2.X and OpenCL-3.0.

* Only test optional supported builtin variants (`_explicit` signature
 memory_order/scope) for OpenCL-3.0.

* Disable program scope global variable and generic address space tests
for a OpenCL-3.0 driver which does not optionally support these
features.
2020-09-22 09:08:32 -07:00
Nikhil Joshi
f7a0936879 Add check for Read-Write images support (#965)
* Fix enqueue_flags test to use correct barrier type.

Currently, enqueue_flags test uses CLK_LOCAL_MEM_FENCE.
Use CLK_GLOBAL_MEM_FENCE instead as all threads across work-groups
need to wait here.

* Add check for support for Read-Wrie images

Read-Write images have required OpenCL 2.x.
Read-Write image tests are already being skipped
for 1.x devices.
With OpenCL 3.0, read-write images being optional,
the tests should be run or skipped
depending on the implementation support.

Add a check to decide if Read-Write images are
supported or required to be supported depending
on OpenCL version and decide if the tests should
be run on skipped.

Fixes issue #894

* Fix formatting in case of Read-Write image checks.

Fix formatting in case of Read-write image checks.
Also, combine two ifs into one in case of
kerne_read_write tests

* Fix some more formatting for RW-image checks

Remove unnecessary spaces at various places.
Also, fix lengthy lines.
2020-09-22 09:05:58 -07:00
Kévin Petit
aee9131f87 Print the latest conformance version passed reported by the device (#959)
Fixes #798

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-09-22 09:04:02 -07:00
David Avedissian
3db1a9b3aa Ensure that test_preprocessors checks __OPENCL_C_VERSION__ correctly for CL 3.0 contexts. (#938) 2020-09-17 09:42:58 +01:00
Jesse Natalie
7fd87c704a Use power-of-two alignment values for allocating pixel data (#827) 2020-09-11 00:25:58 +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
Stuart Brady
11f3eaaceb [MinGW] Fix if statements with stray semicolons after condition (#934)
In two places, a stray semicolon between an if statement and its body
would cause the body to be executed unconditionally.  Fix this.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-09-04 11:25:52 +01:00
Stuart Brady
5f63747c2e Remove empty statements due to use of double semicolons (#935)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-09-03 14:36:38 +01:00
Kévin Petit
f06e1896a8 Test that queues are flushed by clReleaseCommandQueue (#923)
... as required by the OpenCL specification.

Also introduce a utility function to manage polling for changes
via a user-supplied function. Several tests we introduced lately
could have used this.

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-09-01 10:27:27 +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
ellnor01
a31e253397 Adds testing for CL_PROGRAM_IL (#919)
* Adds testing for CL_PROGRAM_IL

Added a test to check SpirV as an IL for programs built with IL
which includes a negative test for programs built without IL.

Added a test_fail macro.

Fixes #164

Change-Id: I908241242b369551806e43b90ab414f895d5c8f7
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* COMPUTE-11739 Removing unused platform and device_version

Fixes #164

Change-Id: Ib1168f6396132b69996d07166e1b593fa933d245
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-08-28 15:31:52 +01:00
Pierre Moreau
c001dc2d9c Only include sys/sysctl.h on for Apple (#916)
glibc deprecated that header in version 2.30, and removed it in 2.32.
2020-08-27 18:31:51 +01:00
Jack Frankland
0ba7cf1369 Dynamically Select -cl-std Option (#879)
* Dynamically select the `-cl-std` option on the basic `sizeof` and
`wg_barrier` tests to be one of `CL1.X`, `CL2.0` or `CL3.0`.
Use the most recent CL C standard supported on the device.
2020-08-25 09:32:08 -07:00
Ewan Crawford
5bb4d089dd Specify GCC flag -frounding-math on x86 (#873)
* Specify GCC flag `-frounding-math` on x86

We have been seeing fails in `test_conversions` on x86_64 when converting to the following integer types from `cl_double` with a non-default rounding mode:

```
 char_rtn_double
 char_rtp_double
 int_rtn_double
 int_rtp_double
 long_rtn_double
 long_rtp_double
 long_sat_rtn_double
 long_sat_rtp_double
 short_rtn_double
 short_rtp_double
 uchar_rtp_double
 uint_rtp_double
 ulong_rtp_double
 ushort_rtp_double
```

After investigation it was discovered that `rint()` was incorrectly rounding `cl_double` inputs despite the rounding mode being correctly set using `fesetround()` beforehand. E.g  For 'char_rtn_double' `-3.5` was getting rounding to `-3.0` rather than `-4.0`.

This is a gcc issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92164 when using the builtin `rint()` implementation, rather than `std::rint()`, that only presents itself when compiling a Release build with `-O2` rather than Debug.

Adding the compiler flag `-fno-builtin-rint` to the CMake works around this problem, however based on the discussion in the gcc ticket using `-frounding-math` appears to be a more comprehensive fix. As `-frounding-math` tells gcc that the code will be modifying the rounding mode, removing the assumption that the same rounding mode is in effect everywhere.

* Set FENV_ACCESS ON in rounding_mode.h

Inform compilers which are aware of the `FENV_ACCESS` pragma that TUs
which include `harness/rounding_mode.h` may manipulate the floating
point environment.

* Remove FENV_ACCESS pragma from test_conversions.cpp

This pragma is now set in the included header
`test_common/harness/rounding_mode.h`

Co-authored-by: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
2020-08-18 08:00:14 +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
Mats Petersson
ce484988ab Add lock around compiling (#871)
The compiler tries to compile the same source multiple times and more
importantly write out to the same filename. Adding a lock to prevent
simultaneous compilation solves this issue. This is particularly
noticeable in integer_ops testing when using offline compilation,
but just in case, hold the lock for the entire program creation.

Signed-off-by: Mats Petersson <mats.petersson@arm.com>
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-08-07 12:25:06 +01:00
aarongreig
fb55f7e81c Set new minimum version for the spirv_new tests. (#854)
This allows 1.2 implementations with the cl_khr_il_program extension to run them.
2020-07-31 13:13:08 +01:00