84 Commits

Author SHA1 Message Date
Marco Antognini
7181bcdbac Rename files for consistency (#1166)
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-02-17 17:05:09 +00:00
ellnor01
25d9ff5d6e Using helper functions for clCreateKernel (#1064)
* Using helper functions for clCreateKernel

Uses of clCreateKernel following create program helper
functions, have been incorporated into
create_single_kernel_helper when suitable.

Contributes #31

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

* Skip tests using clCompileProgram in offline mode

Contributes #31

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

* Using type wrappers when using kernel helper functions

Also includes fix for windows build

Fixes #31

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

* Remove clReleaseKernel for wrapped kernel

Fixes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2021-01-07 11:34:42 +00:00
Stuart Brady
337db8882a Remove spirv_new binaries and add Python script to generate them (#902)
* Remove binaries for spirv_new (#21)

Avoid storing binaries in version control, as it is generally not well
suited to this.  Instead, in a followup commit we will add a script to
regenerate the .spv files from their sources.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Add Python script to assemble spirv_new binaries (#21)

This also changes the ext_cl_khr_spirv_no_integer_wrap_decoration assembly
source so that the SPIR-V version is listed as 1.0, to ensure that the
output of spirv-dis exactly matches the assembly.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-10-30 14:38:39 +00:00
John Kesapides
e815bf3565 Fix min version for SPIRV test registration. (#1028)
Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-10-30 14:16:22 +00:00
Stuart Brady
f732cd5b7e Remove invalid SPIR-V image decoration tests (#22) (#958)
The Volatile, Coherent, NonWritable and NonReadable decorations can
only be applied to images if they are storage images, which require
the Shader capability.

Note that in SPIR-V 1.4 and later, the NonWritable decoration can
also be applied to objects in the Private and Function storage classes
(although Private also requires the Shader capability), but this was
not covered by the existing test for the NonWritable decoration.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-09-25 14:57:41 +01:00
Ben Ashbaugh
ab106e97f9 specialization constant test fixes (#927)
* remove SPV_KHR_no_integer_wrap_decoration

* address review comments

* remove the assemble_spirv script

There is another PR in flight that adds a much more complete
script that we should merge instead.
2020-09-04 11:46:22 +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
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
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
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
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
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
Radek Szymanski
80c3a27a6a Remove unused parameter (#630)
The imageSupportRequired param is not needed in runTestHarnessWithCheck,
so just remove it.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-02-27 15:36:28 +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
Stuart Brady
2398587980 Reformat SPIR-V assembly and fix validation errors (#472)
* Reformat SPIR-V assembly using spirv-dis

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Fix duplicate non-aggregate type decls in SPIR-V as reported by spirv-val

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Reposition OpExtensions correctly in SPIR-V as reported by spirv-val

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Reposition OpVariables correctly in SPIR-V as reported by spirv-val

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Add missing OpTypeImage access qualifiers in SPIR-V as reported by spirv-val

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Remove same-width OpSConverts in SPIR-V as reported by spirv-val

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Replace -ILPath with --spirv-binaries-path in README

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-11-19 09:05:28 +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
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
Stuart Brady
f2f458b675 Rename gSpirVPath to gCompilationCachePath
gSpirVPath controls the location of the compilation cache for SPIR-V
offline compilation, but its name falsely implies that it is
SPIR-V specific.  This change renames it to gCompilationCachePath.
2019-07-08 11:33:50 +01:00
Stuart Brady
9be570cdf0 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.
2019-07-08 11:33:50 +01:00
Stuart Brady
5438c664a1 Rename gOfflineCompilerInput/Output locals
These are local variables, and wrongly start with a "g" indicating that
they are globals.
2019-07-05 14:27:25 +01:00
Radek Szymanski
bfb3e4aa2c cl21: Add minimal required version functionality (#270)
This adds functionality to define minimal required version through the
ADD_TEST* macros. Tests that don't meet the version requirement will
be skipped.

By default the minimal required version is set to 1.0, subsequent
patches will set the appropriate version for each of the tests.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-05-22 18:31:01 +01:00
Grzegorz Wawiorko
32e702efbc cl21: Fix Issue 38 - Test spirv_new - new test for cl_khr_spirv_no_integer_… (#119)
* Fix Issue 38 - Test spirv_new - new test for cl_khr_spirv_no_integer_wrap_decoration SPV_KHR_no_integer_wrap_decoration extension

* Remove not used variable.
2019-05-22 15:56:43 +01:00
Sven van Haastregt
caae56d32c cl21: Add image access qualifier for spirv_new binaries (#272)
The OpenCL SPIR-V Environment Specification v2.2-10, Section 2.1
states that:

    For all OpTypeImage type-declaration instructions:
    The optional image Access Qualifier must be present.

Add the ReadOnly or WriteOnly qualifier as appropriate to the .spvasm
files, and regenerate the .spv files using

    spirv-as --target-env spv1.0
2019-05-15 19:02:06 +01:00
aarongreig
adb9dbbef9 Check device address width when deciding which SPIR-V binary to read (#172) 2019-04-25 01:42:12 +01:00
Grzegorz Wawiorko
700e68c732 cl21: Improved CRC calculation (#132)
* Improved CRC calculation

* Improved CRC calculation - review fix

* Improved CRC calculation - build brake fix

* Improved CRC calculation - remove external initializaiton
2019-04-18 14:59:04 +01:00
Kenneth Benzie (Benie)
1a6c15bb5c Check for image support
For SPIR-V tests which require image support, check that images are
actually supported, otherwise skip these tests.
2019-04-15 14:52:29 +01:00
Grzegorz Wawiorko
31a56be88c Segfault when passing arguments to test_conformance_spirv_new 2019-04-15 12:53:30 +01:00
Radek Szymanski
50ba83e754 cl21: Use single array for function list (#147)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-04-10 12:30:00 +01:00
Kevin Petit
05a11d8e49 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:34 +00:00