Commit Graph

53 Commits

Author SHA1 Message Date
Nikhil Joshi
86d5ee5414 Update extension list of test_compiler (#1507)
* Update extension list of test_compiler

Upate extension list of test_compiler
with missing external memory and semaphore
extensions
2022-09-20 09:07:14 -07:00
Sven van Haastregt
6554c49018 [NFCI] Remove unused variables and enable -Wunused-variable (#1483)
Remove unused variables throughout the code base and enable the
`-Wunused-variable` warning flag globally to prevent new unused
variable issues being introduced in the future.

This is mostly a non-functional change, with one exception:

 - In `test_conformance/api/test_kernel_arg_info.cpp`, an error check
   of the clGetDeviceInfo return value was added.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-09-08 12:54:36 +01:00
Ewan Crawford
7caa4c4421 Update known extensions in compiler define test (#1480)
Add
[cl_khr_command_buffer_mutable_dispatch](https://github.com/KhronosGroup/OpenCL-Docs/pull/819),
[cl_khr_subgroup_rotate](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_subgroup_rotate),
and [cl_khr_extended_async_copies](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_extended_async_copies)
to the list of known extensions used in
`test_compiler_defines_for_extensions`
2022-09-01 15:13:01 -07:00
Kévin Petit
bd03e17a56 Add missing external memory/sync extensions to list of known khr extensions (#1455)
Signed-off-by: Kévin Petit <kpet@free.fr>
2022-08-01 10:18:53 +01:00
Ahmed
f1c051afb1 Added missing tests for integer_dot_product_input_4x8bit and integer_dot_product_input_4x8bit_packed on feature_macro compiler test. (#1432)
* Added integer_dot_product_input_4x8bit and integer_dot_product_input_4x8bit_packed tests to feature_macro_test

* clang formatting

* Now the test checks whether the array of optional features returned by clGetDeviceInfo contains the standard optional features we are testing.

* Update test_conformance/compiler/test_feature_macro.cpp

Added printing the missing standard feature it it is not found inside the optional features array returned by clGetDeviceInfo.

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2022-06-14 08:48:59 -07:00
jansol
7c65afc4e7 test_compiler_defines_for_extensions: fix overflow (#1430)
GCC 11.2.0 warns about a possible string overflow (when
num_not_supported_extensions+num_of_supported_extensions == 0)
since no space would be allocated for the terminating
null byte that string manipulation fns expect to find.

This unconditionally adds an extra byte to the allocation to silence
the warning and fix building with -Werror.
2022-06-07 08:55:43 -07:00
Ewan Crawford
73d71b6a76 Add cl_khr_command_buffer to list of extensions (#1365)
cl_khr_command_buffer is now public as a provisional khr extension
which implementations may report.
2021-12-08 16:08:15 +00:00
marcat03
3cd906aa9b Fix missing cl_khr_semaphore extensions in compiler tests (#1357)
* Added missing extensions related to cl_khr_semaphore

Signed-off-by: Marco Cattani <marco.cattani@arm.com>
2021-11-16 16:07:43 +00:00
Grzegorz Wawiorko
e27a97fbd8 Add cl_khr_integer_dot_product to known extensions in test compiler. (#1316) 2021-08-31 15:53:55 +01:00
Grzegorz Wawiorko
bd3135dd01 Extend list of known extensions (#1262) 2021-05-27 09:05:27 +01:00
James Price
baa226a779 Remove compiler options that are specific to Apple (#1114)
These are causing test failures for non-Apple implementations of
OpenCL running on macOS.
2021-04-06 16:42:46 +01:00
John Kesapides
c67aa0535b Fix Minor memory leaks in test_buffer/compiler. (#1160)
* Fix Minor memory leaks in test_buffer/compiler.

Signed-off-by: John Kesapides <john.kesapides@arm.com>

* Fixes in test_buffer
* Remove commented unmap call
* remove unused ii variables.

Signed-off-by: John Kesapides <john.kesapides@arm.com>

* test_buffer fixes:
* test_buffer_fill remove unsued ii

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2021-02-17 09:19:06 +00:00
James Price
1cd9d084d5 Fix implicit int->float warning inside kernel (#1093)
* Fix implicit int->float warning inside kernel

This kernel is used to test various compiler options including
-Werror. Some compilers produce a warning about the implicit
conversion which results in this test failing when -Werror is used.

* Fix formatting
2021-01-04 16:12:44 +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
James Price
ff9676f878 Fix build_with_il on devices older than 2.1 (#1065)
The get_device_il_version_string() function throws an exception if the
device does not support the CL_DEVICE_IL_VERSION query, so don't call
this unless the version is recent enough.
2020-12-09 16:06:30 +00:00
Stuart Brady
12fce84a66 Minor refactoring of CL_PROGRAM_SOURCE tests (#1032)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-11-04 12:44:54 +00:00
Alastair Murray
f162c8b5ef Skip compiler unload/reload tests if compiler is not available (#986)
* Skip compiler unload/reload tests if compiler is not available

Note that tests that use the compiler helper functions but won't work without a
compiler are in the `subtests_to_skip_with_offline_compiler` list.  I didn't do
that here because they tests directly use `clBuildProgram` etc directly,
because they're specifically testing it's behaviour in edge-cases.

* Change type of status variable
2020-10-28 08:06:11 +00:00
Grzegorz Wawiorko
c2bca05a32 Add new subgroup extensions to the compiler test (#1009) 2020-10-28 08:04:05 +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
ellnor01
a6809710ea Remove unnecessary cl_mem_flags casts (#1018)
* api, atomics: remove unnecessary cl_mem_flags casts

Instances in api, atomics, buffers and c11_atomics suites

Contributes #759

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

* basic: remove unnecessary cl_mem_flags casts

Contributes #759

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

* spir, thread_dimensions: remove unnecessary cl_mem_flags casts

Instances in spir, thread_dimensions and workgroups tests

Contributes #759

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

* profiling, relationals: remove unnecessary cl_mem_flags casts

Includes relationals, profiling, muliple_device_context, integer_ops
tests

Contributes #759

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

* clcpp: remove unnecessary cl_mem_flags casts

Contibutes #759

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

* events, geometrics: remove unnecessary cl_mem_flags casts

Includes events, geometrics, gl and images tests

Contributes #759

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

* commonfs, compiler: remove unnecessary cl_mem_flags casts

Includes cast removal in commonfs, compiler and device_partition tests

Fixes #759

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

* Fix up formatting

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-10-19 13:56:02 +01:00
Alastair Murray
26cacf056e Fail feature macro compare if compiler has more features than runtime (#982)
* Fail feature macro compare if compiler has more features than runtime

Because a C++11 `std::equal` only iterates over the first container, and
matches with items in the second, if the second container contains more items
the check can still pass even though they're not identical.  Just use `==`
instead.

Fixes #979

* Move an expression to its point of use
2020-09-30 11:06:45 +01: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
bd86e2aa9b temporarily disable the unload_invalid test case (#978)
Different implementations of the OpenCL ICD loader treat a null
platform differently, so this case does not reliably return
CL_INVALID_PLATFORM.
2020-09-25 14:25:49 +01:00
Alastair Murray
0bff9b6674 Skip feature macro consistency tests if no compiler is available (#983)
The test compiles programs to determine compiler support, which isn't possible
if the compiler is not available, so skip the test.
2020-09-25 14:24:57 +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
Sreelakshmi Haridas Maruthur
fffd4f2474 compiler: Modify the IL check code to check for an empty string (#964)
The called function (get_device_info_string) subtracts 1 from
length before returning it. Hence, to check for an empty string
(that the spec requires the implementation to return when
CL_DEVICE_IL_VERSION is not supported) the check should be modified
to check for empty and not length == 1
2020-09-21 17:51:54 +01:00
Jack Frankland
4b377615a2 Automatically Select -cl-std for Compiler Defines Test (#921)
* Automatically select the `-cl-std` build option (stop assuming
`CL2.0`) in the `compiler_defines_for_extensions` test. This will allow
us to test `test_compiler_defines_for_extensions` with an OpenCL-3.0
driver that optionally might not support OpenCL C 2.0. Use the CTS
framework to automatically select the latest version of OpenCL C
supported by the device.
2020-08-31 15:15:27 -07:00
Jack Frankland
3c8ec47aac Automatically Select Latest -cl-std for pragma unroll Test (#920)
* Stop assuming `-cl-std=CL2.0` for the `pragma unroll` test. This
allows us to run this test for OpenCL-3.0 drivers which optionally do
not support OpenCL C 2.0. Use the CTS framework to automatically select
the latest OpenCL C supported by the driver.
2020-08-31 15:14:50 -07: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
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
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
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
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
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
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
ellnor01
3b79ecdb87 Replace get_device_version with get_cl_device_version (#733)
They are duplicate functions

Fixes #709

Change-Id: I8f7d6b8254047adb9e09ede4951dedc3ec5c1099
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-15 14:31:22 +01:00
Grzegorz Wawiorko
db570f70e5 Set minimum expected OpenCL version for the test. (#674) 2020-03-11 18:14:16 +00:00
James Price
40f50d77a3 Rename test .c sources to .cpp where necessary (#604)
Remove hacks to force language from CMake files.

Closes KhronosGroup/OpenCL-CTS#25
2020-02-21 17:34:31 +00:00
Kévin Petit
3f11868e11 Fix warnings reported by -Wconversion-null (#603)
Fix error reporting in clFillImage as a result.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-21 12:21:53 +00:00
Einar Hov
89ec023110 Add conformance tests for cl_khr_extended_versioning (#548)
Tests that the new queries work, and that what they return is consistent with
the information returned by the string-based queries.

Signed-off-by: Einar Hov <einar.hov@arm.com>
2020-02-20 10:14:17 +00:00
Grzegorz Wawiorko
680271c61c Fix issue 486 - add build option for devices OCL2.X (#487) 2019-11-14 17:25:43 +00: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
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
Stuart Brady
0b1520f508 Refactor setting of compilation mode and cache mode
This change refactors the setting of the compilation mode, so that
instead of using a 'gOfflineCompiler' bool together with a
'gOfflineCompilerOutputType' enum, a single 'gCompilationMode' enum
is used.  The default value for gCompilationMode is 'kOnline', which
is equivalent to the previous defaulting of gOfflineCompiler to false.

In addition, it refactors the setting of the compilation cache mode,
so that instead of the 'gForceSpirVCache' and 'gForceSpirVGenerate'
bools, a single 'gCompilationCacheMode' enum is used.  The default
value for gCompilationCacheMode is 'kCacheModeCompileIfAbsent', which
is equivalent to the previous defaulting of both booleans to false.

This change also refactors create_openclcpp_program() to avoid saving
and restoring gOfflineCompiler and gOfflineCompilerOutputType.  Instead,
it now passes the desired compilation mode as a parameter.
2019-07-08 11:34:02 +01:00
Stuart Brady
90b0c52584 Remove source transformation support
This change removes support for the "source" mode of offline compilation
which is commented with "to be removed in the future as we will use
offline compiler here".

The "source" mode allowed for the CL source to be transformed by
build_script_source.py and then passed to clCreateProgramWithSource(),
and appears to have been developed only for the purpose of testing the
offline compilation infrastructure.
2019-07-05 14:27:13 +01:00
Grzegorz Wawiorko
6c999818ee cl22: Improved CRC calculation (#133)
* Improved CRC calculation

* Improved CRC calculation - review fix

* Improved CRC calculation - build brake fix

* Improved CRC calculation - remove external initializaiton
2019-04-18 15:00:45 +01:00
Jeremy Kemp
8e03195706 cl22: Compiler - updated extension list for compiler_defines_for_exensions (#176)
* cl12: Compiler - added missing extensions to compiler_defines_for_extensions.

Updated the list of known extensions to include all extensions referenced in the OpenCL Extension Specification 1.2 - Revision 25 and OpenCL Specification 1.2 - Revision 19 documents.

* Re-added the cl_khr_il_program extension.

This was this was erroneously removed in the previous commit.

* Compiler: Added all known extensions to compiler_defines_for_extensions.

After discussion on the pull request, it was decided to have this test test for all known khr extensions accross all API levels. Some vendors support 2.x extensions on 1.x implementations, so wanted to ensure that the test still covered those cases.

Re-ordered each sub-list so that the order in which each extension appears mirrors that of https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_Ext.html.

For reference: https://github.com/KhronosGroup/OpenCL-CTS/pull/55.

* Compiler: Moved priority and throttle hints to the API-only section of the array in compiler_defines_for_extensions.
2019-04-16 14:46:25 +01:00
Radek Szymanski
07196c351a cl22: Use single array for function list (#148)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-04-10 12:30:38 +01:00
Grzegorz Wawiorko
051aa08b79 Fix Issue 37 - Test compiler - added new extension cl_khr_spirv_no_integer_wrap_decoration (#90) 2019-03-18 10:07:30 +00:00