You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The obj is an object to be converted to an array. asarray supports:
an instance of dpctl.tensor.usm_ndarray
an object with __sycl_usm_array_interface__
an instance of numpy.ndarray
Python scalar, a (possibly nested) sequence of Python scalars
an object supporting Python buffer protocol
N.B.: presently sequences of usm_ndarray objects are not supported, nor are sequences mixing objects with SYCL allocations and objects with host allocations.
obj that does not fall into any of the above categories, but implements __dlpack__ protocol could be imported with dpctl.tensor.from_dlpack function (array-API spec).
device and sycl_queue keywords are exclusive (use one or another) unless they represent the same queue.
device keyword can be None, a valid filter selector string, non-partitioned dpctl.SyclDevice, or dpctl.SyclQueue instance, or the object output by usm_ary.device.
sycl_queue can be either None, or instance of dpctl.SyclQueue. In the case when device=None and sycl_queue=None, array will be created on device selected by SYCL's default_selector.
usm_type can be None, "device", "shared", or "host". usm_type=None is understood as keep the usm_type in case when obj is an instance of usm_ndarray, or has __sycl_usm_array_interface__, or use usm_type="device" otherwise.
@oleksandr-pavlyk
Thank you for the description.
I will integrate it in numba-dppy (IntelPython/numba-dpex#634).
It looks like a documentation. Is it a part of documentation already?
Activity
oleksandr-pavlyk commentedon Oct 26, 2021
It needs to be in the same namespace as the
usm_ndarray, i.e.dpctl.tensor.asarray.Add `.sycl_queue` property to MemoryUSM* classes per #640
Memory properties (#647)
oleksandr-pavlyk commentedon Nov 19, 2021
Specs for
asarray:With #646, the
dpctl.tensor.asarrayhas the following signature:The
objis an object to be converted to an array.asarraysupports:dpctl.tensor.usm_ndarray__sycl_usm_array_interface__numpy.ndarrayN.B.: presently sequences of
usm_ndarrayobjects are not supported, nor are sequences mixing objects with SYCL allocations and objects with host allocations.objthat does not fall into any of the above categories, but implements__dlpack__protocol could be imported withdpctl.tensor.from_dlpackfunction (array-API spec).deviceandsycl_queuekeywords are exclusive (use one or another) unless they represent the same queue.devicekeyword can beNone, a valid filter selector string, non-partitioneddpctl.SyclDevice, ordpctl.SyclQueueinstance, or the object output byusm_ary.device.sycl_queuecan be eitherNone, or instance ofdpctl.SyclQueue. In the case whendevice=Noneandsycl_queue=None, array will be created on device selected by SYCL'sdefault_selector.usm_typecan beNone,"device","shared", or"host".usm_type=Noneis understood as keep theusm_typein case whenobjis an instance ofusm_ndarray, or has__sycl_usm_array_interface__, or useusm_type="device"otherwise.PokhodenkoSA commentedon Nov 21, 2021
@oleksandr-pavlyk
Thank you for the description.
I will integrate it in numba-dppy (IntelPython/numba-dpex#634).
It looks like a documentation. Is it a part of documentation already?