numba_dpex.vectorizers module

Provide a Dpex target for Numba’s vectorize decorator.

class numba_dpex.vectorizers.UFuncDispatcher(types_to_retty_kernels)

Bases: object

Invoke the Dpex ufunc specialization for the given inputs.

reduce(arg, queue=0)
class numba_dpex.vectorizers.UFuncMechanism(typemap, args)

Bases: UFuncMechanism

Mechanism to process Input to a SYCL kernel and launch that kernel

as_device_array(obj)

Convert the obj to a device array Override in subclass

Default implementation is an identity function

broadcast_device(ary, shape)

Handles ondevice broadcasting

Override in subclass to add support.

classmethod call(typemap, args, kws)

Perform the entire ufunc call mechanism.

Args:

typemap (dict): Signature mapped to kernel. args: Arguments to the @vectorize function. kws (optional): Optional keywords. Not supported.

device_array(shape, dtype, queue)
is_device_array(obj)

Is the obj a device array? Override in subclass

is_host_array(obj)
launch(func, count, queue, args)

Implements device function invocation Override in subclass

to_device(hostary, queue)

Implement to device transfer Override in subclass

to_host(devary, queue)

Implement to host transfer Override in subclass

class numba_dpex.vectorizers.Vectorize(func, identity=None, cache=False, targetoptions={})

Bases: DeviceVectorize

build_ufunc()