transonic.aheadoftime

User runtime API for the ahead-of-time compilation

User API

transonic.aheadoftime.boost(obj=None, backend: str = 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) Index (in inspect.stack()) of the frame to be selected

reusebool (optional, default True)

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

transonic_def(self, func)[source]

Decorator used for functions

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

Decorator used for methods

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

Universal decorator for AOT compilation

Used for functions, methods and classes.

_boost_decor(self, obj)[source]

Universal decorator for AOT compilation

Used for functions, methods and classes.

transonic_class(self, cls: type)[source]

Decorator used for classes

Parameters
cls: a class
use_block(self, 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, index_frame: int = 2)[source]

Get the Transonic instance corresponding to the calling module

Parameters
index_frameint

Index (in inspect.stack()) of the frame to be selected

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, 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