dpctl.memory.as_usm_memory¶
- dpctl.memory.as_usm_memory(obj)¶
Converts Python object with
__sycl_usm_array_interface__
property to one ofMemoryUSMShared
,MemoryUSMDevice
, orMemoryUSMHost
instances depending on the type of USM allocation they represent.- Raises:
ValueError – When object does not expose the
__sycl_usm_array_interface__
, or it is malformedTypeError – When unexpected types of entries in the interface are encountered
SyclQueueCreationError – When a
dpctl.SyclQueue
could not be created from the information given by the interface