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:
Stuart Brady
2019-06-27 17:44:54 +01:00
committed by Kévin Petit
parent 814dd8adc0
commit 9be570cdf0
6 changed files with 62 additions and 39 deletions

View File

@@ -139,7 +139,7 @@ int get_program_with_il(clProgramWrapper &prog,
const char *prog_name)
{
cl_int err = 0;
if (gOfflineCompiler && gOfflineCompilerOutputType == kBinary) {
if (gCompilationMode == kBinary) {
return offline_get_program_with_il(prog, deviceID, context, prog_name);
}