Commit Graph

575 Commits

Author SHA1 Message Date
ellnor01
8cbd650b16 Remove read_struct_array test function (#849)
Test has previously been commented out and adds no value.
Struct array is already tested with test_stream_read.

Change-Id: I4f5acfc431b7cf39408e3e0fd41a6f89fc9353fa
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-07-17 10:02:57 -04:00
Einar Hov
bb1285f6f2 Tests for cl_khr_device_uuid (#813)
Basic conformance testing for the cl_khr_device_uuid extension.  Checks
that the ID queries return the right sizes and that the returned IDs are
stable across two calls to clGetDeviceInfo. If device LUID validity is
true, also checks that one and only one bit is set in the device node
mask.

Signed-off-by: Einar Hov <einar.hov@arm.com>
2020-07-09 11:23:38 +01:00
Pierre Moreau
a69f3ca8cf SPIR-V: BuiltIn variables use the Input storage class (#769)
The OpenCL SPIR-V Environment Specification was updated to mandate that
all variables decorated with `BuiltIn` must be in the `Input` storage
class, see https://github.com/KhronosGroup/OpenCL-Docs/pull/278.

Global variables with the Input storage class have to be listed in the
entry points’ interface, which was also taken care of in this commit.
2020-07-03 09:21:41 +01:00
Jack Frankland
96ea9d6011 Skip Reduced Precision Testing (#819)
* OpenCL versions before 2.0 do not have precision requirements for
reduced precision math.

* Skip reduced precision testing for devices with
versions < 2.0.
2020-07-02 10:43:10 +01:00
Jack Frankland
16bb1d83c5 Add CL_DEVICE_NAME to clDeviceInfo File (#836)
- [x] Add `CL_DEVICE_NAME` to list of device properties printed into the
clDeviceInfo file for offline compilation testing.
- [x] Add `get_device_name` helper function.
- [x] Update offline compiler interface explanation file with
`CL_DEVICE_NAME` and `CL_DEVICE_IMAGE_SUPPORT` which was missed from
this file when added.
2020-07-01 17:30:31 +01:00
Jack Frankland
d6cfe817c8 Add CL_DEVICE_IMAGE_SUPPORT to clDeviceInfo File (#830)
- [x] Add `CL_DEVICE_IMAGE_SUPPORT` to the clDeviceInfo file
which contains
device specific information for the purposes of offline compilation. For
devices with images support `CL_DEVICE_IMAGE_SUPPORT=1` is printed,
otherwise `CL_DEVICE_IMAGE_SUPPORT=0`.
2020-06-29 16:37:08 +01:00
Grzegorz Wawiorko
79d771ec47 Turn on building test_gl in travis (#804)
* Turn on building test_gl in travis

* Install packages only on native Linux

* Build test_gl use variable

* Travis -  skip OSX system

* Fix test_gl build errors

* Fix test_gl build errors - cast to uintptr_t

* Fix redefinition build issues in travis Xenial build env
2020-06-21 10:10:24 +01:00
ellnor01
164b5ef5cf Remove duplicate IsXSubnormal functions (#826)
* Remove duplicate IsXSubnormal functions

Is{Double,FLoat,Half}Subnormal function duplicates are currently in the codebase.

Fixes #511

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

* Update conversions.h
2020-06-17 10:14:33 +01:00
ellnor01
4f4950feee Remove test_stream_struct_write test (#825)
Test has been commented out.
This is effecting clang-format checks in the file.
Removing test as it is not in use.

Change-Id: Ic9a7ab68a514fa6dc01e4d86a7bda1a9856a75e8
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-06-17 10:14:11 +01:00
Grzegorz Wawiorko
105a3aff62 Fix relaxed mode in math bruteforce - binaryOperator (#828) 2020-06-15 12:00:14 +01:00
James Price
eb4afc9547 Use std::thread for userevents_multithreaded test (#824)
The genericThread abstraction is not necessary now that C++11 is
required.
2020-06-12 10:08:23 +01:00
Grzegorz Wawiorko
e9dc1bc5d2 Fix test_printf build errors (#801)
* Fix test_printf build errors

* Return error code in case of function failure
2020-06-10 19:03:09 +01:00
Grzegorz Wawiorko
782fe2c83b Test bruteforce - fix relaxedMode in unary.cpp (#818) 2020-06-10 16:36:45 +01:00
Jack Frankland
ecee2c18d2 Remove gTestFastRelaxed Dependencies in Brute Force (#807)
* The global variable `gTestFastRelaxed` has state which is used to
control the behaviour of the compiler flag `-cl-fast-relaxed-math` and
the precision testing of relaxed, fp32 and fp64 types. This is confusing
since the global variable is being set and read in different translation
units, making it very difficult to reason about the logic of the brute
force framework. It is particular difficult to follow since the global
variables is cached and then turned off in the case of fp32 and f64 in
order to use the same code path as relaxed testing, after it is then
turned back on.

* Remove uses of the global variable outside of `main.cpp` (the global
variable remains in use within `main.cpp` since it is a command line
option and used to turn of relaxed testing completely). Replace all uses
of the global variable with boolean `relaxedMode` which is passed as a
function paramter but replaces `gTestFastRelaxed` semantically.
2020-06-04 10:44:39 +01:00
Grzegorz Wawiorko
519f658b51 Test bruteforce - fix islessgreater function for intel compiler (#811) 2020-06-04 10:44:19 +01:00
Grzegorz Wawiorko
f7e6e1d17f Subgroups - refactor code subgroup functions registration for better … (#808)
* Subgroups - refactor code subgroup functions registration for better maintainability

* Subgroups - review changes - use struct
2020-06-03 13:51:52 +01:00
James Price
8579e61401 Improve async build callback testing (#797)
* Improve async build callback testing

Check that the program build status can be queried from inside the
program completion callback, and also add a test to ensure that the
completion callback is called when the build fails.

* Address review comments

* Fix formatting
2020-06-01 09:31:50 -04:00
Grzegorz Wawiorko
58cf793fdb Fix test_subgroups - test as core feature. (#682)
* Fix test_subgroups - test as core feature.

* Fix kernels pragma in case of OpenCL 2.1 core subgroups

* Change global variable names to gVariable convention

* Allow subgroups tests execute 2 paths

 - as core feature
- as extension feature

* Fix code formatting.

* Set correct OpenCL version

* Fix code format

* test_subgroups review fixes:

* do not use global variables
* make IFP as separate tests
* use stringstream data type
* use special class to load function pointer for specific API

* Remove not not used variable

* Test subgroups - use common enums

* Test subgroups - set TEST_SKIPPED_ITSELF
2020-05-27 19:13:33 +01:00
James Price
944b0a8178 Enable -Werror for GCC/Clang builds (#786)
* Enable -Werror for GCC/Clang builds

Fixes many of the errors this produces, and disables a handful that
didn't have solutions that were obvious (to me).

* Check for `-W*` flags empirically

* Remove cl_APPLE_fp64_basic_ops support

* Undo NAN conversion fix

* Add comments to warning override flags

* Remove unneeded STRINGIFY definition

* Fix tautological compare issue in basic

* Use ABS_ERROR macro in image tests

* Use fabs for ABS_ERROR macro

* Move ABS_ERROR definition to common header
2020-05-27 19:13:11 +01:00
John Kesapides
094cc04e16 Mem-leaks from conformance pipes (#772)
Fix various memory leaks around events.
Convert test to use supplied typewrappers
to avoid memory leaks. Also use error helper
functions to reduce code size.
Use stringstreams to synthesize kernel sources, and
raw c+11 string literals.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-05-22 13:26:05 +01:00
DziubanMaciejIntel
ee2d0921dc Fix test_gl error reporting (#764)
* Fix test_gl error reporting

Overwriting 'error' variable after check for Msaa/Depth support was clearing
the error counter incremented after failure in test_image_format_write. In
effect the test might return 0 even if there were errors.

* Fix variable name

* Fix formatting

* Fix formatting
2020-05-22 13:25:43 +01:00
John Kesapides
cfe4e41d96 Mem-leaks from conformance mem_host_flags (#770)
Fix various resource leaks in the tests for mem_host_flags.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-05-22 13:24:57 +01:00
James Price
09aa54246f Fix warnings in basic suite (#782)
* Fix "ignored typedef" warning

* Fix "returning reference to temporary" warning
2020-05-20 15:16:18 -04:00
Pierre Moreau
fe12c4e378 computeinfo: Attach min version to image types and flags
This is mostly required for OpenCL 1.0 and 1.1 conformance tests, but
also avoids testing for CL_MEM_KERNEL_READ_AND_WRITE on OpenCL 1.2.
2020-05-20 14:31:58 +01:00
Pierre Moreau
2d124f61eb computeinfo/main: Fix format specifiers for unsigned long 2020-05-20 14:31:58 +01:00
Pierre Moreau
0b4ecd1756 computeinfo/extended_versioning: Add missing arguments to log_error 2020-05-20 14:31:58 +01:00
Pierre Moreau
0ed62b4fbe Reformat computeinfo/ tests 2020-05-20 14:31:58 +01:00
Jack Frankland
f6b156d523 Correct khr Extension Checks for Device Versions (#778)
* Correct khronos extension device version checks so that 2.0, 2.1 and
2.2 extensions are only require for devices versions < 3.0
(`cl_khr_3d_image_writes`, `cl_khr_image2d_from_buffer` and
`cl_khr_depth_images` are all optional for devices supporting
OpenCL-3.0).

* Remove `cl_khr_fp64` from list or required extensions for 2.0,
`cl_khr_fp64` is a required extension for OpenCL-1.2 devices if they
suport doubles. Check for support of `cl_khr_fp64` on 1.2 devices.

* Remove duplicated `cl_khr_byte_addressable_store` from list of 2.0
extensions. Since this is a 1.1 extension and all versions greater than
1.1 are backwards compatible with 1.1 this will be checked anyway.
2020-05-20 14:16:37 +01:00
Ankit Goyal
4fbcd96e7f Remove "C" linkages (#781)
* Remove extern C linkages

* Update crc32 to cpp and remove extern C linkage
2020-05-20 14:16:19 +01:00
Grzegorz Wawiorko
223c43b7d9 test_api - fix minRequiredDimension in case of new OpenCL version (#779)
* Fix minRequiredDimension in case of new OpenCL version

* Fix code formatting
2020-05-19 10:16:21 +01:00
Grzegorz Wawiorko
ec32bd9b5e Format subgroups tests according to clang-format (#745)
* Format subgroups tests to clang-format

* Format issue - fix do/while issue
2020-05-19 10:16:06 +01:00
Jack Frankland
a6c3d921ae Remove clCreatePipe call from test_clone_kernel (#775)
* Remove the call to `clCreatePipe` in the `test_clone_kernel` test as
the result of this call (the pipe object) is unused. Further more
`clCreatePipe` is an optional API in OpenCL-3.0, so even if the pipe
object did have a use, support for this API would need to be queried in
the case of a OpenCL-3.0 driver where returning `CL_INVALID_OPERATION`
would be conformant behaviour. As it stands this test will incorrectly
fail for a 3.0 driver which does not support pipes.

* Correct comment regarding pipes and SVM since these features were not
actually tested in the source.
2020-05-18 13:03:57 +01:00
Ankit Goyal
833f0d029e Fix return-type warnings with harness library and basic test (#776)
* Fix offending `-Wreturn-type` in harness library

* Fix offending `-Wreturn-type` in basic test
2020-05-18 13:03:17 +01:00
John Kesapides
3afe926416 Mem-leaks from conformance test_basic (#771)
Release some leaked events

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-05-14 12:57:20 +01:00
Jack Frankland
ebcc74049a Update SPIR-V CSV Options (#774)
* Update `opencl_conformance_tests_21_full_spirv.csv` with
`/-offlineCompiler/--compilation-mode` and
`/cache/--compilation-cache-path` in order to match the offline
compilation options in the cts executables. Do not add the
`--compilation-cache-mode` and `--compilation-program` options since
they are user specific and the default values are generic.

* Delete `opencl_conformance_tests_generate_spirv.csv` since there is no
longer a `generate` option for offline compilation in the cts
executables.
2020-05-14 12:51:03 +01:00
James Price
bda0285c2a Refactor basic/intmath tests into a single file (#757)
* Refactor basic/intmath tests into a single file

These six tests previously duplicated almost all of their sources in
separate files. Bring them into a single file with templated routines
to perform the tests.

This change also makes use of more C++ features and utilities from the
harness library to make the code cleaner.

* Fix array indices for initialization

* Use loop for buffer creation

* Refactor to remove duplicate verification code

Remove need for hardcoded number of test operations.

* Address review comments

* Use TEST_SKIPPED_ITSELF
2020-05-06 11:32:31 -04:00
Radek Szymanski
77d755c8ee Remove duplicated random_in_ranges function (#763)
This function is duplicated across clCopyImages files, so just keep one
definition in common file, and get rid of the duplicated ones.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-05-06 13:09:48 +01:00
Jack Frankland
8d28a5dc83 Add 3.0 as valid device version to version parsing logic (#765) 2020-05-06 13:09:20 +01:00
Radek Szymanski
54c21467ad Reduce code duplication in images (#749)
Some of the image code is needlessly copied over, where all you need is
a simple for loop.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-05-05 09:49:28 +01:00
ellnor01
794e9ebe50 Add argument to specify branch for clang-format check (#761)
If a change is not added to an origin/master branch, an argument
can be used to specify the relevant branch name for the clang-format
comparison.

Change-Id: I8ce712d077bf4d048a04a29c12bc2cb45e4abb93
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-05-04 14:25:28 -04:00
James Price
de952011f3 Replace magic constants in api/kernels tests (#754)
Also remove one unused test function.
2020-05-04 09:12:46 -04:00
James Price
0cb0e720f0 Use unsigned integers in multiple_device_context (#758)
Fixes a signed integer overflow issue.
2020-05-04 09:12:12 -04:00
James Price
11b21fdcca Remove unused API test (#756)
The test was also invalid, since it was testing that you can pass a
structure containing cl_mem objects to a kernel without SVM.
2020-05-01 14:29:32 +01:00
Kévin Petit
5e2f5b857e Accept OpenCL 3.0 in version parsing code and use where appropriate (#752)
* Accept OpenCL 3.0 in version parsing code and use where appropriate

There were a number of tests against 2.2 that are clearer against 3.0.

Fixes #751

Signed-off-by: Kévin Petit <kpet@free.fr>

* Remove CL_EXPERIMENTAL guards

Signed-off-by: Kévin Petit <kpet@free.fr>

* formatting

* Configure the headers for OpenCL 3.0

* more format fixes
2020-04-30 11:51:06 +01:00
James Price
1e5ffa08b5 Fix initialization of input data for api test (#746)
Caught by MSAN.
2020-04-28 09:17:14 -04:00
Grzegorz Wawiorko
64170ebb06 Turn on d3d binaries - Windows (#744)
* Turn on d3d binaries

* Add -DARCH variable

* Set ARCH base on platform
2020-04-27 11:15:04 +01:00
Grzegorz Wawiorko
efc9f38fdf Test d3d11 - remove spaces from extension string (#742) 2020-04-24 15:06:47 +01:00
James Price
b051f07a57 Fix buffer overflow in compiler suite (#740)
* Fix buffer overflow in compiler suite

* Use ARRAY_SIZE to determine number of source lines

* Add static assertion for number of lines
2020-04-22 12:48:13 +01:00
Radek Szymanski
e72cff3e7d Remove duplicate format functions (#738)
This moves the filter_formats and get_format_list functions to a common
file. These functions were roughly the same, with an optional filtering
in some tests for testing mipmaps.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-04-17 10:55:17 +01:00
Kévin Petit
d59808ceda clang-format: indent continued lines (#739)
This addresses comments from recent PR reviews.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-04-17 10:54:58 +01:00