numba_dpex.core.utils package
Subpackages
Submodules
- numba_dpex.core.utils.caching_utils module
- numba_dpex.core.utils.kernel_launcher module
KernelLaunchIRBuilderKernelLaunchIRBuilder.allocate_kernel_arg_array()KernelLaunchIRBuilder.allocate_kernel_arg_ty_array()KernelLaunchIRBuilder.build_arg()KernelLaunchIRBuilder.build_array_arg()KernelLaunchIRBuilder.build_complex_arg()KernelLaunchIRBuilder.free_queue()KernelLaunchIRBuilder.get_queue()KernelLaunchIRBuilder.submit_sync_kernel()
- numba_dpex.core.utils.suai_helper module
SyclUSMArrayInterfaceSyclUSMArrayInterface.dataSyclUSMArrayInterface.deviceSyclUSMArrayInterface.dimensionsSyclUSMArrayInterface.dtypeSyclUSMArrayInterface.is_writableSyclUSMArrayInterface.itemsizeSyclUSMArrayInterface.queueSyclUSMArrayInterface.shapeSyclUSMArrayInterface.sizeSyclUSMArrayInterface.stridesSyclUSMArrayInterface.usm_type
get_info_from_suai()
Module contents
- class numba_dpex.core.utils.SyclUSMArrayInterface(data, writable, size, shape, dimensions, itemsize, strides, dtype, usm_type, device, queue)
Bases:
objectStores as attributes the information extracted from a __sycl_usm_array_interface__ dictionary as defined by dpctl.memory.Memory* classes.
- property data
- property device
- property dimensions
- property dtype
- property is_writable
- property itemsize
- property queue
- property shape
- property size
- property strides
- property usm_type
- numba_dpex.core.utils.build_key(*args)
Constructs key from variable list of args
- Args:
*args: List of components to construct key
- Return:
Tuple of args
- numba_dpex.core.utils.create_func_hash(pyfunc)
Creates a tuple of sha256 hashes out of code and variable bytes extracted from the compiled funtion.
- Args:
pyfunc: Python function object
- Return:
Tuple of hashes of code and variable bytes
- numba_dpex.core.utils.get_info_from_suai(obj)
Extracts the metadata of an object of type UsmNdArray using the objects __sycl_usm_array_interface__ (SUAI) attribute.
The
dpctl.memory.as_usm_memoryfunction converts the array-like object into a dpctl.memory.USMMemory object. Using theas_usm_memoryis an implicit way to verify if the array-like object is a legal SYCL USM memory back Python object that can be passed to a dpex kernel.- Args:
obj: array-like object with a SUAI attribute.
- Returns:
A SyclUSMArrayInterface object
- numba_dpex.core.utils.strip_usm_metadata(argtypes)
Convert the USMNdArray to an abridged type that disregards the usm_type, device, queue, address space attributes.
- Args:
argtypes: List of types
- Return:
Tuple of types after removing USM metadata from USMNdArray type