numba.functions

class numba.functions.FunctionCache(context)

Cache for compiler functions, declared external functions and constants.

compile_function(func, argtypes, restype=None, ctypes=False, **kwds)

Compile a python function given the argument types. Compile only if not compiled already, and only if it is registered to the function cache.

Returns a triplet of (signature, llvm_func, python_callable) python_callable may be the original function, or a ctypes callable if the function was compiled.

get_autojit_cache(py_func)

Get the numbawrapper.AutojitFunctionCache that does a quick lookup for the cached case.

get_function(py_func, argtypes, flags)

Get a compiled function in the the function cache. The function must not be an external function.

For an external function, is_registered() must return False.

is_registered(func)

Check if a function is registered to the FunctionCache instance.

register(func)

Register a function to the FunctionCache.

It is necessary before calling compile_function().

numba.functions.keep_alive(py_func, obj)

Keep an object alive for the lifetime of the translated unit.

This is a HACK. Make live objects part of the function-cache

NOTE: py_func may be None, so we can’t make it a function attribute

Previous topic

numba.decorators

Next topic

numba.llvm_types

This Page