intel / compute-runtime

Intel® Graphics Compute Runtime for oneAPI Level Zero and OpenCL™ Driver
MIT License
1.1k stars 229 forks source link

Feature request: Add support for using OCLOC compilation cache in repeated AOT compilation passes #660

Open mirenradia opened 1 year ago

mirenradia commented 1 year ago

OCLOC already supports writing its cache to a user-specified directory but I'm not too sure what this is used for when using AOT compilation (in the JIT case, it's clearer to me).

It would be great if this cache could be used in a similar way to ccache. For example, I'd like it to be able to do the following.

  1. Compile some C++ code with a SYCL kernel using the oneAPI DPC++ compiler with AOT compilation and cache this compilation using OCLOC's caching feature.
  2. Modify the code but keep the SYCL kernel unchanged (including all of its dependencies).
  3. Recompile the code in the same way. OCLOC realises that it is compiling the same kernel and therefore just re-uses the cache. The device compilation step is therefore much faster.

I spoke to @Pennycook and he claimed this is not currently supported but I should create a feature request hence why I have created this issue.