loki.build.jit

Utilities to facilitate Just-in-Time compilation for testing purposes.

Functions

clean_test(filepath)

Clean test directory based on JIT'ed source file.

jit_compile(source[, filepath, objname])

Generate, Just-in-Time compile and load a given item for interactive execution.

jit_compile_lib(sources, path, name[, wrap, ...])

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 or Module or Subroutine) – The item to compile and load

  • filepath (str or Path, optional) – Path of the source file to write (default: hashed name in gettempdir())

  • 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 files

  • name (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.