numba_dpex.numba_patches.patch_mk_alloc module

numba_dpex.numba_patches.patch_mk_alloc.patch()

Patches the numba.core.ir_utils.mk_alloc function to support non-NumPy array types.

The patch extends the ir_utils.mk_alloc function that is used by numba.parfors.parfor to allocate an empty temp array inside a parfor section. Without the patch Numba always allocates the temp using numpy.empty, with the patch the function checks if the array type to be allocated has a __allocate__ method, and if so uses that method to allocate the temporary array.

TODO: Already merged into Numba main and should be removed when numba-dpex is ported to Numba 0.58