numba_dpex.core.parfors.parfor_pass

This module follows the logic of numba/parfors/parfor.py with changes required to use it with dpnp instead of numpy.

Overview

Classes

ConvertDPNPPass

Convert supported Dpnp functions, as well as arrayexpr nodes, to

ParforPass

Based on the NumpyParforPass. Lot’s of code was copy-pasted, with minor

Function

get_dpnp_ufunc_typ(func)

get type of the incoming function from builtin registry

mk_alloc(typingctx, typemap, calltypes, lhs, size_var, dtype, scope, loc, lhs_typ, **kws)

generate an array allocation with np.empty() and return list of nodes.

Classes

class ConvertDPNPPass(pass_states)

Bases: numba.parfors.parfor.ConvertNumpyPass

Convert supported Dpnp functions, as well as arrayexpr nodes, to parfor nodes.

Based on the ConvertNumpyPass. Lot’s of code was copy-pasted, with minor changes due to lack of extensibility of the original package.

class ParforPass

Bases: numba.core.typed_passes.ParforPass

Based on the NumpyParforPass. Lot’s of code was copy-pasted, with minor changes due to lack of extensibility of the original package.

Overview

Methods

run_pass(state)

Convert data-parallel computations into Parfor nodes.

Members

run_pass(state)

Convert data-parallel computations into Parfor nodes.

Exactly same as the original one, but with mock to _ParforPass.

Functions

get_dpnp_ufunc_typ(func)

get type of the incoming function from builtin registry

mk_alloc(typingctx, typemap, calltypes, lhs, size_var, dtype, scope, loc, lhs_typ, **kws)

generate an array allocation with np.empty() and return list of nodes. size_var can be an int variable or tuple of int variables. lhs_typ is the type of the array being allocated.

Taken from numba, added kws argument to pass it to __allocate__