Files
OpenCL-CTS/test_common/harness/parseParameters.h
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

46 lines
1.2 KiB
C++

//
// Copyright (c) 2017 The Khronos Group Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef _parseParameters_h
#define _parseParameters_h
#include "compat.h"
#include <string>
enum CompilationMode
{
kOnline = 0,
kBinary,
kSpir_v
};
enum CompilationCacheMode
{
kCacheModeCompileIfAbsent = 0,
kCacheModeForceRead,
kCacheModeOverwrite
};
extern CompilationMode gCompilationMode;
extern CompilationCacheMode gCompilationCacheMode;
extern std::string gCompilationCachePath;
extern std::string gCompilationProgram;
extern int parseCustomParam (int argc, const char *argv[], const char *ignore = 0 );
extern void parseWimpyReductionFactor(const char *&arg, int &wimpyReductionFactor);
#endif // _parseParameters_h