numba_dpex.utils.type_conversion_fns module
-Provides helper functions to convert from numba types to dpex types.
--
-
- Currently the module supports the following converter functions:
-
-
types.npytypes.Array to numba_dpex.core.types.Array.
-
-
-
-
- -numba_dpex.utils.type_conversion_fns.npytypes_array_to_dpex_array(arrtype, addrspace=1) -
Converts Numba’s
-Array
type tonumba_dpex.core.types.Array
-type.Numba’s
-Array
type does not have a notion of address space for the data -pointer. To get around the issues, numba_dpex defines its own array type -that is inherits from Numba’s Array type. In the -numba_dpex.core.types.Array
type the data pointer has an -associated address space. In addition, thememinfo
and theparent
-attributes are stored asCPointer
types instead ofPyObject
.The converter function converts the Numba
-Array
type to -numba_dpex.core.types.Array
type with address space of pointer -members typed to the specified address space.-
-
- Args:
-
-
- arrtype (numba.types): A numba data type that should be
-numba.types.Array
.
-- specified: Defaults to
numba_dpex.utils.address_space.GLOBAL
. The SPIR-V address space to which the data pointer of the array -belongs.
-
-
-
Returns: The dpex data type corresponding to the input numba type.
--
-
- Raises:
-
-
- NotImplementedError: If the input numba type is not
-numba.types.Array
-
-