dpctl.memory.MemoryUSMHost¶
- class dpctl.memory.MemoryUSMHost(nbytes, alignment=0, queue=None)¶
An object representing allocation of SYCL USM-host memory.
- Parameters:
nbytes (int) – number of bytes to allocated. Expected to be positive.
alignment (Optional[int]) – allocation alignment request. Non-positive
alignment
values are not ignored and the unaligned allocatorsycl::malloc_device
is used to make allocation instead. Default: 0.queue (Optional[
dpctl.SyclQueue
]) – SYCL queue associated with return allocation instance. Allocation is made in host memory accessible to all device in the SYCL context from the queue. Allocation is bound to SYCL context from the queue. Ifqueue
isNone
a cached default-constructeddpctl.SyclQueue
is used to allocate memory.
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 ofobj
isNone
.get_usm_type
([syclobj])Returns the type of USM allocation using
dpctl.SyclContext
carried bysyclobj
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
Extent of this USM buffer in bytes.
Reference to the Python object owning this USM buffer.
Extent of this USM buffer in bytes.
dpctl.SyclContext
the USM pointer is bound to.dpctl.SyclDevice
the USM pointer is bound to.dpctl.SyclQueue
withdpctl.SyclContext
the USM allocation is bound to anddpctl.SyclDevice
it was allocated on.Dictionary encoding information about USM allocation.