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
* 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>
* 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.
* build_lnx.sh: Fix cmake -G flag
The cmake flag for generator selection is an uppercase G.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* build_lnx.sh: split cmake invocation into multiple lines
One option per line makes it easier for users to maintain their local
customized copy of this script, as a single line may get very wide
when paths are filled in.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* 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
* 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
* 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
* 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>
* 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
* 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
* `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.
* add a test for clSetContextDestructorCallback
* add a 10 second timeout for mem object and context destructor callbacks
* clang-format fixes
* address review comments
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>
* 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.
* 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>
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>
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>
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.
* OpenCL versions before 2.0 do not have precision requirements for
reduced precision math.
* Skip reduced precision testing for devices with
versions < 2.0.