pystencils.jit.cpu.CpuJit#
- class pystencils.jit.cpu.CpuJit(compiler_info, ext_module_builder, objcache)#
Just-in-time compiler for CPU kernels.
Creation
To configure and create a CPU JIT compiler instance, use the
create
factory method.Implementation Details
The
CpuJit
class acts as an orchestrator between two components:The extension module builder produces the code of the dynamically built extension module that contains the kernel and its invocation wrappers;
The compiler info describes the host compiler used to compile and link that extension module.
- Parameters:
compiler_info (
CompilerInfo
) – The compiler info object defining the capabilities and command-line interface of the host compilerext_module_builder (
ExtensionModuleBuilderBase
) – Extension module builder object used to generate the kernel extension moduleobjcache (
Path
|None
) – Directory to cache the generated code files and compiled modules in. IfNone
, a temporary directory will be used, and compilation results will not be cached.
- static create(compiler_info=None, objcache=AUTO)#
Configure and create a CPU JIT compiler object.
- Parameters:
compiler_info (
Optional
[CompilerInfo
]) – Compiler info object defining capabilities and interface of the host compiler. IfNone
, a default compiler configuration will be determined from the current OS and runtime environment.objcache (
str
|Path
|_AUTO_TYPE
|None
) – Directory used for caching compilation results. If set toAUTO
, a persistent cache directory in the current user’s home will be used. If set toNone
, compilation results will not be cached–this may impact performance.
- Return type:
- Returns:
The CPU just-in-time compiler.