numba_dpex.core.targets.dpjit_target

Defines the target and typing contexts for numba_dpex’s dpjit decorator.

Overview

Classes

Dpex

Mark the target as CPU.

DpexTypingContext

Custom typing context to support dpjit compilation.

DpexTargetContext

Changes BaseContext calling convention

Classes

class Dpex

Bases: numba.core.target_extension.CPU

Mark the target as CPU.

class DpexTypingContext

Bases: numba.core.typing.Context

Custom typing context to support dpjit compilation.

Overview

Methods

load_additional_registries()

Register dpjit specific functions like dpnp ufuncs.

Members

load_additional_registries()

Register dpjit specific functions like dpnp ufuncs.

class DpexTargetContext(typingctx, target=DPEX_TARGET_NAME)

Bases: numba.core.cpu.CPUContext

Changes BaseContext calling convention

Overview

Methods

init()

For subclasses to add initializer

dpexrt()

-

load_additional_registries()

Load dpjit-specific registries.

get_ufunc_info(ufunc_key)

Get the ufunc implementation for a given ufunc object.

Members

init()

For subclasses to add initializer

dpexrt()
load_additional_registries()

Load dpjit-specific registries.

get_ufunc_info(ufunc_key)

Get the ufunc implementation for a given ufunc object.

The default implementation in BaseContext always raises a NotImplementedError exception. Subclasses may raise KeyError to signal that the given ufunc_key is not available.

Parameters:

ufunc_key (NumPy ufunc)

Returns:

res – A mapping of a NumPy ufunc type signature to a lower-level implementation.

Return type:

dict[str, callable]

Attributes

DPEX_TARGET_NAME = 'dpex'
dpex_function_registry