volumential.kernel_cache#

Disk-cached loopy kernel generation.

This module owns KernelCacheWrapper, the mix-in that every volumential operator with a generated loopy kernel inherits from. It is re-exported by volumential.tools for backwards compatibility.

class volumential.kernel_cache.KernelCacheWrapper[source]#

Bases: object

Mix-in providing a disk-cached loopy kernel.

Subclasses must implement get_cache_key(), get_kernel() and get_optimized_kernel(), and set a name attribute used in log messages.

get_cache_key() → tuple[Any, ...][source]#

Return a hashable key identifying the generated kernel.

get_kernel()[source]#

Return the unoptimized loopy kernel.

get_optimized_kernel()[source]#

Return the transformed (optimized) loopy kernel.

get_cached_optimized_kernel(**kwargs)[source]#

Return the kernel for kwargs, using the on-disk code cache.