Open Table Of Contents

vectorize Package

vectorize Package

numba.vectorize.vectorize(signatures, backend='ast', target='cpu')
numba.vectorize.Vectorize(func, backend='ast', target='cpu')

Instantiate a vectorizer given the backend and target.

func: the function to vectorize backend: ‘ast’ Default: ‘ast’ target: ‘basic’ Default: ‘basic’

numba.vectorize.BasicVectorize

alias of BasicASTVectorize

class numba.vectorize.BasicASTVectorize(func)

Bases: numba.vectorize._common.GenericASTVectorize

build_ufunc(dispatcher=None)
numba.vectorize.GUVectorize

alias of GUFuncASTVectorize

_common Module

class numba.vectorize._common.CommonVectorizeFromFunc

Bases: object

build(lfunc, dtypes)
get_dtype_nums(tyslist)
class numba.vectorize._common.GenericASTVectorize(func)

Bases: object

add(restype=None, argtypes=None, **kwds)

Add a specialization to the vectorizer. Pass any keyword arguments to numba.jit().

build_ufunc()
build_ufunc_core(**kws)

Build the ufunc core functions and returns the prototype and pointer. The return value is a list of tuples (prototype, pointer).

get_argtypes(numba_func)
register_ufunc(ufunc)
numba.vectorize._common.post_vectorize_optimize(func)

Perform aggressive optimization after each vectorizer.

TODO: review if this is necessary.

basic Module

Implements basic vectorize

class numba.vectorize.basic.BasicASTVectorize(func)

Bases: numba.vectorize._common.GenericASTVectorize

build_ufunc(dispatcher=None)
class numba.vectorize.basic.BasicUFunc(*args, **kwargs)

Bases: llvm_cbuilder.builder.CDefinition

a generic ufunc that wraps the workload

body(args, dimensions, steps, data)
specialize(func_def)

specialize to a workload

numba.vectorize.basic.BasicVectorize

alias of BasicASTVectorize

gufunc Module

class numba.vectorize.gufunc.GUFuncASTVectorize(func, sig)

Bases: object

Vectorizer for generalized ufuncs.

add(restype=None, argtypes=None)
build_ufunc()
get_argtypes(numba_func)
class numba.vectorize.gufunc.GUFuncEntry(*args, **kwargs)

Bases: llvm_cbuilder.builder.CDefinition

a generalized ufunc that wraps a numba jit’ed function

NOTE: Currently, this only works for array return type. And, return type must be the last argument of the nubma jit’ed function.

body(args, dimensions, steps, data)
classmethod specialize(dtypes, signature, func_def)

specialize to a workload

numba.vectorize.gufunc.GUFuncVectorize

alias of GUFuncASTVectorize

class numba.vectorize.gufunc.PyArray(parent, ptr)

Bases: llvm_cbuilder.builder.CStruct

fakeit(dtype, data, dimensions, steps)
class numba.vectorize.gufunc.PyObjectHead(parent, ptr)

Bases: llvm_cbuilder.builder.CStruct

Subpackages