Cache kernels to avoid running C preprocessor multiple times
Add kernel caching unit tests