loki.build.jit
Utilities to facilitate Just-in-Time compilation for testing purposes.
Functions
|
Clean test directory based on JIT'ed source file. |
|
Generate, Just-in-Time compile and load a given item for interactive execution. |
|
Generate, just-in-time compile and load a set of items into a library and import dynamically into the Python runtime. |
- jit_compile(source, filepath=None, objname=None)
Generate, Just-in-Time compile and load a given item for interactive execution.
- Parameters:
source (
Sourcefile
orModule
orSubroutine
) – The item to compile and loadfilepath (str or
Path
, optional) – Path of the source file to write (default: hashed name ingettempdir()
)objname (str, optional) – Return a specific object (module or subroutine) in
source
- jit_compile_lib(sources, path, name, wrap=None, builder=None)
Generate, just-in-time compile and load a set of items into a library and import dynamically into the Python runtime.
- Parameters:
source (list) – Source items or filepaths to compile and add to lib
path (str or
Path
) – Basepath for on-the-fly creation of source filesname (str) – Name of created lib
wrap (list, optional) – File names to pass to
f90wrap
. Defaults to list of source files.builder (
Builder
, optional) – Builder object to use for lib compilation and linking
- clean_test(filepath)
Clean test directory based on JIT’ed source file.