Commit Graph

11 Commits

Author SHA1 Message Date
Stuart Brady
277d029608 Run spirv-val for SPIR-V offline compilation (#1108)
The common --disable-spirv-validation option has been added to disable
this functionality.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-06-11 09:42:20 +01:00
Stuart Brady
af7d914514 Reformat test harness code (#940)
* Reformat common help text

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

* Reformat test harness code

This goes part of the way to fixing issue #625.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-10-30 14:13:52 +00:00
boazo
60101c24cf Save Kernel Sources to Disk - Infrastructure Change (#412)
* Introduces the ability to capture the kernel sources and the build
options used by the conformance tests to a .cl and .options files.
This is achieved via a new compilation cache mode called dump-cl-files.
Files will be generated to the folder pointed by the compilation cache
path.

When a conformance test is executed with dump-cl-files cache mode and online
compilation mode, the files will be saved to the disk and the regular execution
flow of the conformance continues uninterrupted.

When a conformance test is executed with dump-cl-files cache mode and binary or spir-v
compilation mode, the files will be saved to the disk as well, however the compilation
will fail - leading to a failure in all test cases.

* Introduces the ability to capture the kernel sources and the build
options used by the conformance tests to a .cl and .options files.
This is achieved via a new compilation cache mode called dump-cl-files.
Files will be generated to the folder pointed by the compilation cache
path.

When a conformance test is executed with dump-cl-files cache mode and online
compilation mode, the files will be saved to the disk and the regular execution
flow of the conformance continues uninterrupted.

When a conformance test is executed with dump-cl-files cache mode and binary or spir-v
compilation mode, the files will be saved to the disk as well, however the compilation
will fail - leading to a failure in all test cases.

* merged with latest CTS code
2019-11-18 09:45:44 +00:00
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
c45d5b6a20 Update command line parameters for offline compilation
This change simplifies the command line interface for controlling offline
compilation.  It replaces special command line syntax for controlling the
compilation cache for SPIR-V compilation, with generic command line
parameters that can now also be used for binary offline compilation.
2019-07-08 11:34:02 +01:00
Stuart Brady
6eec559ffd Rename gSpirVPath to gCompilationCachePath
gSpirVPath controls the location of the compilation cache for SPIR-V
offline compilation, but its use would also make sense for binary
offline compilation.  This change renames it to gCompilationCachePath.
2019-07-08 11:34:02 +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
74f82665d0 Reindent parameter parsing code 2019-07-05 14:27:13 +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
c1cd117265 Make wimpy factor argument parsing logic common (#155) 2019-04-11 12:10:45 +01:00
Kedar Patil
2821bf1323 Initial open source release of OpenCL 2.2 CTS. 2017-05-16 18:44:33 +05:30