diff --git a/dpctl/memory/_memory.pyx b/dpctl/memory/_memory.pyx index 3838651f08..6541a315f2 100644 --- a/dpctl/memory/_memory.pyx +++ b/dpctl/memory/_memory.pyx @@ -232,33 +232,62 @@ cdef class _Memory: buffer.suboffsets = NULL # for pointer arrays only property nbytes: + """ Extent of this USM buffer in bytes. """ def __get__(self): return self.nbytes property size: + """ Extent of this USM buffer in bytes. """ def __get__(self): return self.nbytes property _pointer: + """ + USM pointer at the start of this buffer + represented in Python integer. + """ def __get__(self): return (self.memory_ptr) property _context: + """ :class:`dpctl.SyclContext` the USM pointer is bound to. """ def __get__(self): return self.queue.get_sycl_context() property _queue: + """ + :class:`dpctl.SyclQueue` with :class:`dpctl.SyclContext` the + USM pointer is bound to and :class:`dpctl.SyclDevice` it was + allocated on. + """ def __get__(self): return self.queue property reference_obj: + """ + Reference to the Python object owning this USM buffer. + """ def __get__(self): return self.refobj + property sycl_context: + """ :class:`dpctl.SyclContext` the USM pointer is bound to. """ + def __get__(self): + return self.queue.get_sycl_context() + + property sycl_device: + """ :class:`dpctl.SyclDevice` the USM pointer is bound to. """ + def __get__(self): + return self.queue.get_sycl_device() + def __repr__(self): return ( - "" - .format(self.nbytes, hex((self.memory_ptr))) + "" + .format( + self.get_usm_type(), + self.nbytes, + hex((self.memory_ptr)) + ) ) def __len__(self):