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 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.
This commit is contained in:
committed by
Kévin Petit
parent
8b34a55cfc
commit
0b1520f508
@@ -423,7 +423,7 @@ int test_get_program_source(cl_device_id deviceID, cl_context context, cl_comman
|
||||
/* Try getting the length */
|
||||
error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, NULL, NULL, &length );
|
||||
test_error( error, "Unable to get program source length" );
|
||||
if (length != strlen(sample_kernel_code_single_line[0]) + 1 && !gOfflineCompiler)
|
||||
if (length != strlen(sample_kernel_code_single_line[0]) + 1 && gCompilationMode == kOnline)
|
||||
{
|
||||
log_error( "ERROR: Length returned for program source is incorrect!\n" );
|
||||
return -1;
|
||||
@@ -432,7 +432,7 @@ int test_get_program_source(cl_device_id deviceID, cl_context context, cl_comman
|
||||
/* Try normal source */
|
||||
error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, sizeof( buffer ), buffer, NULL );
|
||||
test_error( error, "Unable to get program source" );
|
||||
if (strlen(buffer) != strlen(sample_kernel_code_single_line[0]) && !gOfflineCompiler)
|
||||
if (strlen(buffer) != strlen(sample_kernel_code_single_line[0]) && gCompilationMode == kOnline)
|
||||
{
|
||||
log_error( "ERROR: Length of program source is incorrect!\n" );
|
||||
return -1;
|
||||
@@ -441,12 +441,12 @@ int test_get_program_source(cl_device_id deviceID, cl_context context, cl_comman
|
||||
/* Try both at once */
|
||||
error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, sizeof( buffer ), buffer, &length );
|
||||
test_error( error, "Unable to get program source" );
|
||||
if (strlen(buffer) != strlen(sample_kernel_code_single_line[0]) && !gOfflineCompiler)
|
||||
if (strlen(buffer) != strlen(sample_kernel_code_single_line[0]) && gCompilationMode == kOnline)
|
||||
{
|
||||
log_error( "ERROR: Length of program source is incorrect!\n" );
|
||||
return -1;
|
||||
}
|
||||
if (length != strlen(sample_kernel_code_single_line[0]) + 1 && !gOfflineCompiler)
|
||||
if (length != strlen(sample_kernel_code_single_line[0]) + 1 && gCompilationMode == kOnline)
|
||||
{
|
||||
log_error( "ERROR: Returned length of program source is incorrect!\n" );
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user