Open Table Of Contents

intrinsic Package

intrinsic Package

class numba.intrinsic.CStringSlice2(**kwargs)

Bases: numba.intrinsic.intrinsic.Intrinsic

arg_types = [string, string, size_t, Py_ssize_t, Py_ssize_t]
implementation(module, lfunc)
return_type = void
class numba.intrinsic.CStringSlice2Len(**kwargs)

Bases: numba.intrinsic.intrinsic.Intrinsic

arg_types = [string, size_t, Py_ssize_t, Py_ssize_t]
implementation(module, lfunc)
return_type = size_t

intrinsic Module

class numba.intrinsic.intrinsic.Intrinsic(**kwargs)

Bases: object

arg_types = None
func_name = None
implementation(module, lfunc)
is_vararg = False
linkage = 3
name
return_type = None
signature
class numba.intrinsic.intrinsic.IntrinsicLibrary(context)

Bases: object

An intrinsic library maintains a LLVM module for holding the intrinsics. These are functions are used internally to implement specific features.

add(intr)

Add a new intrinsic. intr — an Intrinsic class

declare(module, name, arg_types=(), return_type=None)

Create a declaration in the module.

get(name, arg_types=(), return_type=None)

Get an intrinsic by name and sig

name — function name arg_types — function arg types return_types — function return type

Returns the function signature and a lfunc pointing to the

implement(intr)

Implement a new intrinsic. intr — an Intrinsic class

Link the intrinsic library into the target module.

class numba.intrinsic.intrinsic.Signature

Bases: tuple

Signature(return_type, arg_types)

arg_types

Alias for field number 1

return_type

Alias for field number 0

numba_intrinsic Module

class numba.intrinsic.numba_intrinsic.Intrinsic(func_signature, name)

Bases: object

emit_code(lfunc, builder, llvm_args)
class numba.intrinsic.numba_intrinsic.IntrinsicNode(intrinsic, args)

Bases: numba.nodes.basenodes.ExprNode

AST Node representing a reference to an intrinsic

class numba.intrinsic.numba_intrinsic.NumbaInstruction(func_signature, name)

Bases: numba.intrinsic.numba_intrinsic.Intrinsic

emit_code(lfunc, builder, llvm_args)
class numba.intrinsic.numba_intrinsic.NumbaIntrinsic(func_signature, name)

Bases: numba.intrinsic.numba_intrinsic.Intrinsic

emit_code(lfunc, builder, llvm_args)
numba.intrinsic.numba_intrinsic.declare_instruction(func_signature, name)

Declare an instruction, e.g.

>>> declare_instruction(int32(int32, int32), "add")

The llvm.core.Builder instruction with the given name will be used.

numba.intrinsic.numba_intrinsic.declare_intrinsic(func_signature, name)

Declare an intrinsic, e.g.

>>> declare_intrinsic(void(), "llvm.debugtrap")
numba.intrinsic.numba_intrinsic.is_numba_intrinsic(value)
numba.intrinsic.numba_intrinsic.make_intrinsic(intrinsic)

Create an intrinsic function given an Intrinsic.

numba.intrinsic.numba_intrinsic.register_infer_intrinsic(intrinsic)

string_intrinsic Module

class numba.intrinsic.string_intrinsic.CStringSlice2(**kwargs)

Bases: numba.intrinsic.intrinsic.Intrinsic

arg_types = [string, string, size_t, Py_ssize_t, Py_ssize_t]
implementation(module, lfunc)
return_type = void
class numba.intrinsic.string_intrinsic.CStringSlice2Len(**kwargs)

Bases: numba.intrinsic.intrinsic.Intrinsic

arg_types = [string, size_t, Py_ssize_t, Py_ssize_t]
implementation(module, lfunc)
return_type = size_t