Commit Graph

336 Commits

Author SHA1 Message Date
Stuart Brady
0d96c198ee Reimplement invocation of offline compilation program
This change reimplements offline compiler invocation, using a new command
line interface that allows the passing of relevant CL device information
to the offline compiler.  The information that is passed is as follows:

 * CL_DEVICE_ADDRESS_BITS
 * CL_DEVICE_EXTENSIONS
 * CL_DEVICE_IL_VERSION (with --compilation-mode=spir-v only)
 * CL_DEVICE_VERSION

The interface for the offline compiler script is as follows:

   usage: cl_offline_compiler --source FILE --output FILE
                              --cl-device-info FILE --mode MODE
                              -- [BUILD_OPTIONS [BUILD_OPTIONS ...]]

   positional arguments:
     BUILD_OPTIONS          additional options to pass to the compiler

   optional arguments:
     --source FILE          OpenCL C source file to compile
     --output FILE          SPIR-V or binary file to create
     --cl-device-info FILE  OpenCL device info file
     --mode                 compilation mode (spir-v or binary)

The OpenCL C version for compilation is now specified in BUILD_OPTIONS,
as normal for online compilation, i.e. with -cl-std=VERSION.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
2c43504923 Cleanup offline compilation code
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
982e3ed79c Cleanup generate_spirv_offline.py
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
147d159fec Fix line endings in generate_spirv_offline.py
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
4d891b67bd Separate out device information functions
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
f15178ca91 Use static libary for harness in media_sharing
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
245e11ec67 Allow device ID to be specified for offline compilation
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01: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
Stuart Brady
67655e6fe5 Fix parsing of offline compilation options in test_select (#429)
The local parsing of arguments in test_select.c throws away any unknown
arguments.  Pass these to parseCustomParam() before the local argument
parsing, so that the offline compilation options work as expected.

Fixes #327.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-07 16:23:16 +01:00
Kevin Petit
4cb8fc49f8 Remove almost duplicate compatibility common code
Use the non-compatibility version.

In each case the diff was minimal, didn't have modifications that
would invalidate compatibility testing and it was clear that the
"latest/best" version was not the one in the compatibility copy.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-07 11:59:28 +01:00
Kevin Petit
fba5b654e8 Remove GL compatibility common code
It is completely unused.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-07 11:59:28 +01:00
Radek Szymanski
42cc707131 Remove redundant prints from half (#424)
The test harness already prints if the test passed, no need to duplicate
this information.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-08-05 15:17:09 +01:00
Radek Szymanski
03650057bb Move printing sub-test information into test harness (#421)
This removes all the duplicated code from each test, and moves it to
test harness so that we have single place where this information is
printed.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-08-05 15:16:12 +01:00
Kévin Petit
19951a2a14 Remove exact duplicate files from the compatibility common code (#422)
Use the copy from the non-compability test_common folder.

Many of these weren't even used at all.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-05 15:05:14 +01:00
Radek Szymanski
358ad78344 Handle failed memory allocations (#426)
The test has been ignoring potential failures in memory allocations,
giving misleading error messages.

Add a simple check and return early if the allocation failed.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-08-05 15:04:46 +01:00
Radek Szymanski
313fb94fcc Remove redundant prints from integer_ops (#425)
The test harness already prints if the test passed, no need to duplicate
this information.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-08-05 13:55:55 +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
Sam Laynton
12bc0c1f3f Check max work group size in test basic (#414)
The test enqueued_local_size in test_basic used a
local work group size larger than the minimum max
supported work group size supported by some platforms.

This change checks the max and clamps to it if
requested size would be larger than supported.

Signed-off-by: Sam Laynton <sam.laynton@arm.com>
2019-08-05 11:26:17 +01:00
Grzegorz Wawiorko
da313500a5 test clEnqueueSVMMemcpy in case of host memory allocation (#300)
* test clEnqueueSVMMemcpy in case of host memory allocation

* test clEnqueueSVMMemcpy - refactored to call once API function

* test clEnqueueSVMMemcpy - review fixes
2019-08-05 10:54:21 +01:00
Oualid Khelifi
42163c6072 cl21: Add 2.1 device version for compatibility conf
This was causing some tests to fail on 2.1 conformance
with : device version string does not match required format!

Signed-off-by: Oualid Khelifi <oualid.khelifi@arm.com>
2019-08-05 10:42:51 +01:00
Alastair Murray
85d474f06a Reintroduce M_PI compatibility
M_PI is not part of C99 or C++ and thus aren't provided in all configurations.
This used to be handled in reference_math.c directly but was recently removed.
Just tweak the M_PI handling in the compatibility headers to restore builds.
2019-08-02 18:38:23 +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
Kevin Petit
4dca437b0e Merge branch 'cl20_trunk' 2019-08-01 10:30:10 +01:00
Kevin Petit
7397aadb8d Rename test list CSV files to facilitate the merge to master 2019-08-01 10:10:12 +01:00
Kevin Petit
9dff128d42 Extend version checks in subgroup test to support all cases
To prepare for merging the cl20_trunk branch.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 10:02:49 +01:00
Kevin Petit
75a26fdc44 Specify minimum required version for all OpenCL 2.1 tests
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 10:02:28 +01:00
Brian Sumner
a910c3f8f6 Fix for bug 15294 - allocation test overflows for large memory 2019-07-31 16:22:45 +01:00
Kevin Petit
d3fb3d975f User create_* helper functions in most tests
Ported from master.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-31 16:00:45 +01:00
Kevin Petit
59e2da3b4e Port framework changes from master
Now requiring the headers to be configured for OpenCL > 2.1.
2019-07-31 16:00:45 +01:00
Kevin Petit
e535e0aa21 Reduce diff with master
Whitespace, typos and simple build system/script changes.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-31 16:00:45 +01:00
Kevin Petit
be2ca84c42 cl22: Issue #12: printf: Remove testing printf %s on a NULL string
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-31 16:00:45 +01:00
Kevin Petit
2b6b38eaba Report actual image size being tested
# Conflicts:
#	test_conformance/images/clFillImage/test_fill_2D_array.cpp
2019-07-31 14:10:07 +01:00
Brian Sumner
003f476024 Proposed fix for bug 11537 2019-07-31 14:10:07 +01:00
Samuel Pauls
627c180a31 cl20: Khronos Bug 16080 Fix local work size limit.
Problem: Some tests assume that all local work-items can be used in a
single dimension of an NDRange.

Spec References: OpenCL C 2.0 r19, table 4.3,
CL_DEVICE_MAX_WORK_ITEM_SIZES.

Solution: The overall maximum local work size is trimmed to that of an
NDRange's first dimension or all dimensions, as appropriate.

Test Suite Affected: atomics, non_uniform_work_group, and workgroups.

Side Effects: None

Change-Id: I2e8179ca15c2c090f47ea84d1d3c109dd69ec185
2019-07-31 14:10:07 +01:00
Samuel Pauls
e0d7ab2187 cl20: Khronos Bug 15745 Limit work-group sizes per dimension.
Until now, the workgroups test computed the work-group size for
execution by querying the maximum number of work-items based on the
kernel. This returns the overall limit on workgroup size but not the
limits in each specific dimension. This change additionally restricts
the work-group size to the device's dimensional limits.

Problem: The kernel's maximum work-group size is used to execute it in a
single dimension, without regard for dimensional limitations.

Spec References: OpenCL 2.0 rev 19

Solution: The kernel's maximum work-group size is decreased such that it
meets any dimensional limitations before it's enqueued.

Test Suite Affected: Workgroups

Side Effects: None

Change-Id: I1c642af087f1934723ac7218ca9a35413ff83224
2019-07-31 10:41:18 +01:00
Brian Sumner
ce74e803b9 Proposed patch for bug 14270 2019-07-31 10:41:18 +01:00
Bartosz Sochacki
b99c6004ce cl20: Khronos Bug 15619 Race condition in device execution enqueue_flags test 2019-07-31 10:41:18 +01:00
Kevin Petit
4c31b69980 Merge branch 'cl21_trunk'
# Conflicts:
#	.travis.yml
#	CMakeLists.txt
#	CMakeVendor.txt
#	README.md
#	build_android.py
#	build_lnx.sh
#	build_win.bat
#	readme-spir-v-binaries.txt
#	test_common/harness/kernelHelpers.c
#	test_common/harness/kernelHelpers.h
#	test_conformance/CMakeLists.txt
#	test_conformance/opencl_conformance_tests_21_full_spirv.csv
#	test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv
#	test_conformance/opencl_conformance_tests_full.csv
#	test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv
#	test_conformance/opencl_conformance_tests_quick.csv
#	test_conformance/run_conformance.py
2019-07-30 12:10:52 +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
Kévin Petit
996dd659fc Reduce diff with master branch (#399)
A first round of whitespace, formatting and uncontroversial changes.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-30 09:51:03 +01:00
Grzegorz Wawiorko
284680936d cl21: Fix test spirv_new - define test cache path (#378)
* Fix test spirv_new - define test cache path

* Fix test spirv_new - review fixes

* Fix end of array detection
2019-07-29 16:24:53 +01:00
Grzegorz Wawiorko
150520c7e1 cl20: Fix building media sharing tests (#391)
* Add media_sharing to cmakes

* Adjust cases to ADD_TEST macro

* Review fixes
2019-07-29 16:08:37 +01:00
Grzegorz Wawiorko
f24b072595 cl21: Fix building media sharing tests (#390)
* Add media_sharing to cmakes

* Adjust cases to ADD_TEST macro

* Review fixes
2019-07-29 16:08:17 +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
Wenju He
ef84736c73 Fix SVM if 64-bit atomic extensions are supported (#382)
Need to enable 64-bit atomic extensions in kernel source.
Use InterlockedCompareExchange64 for 64-bit type.
2019-07-24 18:54:50 +01:00
Wenju He
1d2e0ca248 Fix SVM if 64-bit atomic extensions are supported (#396)
Need to enable 64-bit atomic extensions in kernel source.
Use InterlockedCompareExchange64 for 64-bit type.
2019-07-24 18:54:20 +01:00
Wenju He
d7ff4aa502 SVM: use InterlockedCompareExchange64 for 64-bit type (#397) 2019-07-24 18:54:00 +01:00
Grzegorz Wawiorko
28cf6de10f cl20: Fix compilation in D3D cases (#394)
* Fix compilation in D3D cases

* Use existing harness include search path.
2019-07-24 14:21:00 +01:00
Grzegorz Wawiorko
9daeca00ea cl21: Fix compilation in D3D cases (#393)
* Fix compilation in D3D cases

* Use existing harness include search path.
2019-07-24 14:20:39 +01:00