numba_dpex.core.utils.suai_helper module

class numba_dpex.core.utils.suai_helper.SyclUSMArrayInterface(data, writable, size, shape, dimensions, itemsize, strides, dtype, usm_type, device, queue)

Bases: object

Stores 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.suai_helper.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_memory function converts the array-like object into a dpctl.memory.USMMemory object. Using the as_usm_memory is 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