mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
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 commit is contained in:
committed by
Kévin Petit
parent
814dd8adc0
commit
9be570cdf0
@@ -27,11 +27,9 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
bool gOfflineCompiler = false;
|
||||
bool gForceSpirVCache = false;
|
||||
bool gForceSpirVGenerate = false;
|
||||
std::string gSpirVPath = ".";
|
||||
OfflineCompilerOutputType gOfflineCompilerOutputType;
|
||||
CompilationMode gCompilationMode = kOnline;
|
||||
CompilationCacheMode gCompilationCacheMode = kCacheModeCompileIfAbsent;
|
||||
std::string gSpirVPath = ".";
|
||||
|
||||
void helpInfo ()
|
||||
{
|
||||
@@ -78,29 +76,27 @@ int parseCustomParam (int argc, const char *argv[], const char *ignore)
|
||||
delArg = 1;
|
||||
if ((i + 1) < argc)
|
||||
{
|
||||
gOfflineCompiler = true;
|
||||
|
||||
if (!strcmp(argv[i + 1], "binary"))
|
||||
{
|
||||
gOfflineCompilerOutputType = kBinary;
|
||||
gCompilationMode = kBinary;
|
||||
delArg++;
|
||||
}
|
||||
else if (!strcmp(argv[i + 1], "spir_v"))
|
||||
{
|
||||
gOfflineCompilerOutputType = kSpir_v;
|
||||
gCompilationMode = kSpir_v;
|
||||
delArg++;
|
||||
if ((i + 3) < argc)
|
||||
{
|
||||
if (!strcmp(argv[i + 2], "cache"))
|
||||
{
|
||||
gForceSpirVCache = true;
|
||||
gCompilationCacheMode = kCacheModeForceRead;
|
||||
gSpirVPath = argv[i + 3];
|
||||
log_info(" SpirV reading from cache enabled.\n");
|
||||
delArg += 2;
|
||||
}
|
||||
else if (!strcmp(argv[i + 2], "generate"))
|
||||
{
|
||||
gForceSpirVGenerate = true;
|
||||
gCompilationCacheMode = kCacheModeOverwrite;
|
||||
gSpirVPath = argv[i + 3];
|
||||
log_info(" SpirV force generate binaries enabled.\n");
|
||||
delArg += 2;
|
||||
|
||||
Reference in New Issue
Block a user