Commit Graph

36 Commits

Author SHA1 Message Date
Ben Ashbaugh
39fdb462be define NOMINMAX in the CMakefile to fix std::min and std::max on MSVC (#1308) 2021-08-28 10:21:34 +01:00
Kévin Petit
6c3c7e5266 Remove unused definitions in CMakeLists.txt (#1302)
Signed-off-by: Kévin Petit <kpet@free.fr>
2021-08-19 12:15:47 +01:00
Marco Antognini
01aa55029d Update warning options (#1252)
Remove workaround for #783, this was fixed by #1237.

Remove workaround for overflow, #699 has been merged.

Disable errors from -Wimplicit-const-int-float-conversion, the issue is
covered by #1250.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-05-21 10:06:13 +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
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
Kévin Petit
fc67d7b28f Move media_sharing tests to test_conformance/extensions/ (#1164)
* Move media_sharing tests to test_conformance/extensions/

And rename to cl_khr_dx9_media_sharing.

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

* format code

* more format changes
2021-02-18 10:06:56 +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
Sreelakshmi Haridas Maruthur
6adf4ead5c build: Various improvements. (#743) (#1006)
- Remove the build_<platform> scripts that were simply calling cmake in favor of
  using cmake directly
- Move flag  CRT_SECURE_NO_WARNING into a section specifically for visual studio
- Change vendor file selection to just use the file if present
- Add a variable for determining whether to link against pthread
- Delete all lines in CMakeVendor.txt so each implementation can define their own

Change-Id: Ibbd83521ce4d42d09dcbd0b16efa9fbe6cbf785d
2020-10-21 10:02:22 +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
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
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
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
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
Jeremy Kemp
4b281af946 Build: Ensure compilers required directory structure is present. (#662)
The compiler test requires that directories named "includeTestDirectory" and "secondIncludeTestDirectory" are present with the binary.
2020-03-07 14:36:53 +00:00
Kévin Petit
c9c3c73aa9 make execution of workgroups test optional (#643) 2020-03-05 08:22:36 +00:00
Kévin Petit
58eb2373a8 Add Travis CI jobs for Arm and AArch64 (#638)
* Add Travis CI jobs for Arm and AArch64

- Use fixed Linaro toolchains
- Move travis script to a shell file

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

* Fix Arm build and string comparisons added under #637

* Remove verbose flag on tar command
2020-03-04 15:18:16 +00:00
Jeremy Kemp
61eb79042f Fplib build fix (#637)
* Fix conversions build with gcc 4.8.5 armhf.

Re-named fplib.c to fplib.cpp.

Updated the conditions under which fplib.cpp will be included in the build by CMake.

* Build: Added a global archtiecture variable, CLConform_TARGET_ARCH.

The reset of the build can query this variable whenever archtiecture specific options are required. The current supported values of this variable are "ARM", "x86", and "x86_64".

This change also replaces all existing locations where CMAKE_SYSTEM_PROCESSOR was queried.

* Build: Added ARM64 as a valid value for CLConform_TARGET_ARCH.

* Conversions: Don't build fplib.cpp for ARM64.
2020-03-02 17:09:08 +00:00
Jeremy Kemp
996c353c0e CMake Build: Tidy up when -msse2 is passed to gcc (#622)
* Define CMAKE_ARM_COMPILER automatically (#469)

Makes use of CMAKE_SYSTEM_PROCESSOR to detect whether compilation is happening for an ARM architecture.

* Use the correct guard for specifying msse2 compiler flags.

Bruteforce and conversions were only checking against ANDROID which was not sufficient for ARM Linux builds.

* Remove redundant uses of the msse2 compiler flag.

* Globally set -msse2 for x86/amd64 gcc, Apple and Clang builds.

This is a change in behaviour. Prior to this commit, msse2 was only set for bruteforce and conversions.

msse and mfpmath=sse were already set globally prior to this change.
2020-02-25 08:56:54 +00:00
Jeremy Kemp
e3bad1f90e Copy all csv files during build. (#626)
This commit introduces a generic method of copying the opencl_conformance_tests_*.csv files during the build.

Fixes any unspecified files from being omitted during the copy process.
2020-02-25 08:54:27 +00:00
Kévin Petit
681150254f Remove some dead code (#586)
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-11 09:04:46 +00:00
Kévin Petit
2ad175fb57 Remove redundant variable in CMakeLists.txt (#573)
Fixes #546

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-04 15:54:40 +00:00
Grzegorz Wawiorko
1d7bd0d10d GL sharing: Test name adjustment and Windows compilation clarification. (#336)
* Test name adjustment and Windows compilation clarification.

* Add CLConform_GL_LIBRARIES_DIR CmakeLists variable for GL support

* GL sharing tests - library names justification

* Fix compilation errors function are overridden in glext.h.
2019-12-03 09:32:43 +00:00
Grzegorz Wawiorko
1bffbbe3e4 Fixes #488 - cmake adjustment d3d and media_sharing (#489) 2019-11-15 13:12:17 +00:00
Kévin Petit
76fd344e64 Set required language standards using CMake (#432)
- remove compiler-specific options
- disable GNU extensions
- require C++11 and C99 for the whole code base

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-08 12:02:18 +01:00
Kévin Petit
fa4b278432 Build the harness as a static library (#430)
This reduces by a factor of roughly two the number of files to build.

Fixes #193.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-07 17:18:10 +01:00
Radek Szymanski
a45012be7a Remove -g flag from conformance build (#423)
This reduces the size of binaries, and makes the tests finish tiny
bit faster. The debug symbols can be enabled by passing to cmake one of:
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_BUILD_TYPE=RelWithDebInfo

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-08-05 13:54:42 +01:00
Kevin Petit
ef832c330c Stop using ../../test_common to include common headers
Fixes #395.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 18:41:12 +01:00
Kévin Petit
be80a7feaf Align offline compilation with cl21_trunk (#400)
Add a special case for the Khronos compiler and always use it for
OpenCL C++, otherwise use the same logic as on the cl21_trunk
branch.

The CMake option to pass the path to the khronos compiler has
been renamed to KHRONOS_OFFLINE_COMPILER_OPTIONS and is no longer
mandatory.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-30 11:52:31 +01:00
Grzegorz Wawiorko
bcf994c3a3 Fix building media sharing tests (#389)
* Add media_sharing to cmakes

* Adjust cases to ADD_TEST macro

* Review fixes
2019-07-29 16:07:52 +01:00
Grzegorz Wawiorko
802995053a Intel compiler changes in cmake (#286) 2019-06-11 09:26:36 +01:00
Pierre Moreau
2967b1d705 cl22: CMake improvements (#237)
* Do not append non-existing folder to CMAKE_MODULE_PATH

Fixes #221

* Define CL_TARGET_OPENCL_VERSION to 220

Fixes #227

* Define cmake_minimum_required as first operation

The CMake documentation mentions that
> Call the cmake_minimum_required() command at the beginning of the
> top-level CMakeLists.txt file even before calling the project()
> command. It is important to establish version and policy settings
> before invoking other commands whose behavior they may affect.

* CMake: Match both AppleClang and Clang
2019-04-30 22:20:45 +08:00
Pierre Moreau
6e9736cf1e Fix typos in main CMakeLists.txt (#234) 2019-04-27 08:35:04 +08:00
Pierre Moreau
e597cb53b8 Add toggle for enabling OpenGL ES interop tests 2019-04-26 01:38:51 +01:00
Pierre Moreau
e0091e7cf6 Mark the graphics interop toggles as options
This allows enabling/disabling them via CMake without editing the
CMakeLists.txt file.
2019-04-26 01:38:51 +01:00
Kevin Petit
95b040bec2 Synchronise with Khronos-private Gitlab branch
The maintenance of the conformance tests is moving to Github.

This commit contains all the changes that have been done in
Gitlab since the first public release of the conformance tests.

Signed-off-by: Kevin Petit kevin.petit@arm.com
2019-03-05 16:24:50 +00:00
Kedar Patil
2821bf1323 Initial open source release of OpenCL 2.2 CTS. 2017-05-16 18:44:33 +05:30