dpctl.memory.MemoryUSMDevice
- class dpctl.memory.MemoryUSMDevice(nbytes, alignment=0, queue=None, copy=False)
An object representing allocation of SYCL USM-device memory.
Non-positive
alignmentvalues are not ignored and the allocatormalloc_deviceis used for allocation instead. IfqueueisNonea cached default-constructeddpctl.SyclQueueis used to allocate memory.Attributes:
Extent of this USM buffer in bytes.
Reference to the Python object owning this USM buffer.
Extent of this USM buffer in bytes.
dpctl.SyclContextthe USM pointer is bound to.dpctl.SyclDevicethe USM pointer is bound to.dpctl.SyclQueuewithdpctl.SyclContextthe USM allocation is bound to anddpctl.SyclDeviceit was allocated on.Public methods:
copy_from_device(sycl_usm_ary)Copy SYCL memory underlying the argument object into the memory of the instance
copy_from_host(obj)Copy content of Python buffer provided by obj to instance memory.
copy_to_host([obj])Copy content of instance's memory into memory of
obj, or allocate NumPy array ofobjisNone.get_usm_type([syclobj])Returns the type of USM allocation using Sycl context carried by syclobj keyword argument.
get_usm_type_enum([syclobj])get_usm_type(syclobj=None)
memset([val])Populates this USM allocation with given value.
tobytes()Constructs bytes object populated with copy of USM memory.
Attributes
- MemoryUSMDevice._context
dpctl.SyclContextthe USM pointer is bound to.
- MemoryUSMDevice._pointer
USM pointer at the start of this buffer represented in Python integer.
- MemoryUSMDevice._queue
dpctl.SyclQueuewithdpctl.SyclContextthe USM allocation is bound to anddpctl.SyclDeviceit was allocated on.
- MemoryUSMDevice.nbytes
Extent of this USM buffer in bytes.
- MemoryUSMDevice.reference_obj
Reference to the Python object owning this USM buffer.
- MemoryUSMDevice.size
Extent of this USM buffer in bytes.
- MemoryUSMDevice.sycl_context
dpctl.SyclContextthe USM pointer is bound to.
- MemoryUSMDevice.sycl_device
dpctl.SyclDevicethe USM pointer is bound to.
- MemoryUSMDevice.sycl_queue
dpctl.SyclQueuewithdpctl.SyclContextthe USM allocation is bound to anddpctl.SyclDeviceit was allocated on.
Public methods
- dpctl.memory.MemoryUSMDevice.copy_from_device(self, sycl_usm_ary)
Copy SYCL memory underlying the argument object into the memory of the instance
- dpctl.memory.MemoryUSMDevice.copy_from_host(self, obj)
Copy content of Python buffer provided by obj to instance memory.
- dpctl.memory.MemoryUSMDevice.copy_to_host(self, obj=None)
Copy content of instance’s memory into memory of
obj, or allocate NumPy array ofobjisNone.
- dpctl.memory.MemoryUSMDevice.get_usm_type(syclobj=None)
Returns the type of USM allocation using Sycl context carried by syclobj keyword argument. Value of None is understood to query against self.sycl_context - the context used to create the allocation.
- dpctl.memory.MemoryUSMDevice.get_usm_type_enum(self, syclobj=None)
get_usm_type(syclobj=None)
Returns the type of USM allocation using Sycl context carried by syclobj keyword argument. Value of None is understood to query against self.sycl_context - the context used to create the allocation.
- dpctl.memory.MemoryUSMDevice.memset(self, val=0)
Populates this USM allocation with given value.
- dpctl.memory.MemoryUSMDevice.tobytes(self)
Constructs bytes object populated with copy of USM memory.