transonic.aheadoftime

User runtime API for the ahead-of-time compilation

User API

transonic.aheadoftime.boost(obj=None, backend: str | None = None, inline=False, boundscheck=True, wraparound=True, cdivision=False, nonecheck=True, nogil=False)[source]

Decorator to declare that an object can be accelerated

Parameters:
obj: a function, a method or a class
class transonic.aheadoftime.Transonic(use_transonified=True, frame=None, reuse=True, backend=None)[source]

Bases: object

Representation of a module using ahead-of-time transonic commands

Parameters:
use_transonifiedbool (optional, default True)

If False, don’t use the pythranized versions at run time

frameint (optional)

(Internal) Frame of __init__ caller.

reusebool (optional, default True)

(Internal) If True, do not recreate an instance.

transonic_def(func)[source]

Decorator used for functions

Parameters:
func: a function
transonic_def_method(func)[source]

Decorator used for methods

Parameters:
func: a function
boost(**kwargs)[source]

Universal decorator for AOT compilation

Used for functions, methods and classes.

_boost_decor(obj)[source]

Universal decorator for AOT compilation

Used for functions, methods and classes.

transonic_class(cls: type)[source]

Decorator used for classes

Parameters:
cls: a class
use_block(name)[source]

Use the pythranized version of a code block

Parameters:
namestr

The name of the block.

Internal API

transonic.aheadoftime._get_transonic_calling_module(backend_name: str | None = None)[source]

Get the Transonic instance corresponding to the calling module

Parameters:
backend_name: str
class transonic.aheadoftime.CheckCompiling(ts, func)[source]

Bases: object

Check if the module is being compiled and replace the module and the function

Functions

boost([obj, backend, inline, boundscheck, ...])

Decorator to declare that an object can be accelerated

jit_class(cls, jit_methods, backend)

Modify the class by replacing jit methods

Classes

CheckCompiling(ts, func)

Check if the module is being compiled and replace the module and the function

Transonic([use_transonified, frame, reuse, ...])

Representation of a module using ahead-of-time transonic commands

TransonicTemporaryJITMethod(func, native, ...)

Internal temporary class for JIT methods

TransonicTemporaryMethod(func)

Internal temporary class for methods