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
This commit is contained in:
boazo
2019-11-18 11:45:44 +02:00
committed by Kévin Petit
parent 040321d8b9
commit 60101c24cf
3 changed files with 194 additions and 138 deletions

View File

@@ -47,8 +47,9 @@ void helpInfo ()
" --compilation-cache-mode <cache-mode> Specify a compilation caching mode:\n"
" compile-if-absent Read from cache if already populated, or\n"
" else perform offline compilation (default)\n"
" force-read Force reading from the cache\n"
" overwrite Disable reading from the cache\n"
" force-read Force reading from the cache\n"
" overwrite Disable reading from the cache\n"
" dump-cl-files Dumps the .cl and build .options files used by the test suite\n"
" --compilation-cache-path <path> Path for offline compiler output and CL source\n"
" --compilation-program <prog> Program to use for offline compilation,\n"
" defaults to " DEFAULT_COMPILATION_PROGRAM "\n"
@@ -135,6 +136,10 @@ int parseCustomParam (int argc, const char *argv[], const char *ignore)
{
gCompilationCacheMode = kCacheModeOverwrite;
}
else if (!strcmp(mode, "dump-cl-files"))
{
gCompilationCacheMode = kCacheModeDumpCl;
}
else
{
log_error("Compilation cache mode not recognized: %s\n", mode);
@@ -185,7 +190,8 @@ int parseCustomParam (int argc, const char *argv[], const char *ignore)
i -= delArg;
}
if (gCompilationCacheMode != kCacheModeCompileIfAbsent && gCompilationMode == kOnline)
if ((gCompilationCacheMode == kCacheModeForceRead || gCompilationCacheMode == kCacheModeOverwrite)
&& gCompilationMode == kOnline)
{
log_error("Compilation cache mode can only be specified when using an offline compilation mode.\n");
return -1;