numba_dpex.decorators module

numba_dpex.decorators.dpjit(*args, **kws)
numba_dpex.decorators.func(func_or_sig=None, debug=False, enable_cache=True)

A decorator to define a kernel device function.

Device functions are functions that can be only invoked from a kernel and not from a host function. This provides a special decorator numba_dpex.func specifically to implement a device function.

A device function can be invoked from another device function and unlike a kernel function, a device function can return a value like normal functions.

numba_dpex.decorators.kernel(func_or_sig=None, debug=False, enable_cache=True)

A decorator to define a kernel function.

A kernel function is conceptually equivalent to a SYCL kernel function, and gets compiled into either an OpenCL or a LevelZero SPIR-V binary kernel. A kernel decorated Python function has the following restrictions:

  • The function can not return any value.

  • All array arguments passed to a kernel should adhere to compute follows data programming model.