Skip to content

Extension modules

What a module that cimports the runtime needs at build and import time. The functions that the module calls, such as execute, are declared in cyxla/_runtime.pxd and are described in the extension modules guide.

get_include

get_include() -> list[str]

Returns the directories that an extension module needs to build against cyxla.

The first holds the PJRT C API header, for the C compiler. The second is the parent of the package, in which Cython finds cyxla/_runtime.pxd.

check_abi

check_abi(compiled_version: int) -> None

Raises an ImportError unless a module was compiled against these declarations.

An extension module passes the ABI_VERSION that it cimported from cyxla._runtime when it is imported. Cython checks the signatures of shared functions itself, but not the layout of structs such as ProgramSpec.

ABI_VERSION module-attribute

ABI_VERSION = abi_version()

Version of the declarations in _runtime.pxd that this installation was compiled with.

abi_version

abi_version() -> int

Returns the ABI_VERSION that this module was compiled with.