Commit Graph

497 Commits

Author SHA1 Message Date
Jeremy Kemp
1e411b888f Memory consistency model optionality (#907)
* Test minimum memory consistency capabilities for a device reporting >= 3.0.

Skip tests where unsupported memory consistency capabilities are being requested.

* Pass nullptr as program build option.

Allows the CTS framework to select an appropriate CL C version.

* Removed redundant braces.
2020-08-31 15:12:10 -07:00
ouakheli
590321d98d Add test for CL_PROFILING_COMMAND_COMPLETE (#841)
The test checks profiling value CL_PROFILING_COMMAND_COMPLETE
compared to CL_PROFILING_COMMAND_END for two cases:
1) kernel with children with different levels of nesting
2) kernel without children
2020-08-30 13:51:38 +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
Kévin Petit
faa6ad86c6 Fail gracefully in CL_MEM_PROPERTIES tests when unexpectedly getting zero-size return (#913)
Signed-off-by: Kévin Petit <kpet@free.fr>
2020-08-21 09:56:10 -07:00
Einar Hov
a0d679fe41 Fix bug caught by -Wparentheses (#915)
This fix is required to build with -Wall -Werror with GCC >= 5.

Signed-off-by: Einar Hov <einar.hov@arm.com>
2020-08-21 12:09:22 +01:00
Grzegorz Wawiorko
41cd9c6d98 New spirv_new test case OpSpecConstant (#719)
* New spirv_new test case OpSpecConstant OpSpecConstantTrue OpSpecConstantfalse

* Register test case with minimal OpenCL version

* Specialization constant - add files uint/int cases

* Specialization constants - fix second build program

* Fix changes clang format.

* spirv_new - Make functions visible outside of main

* Fix clang format issues

* Fix int/uint 32 bit cases

* Fix minimal required version for test_op_spec_constant

* Remove not needed OpName. Update binaries

* Fix code format

* Remove op_spec_constant_int cases in spirv_new tests

* op_spec_constant - add simplified spirv files

* no redundant OpUConvert OpSConvert
* no redundant OpName
* instead of buffers scalar variable

* op_spec_constant - refactor to address review issues

* avoid using program that has already kernel program attached
* remove not used buffer
* Simplified test case - instead of buffers use scalar variable

* spirv_new - remove spec_const duplicated cases (singed versions)

* spirv_new - set clSetProgramSpecializationConstant before clBuildProgram

* Test spirv_new - fix spec const after rebase

* Test spirv_new - fix spec const set min version for bool type tests
2020-08-20 00:39:06 +01:00
Stuart Brady
afa2fcca96 Simplify call to create_single_kernel_helper() in test_select (#900)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-08-19 19:16:48 +01:00
Ben Ashbaugh
f966212f2b API Feature Consistency Test, Part 1 (#875)
* add api consistency test for Shared Virtual Memory

* add memory model and device enqueue consistency tests

* added pipes test
clang-format fixes

* simplify diffs

* add negative tests for when features are not supported

Previously, this test emitted warnings in the log if a feature
wasn't supported and a query or API call didn't generated the
expected value.  After this change, these tests will fail if
a query or API call does not generate the expected value or
error condition.

* switch handling of expected error codes to test_failure_error

* fix formatting

* use valid pipe creation parameters

* remove calls to clFinish as per review comments

* purposefully pass a bogus pointer to SVM free functions

* fix pointer passed to clEnqueueSVMFree

* change the bogus pointer to a known bit pattern
2020-08-19 14:48:15 +01:00
Grzegorz Wawiorko
185c02a700 Test against clCreateBufferWithProperties and clCreateImageWithProperties OpenCL 3.0 API (#857)
* Test against clCreateBufferWithProperties and clCreateImageWithProperties OpenCL 3.0 API

* Test against clCreateBufferWithProperties and clCreateImageWithProperties - review fixes

* Do not use enum query_type
* Fix test success/failure  conditions

* Fix  test_mem_object_properties_queries.cpp build error.

* Review Fix  test_mem_object_properties_queries.cpp
2020-08-18 17:06:09 +01: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
Jack Frankland
655d83db80 Optionally Skip progvar Tests (#878)
* Optionally skip the proram scope globa variable tests on OpenCL-3.0
devices that optionally do not support programscope global variables.
2020-08-14 13:49:51 +01:00
Ben Ashbaugh
0424fc7f12 skip test cases rather than fail without cl_khr_3d_image_writes (#874)
* skip test cases rather than fail without cl_khr_3d_image_writes

cl_khr_3d_image_writes is required for OpenCL 2.x devices, but is not
required for OpenCL 1.x or OpenCL 3.0 devices.  A check for the presence
of the extension on OpenCL 2.x devices already exists in
test_min_max_device_version, so we don't need any failure conditions
here, and can just skip tests if the extension is not supported.

* clang-format changes
2020-08-14 11:17:44 +01:00
Einar Hov
0ad8c9a9c0 Add cl_khr_device_uuid as approved extension (#881)
Signed-off-by: Einar Hov <einar.hov@arm.com>
2020-08-13 13:57:31 +01:00
Jack Frankland
48114a4e55 Run test_enqueued_local_size if Non-Uniform Work-Groups Not Supported (#789)
* `test_enqueued_local_size` will be skipped for OpenCL < 2.0. However,
non-uniform work-groups became optional in 3.0 and so check that they
are supported before running `test_enqueued_local_size`. If they are not
suppported round the global sizes up to the next multiple of the local
size, so that we can still test that `get_enqueued_local_size() ==
get_local_size()` in the case of uniform workgroups.
2020-08-11 08:04:46 -07:00
Ben Ashbaugh
fb2119eb87 add a test for clSetContextDestructorCallback (#861)
* add a test for clSetContextDestructorCallback

* add a 10 second timeout for mem object and context destructor callbacks

* clang-format fixes

* address review comments
2020-08-10 22:21:37 +01:00
Jeremy Kemp
93001e99a4 Bruteforce - embedded, relaxed ulp requirements (#839)
* Add embedded profile ULP requiremnts for relaxed tests.

* Fixed exp relaxed ULP for embedded.

* Added a utility function, getAllowedUlpError, for determining FP32 ULP.

* Collection of requested changes from PR.

Re-named float_embedded_relaxed_ulps -> relaxed_embedded_error.

Re-ordered Func struct members.
2020-08-10 13:19:26 +01:00
Grzegorz Wawiorko
c9f4ef23f6 OpenCL 3.0 CL_SAMPLER_PROPERTIES tests. (#858)
* OpenCL 3.0 CL_SAMPLER_PROPERTIES tests.

* Test CL_SAMPLER_PROPERTIES - fix misspelling

* Test CL_SAMPLER_PROPERTIES - fix results verification
2020-08-06 10:02:46 +01:00
Jeremy Kemp
b3db418e06 Skip sub_group_dispatch. (#864)
* Skip sub_group_dispatch.

If sub groups aren't supported, skip the test.

* Do not test for cl_khr_subgroups as the extension requires IFP.

3.0 allows sub groups *without* IFP so the check was invalid.
2020-08-05 14:55:35 +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
Ben Ashbaugh
d3eba8571a add OpenCL 3.0 test for CL_COMMAND_SVM_MIGRATE_MEM (#856) 2020-07-31 13:10:05 +01:00
Jeremy Kemp
b5d198b1fc Test for IL support in unload_platform_compiler (#862) 2020-07-31 13:09:41 +01:00
Einar Hov
30e1a427dc clUnloadPlatformCompiler tests (#780)
Various tests for the clUnloadPlatformCompiler function.

Fixes #442

Signed-off-by: Einar Hov <einar.hov@arm.com>
2020-07-29 09:46:31 +01:00
james-morrissey-arm
dda37d93f7 Fix 32-bit Android build for ARMv7 (#842)
Tested with currently supported Android NDK r21d.

Signed-off-by: James Morrissey <james.morrissey@arm.com>
2020-07-24 14:30:41 +01:00
Jim Lewis
0ee260b036 Arbitrary output directory support for compiler test build copies (#848) (#851)
* Move copy from top level down to test_compile module as post-build copy
* Fix windows VS2015 build break
2020-07-24 14:30:24 +01:00
Jacek Jankowski
9c0edebd3c Print hex values when reporting a failure (#838) 2020-07-24 11:31:48 +01:00
Jeremy Kemp
803a99fd4a Release some dangling objects in userevents. (#837) 2020-07-24 10:54:32 +01:00
Grzegorz Wawiorko
f1dd503c6c Fix code format errors vs.3 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
450f583800 Fix code format errors vs.2 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
44a240367e Fix code format errors 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
c85527cec7 Review fixes - check error state 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
75dfd356d7 Review fixes - add clCreateProgramWithILKHR in linkage and op_opaque tests 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
2a8cecb925 Test bruteforce/conversions - run finish only on existing queue. 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
9a006ba1a0 Spirv readiness - move to harness
Fixes support  cl_khr_il_program
2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
adec8f9412 Add support for cl_khr_il_program extension 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
3730bce4e8 SPIR-V handling on different OpenCL devices version
Example usage for bruteforce and spirv_new
2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
d643dc5399 Add API name to version_expected_info function 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
bfc1cc47f3 Add OpenCL 3.0 deviceInfo capabilities (#833)
* Add OpenCL 3.0 deviceInfo capabilities

* Fix variable/type names collisions

* Fix build error - variable initialization

* Add support for CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES

* Fix - test_error exits err != CL_SUCCESS

* Fix - redundant variable never used in function

* Fix - remove duplicated capabilities for device

* Test computeinfo - display 3.0 platform capabilities

* refactor existing code
* add CL_PLATFORM_EXTENSIONS_WITH_VERSION
* add CL_PLATFORM_NUMERIC_VERSION

* Review fixes in computeinfo

* Fixes review - define variable inside of case block.
2020-07-22 23:01:18 -07: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
a34bae7abc Remove code under USE_LOCAL_THREADS (#850)
Code uses outdated API calls

Fixes #715

Change-Id: I575c8ec4003fd30a3cec28ad114d5749f2e83d0f
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-07-20 12:01:34 -04:00
Jim Lewis
36c281b2a0 Fix clang release build (#847)
Avoid missing non-void function return (#846)
2020-07-17 10:04:42 -04:00
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
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