pystencils.jit.cpu.CpuJit#
- class pystencils.jit.cpu.CpuJit(compiler_info=None, objcache=AUTO, *, module_builder=None, emit_warnings=False)#
Just-in-time compiler for CPU kernels.
The
CpuJitturns pystencilsKernelobjects into executable Python functions by wrapping them in a C++ extension module with glue code to the Python and NumPy API. That module is then compiled by a host compiler and dynamically loaded into the Python session.Implementation Details
The
CpuJitclass 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 (
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.module_builder (
Optional[ExtensionModuleBuilderBase]) – Optionally, an extension module builder to be used by the JIT compiler. When left atNone, the default implementation will be used.emit_warnings (bool)