Skip to content

Commit 61f8c54

Browse files
Add docs for two new C-API functions added in this branch for 0.18
1 parent a4b510c commit 61f8c54

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/doc_sources/api_reference/dpctl_capi.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,16 @@ API for :c:struct:`Py_MemoryObject`
152152
:param nbytes: The size of allocation in bytes
153153
:param QRef: instance of :c:struct:`PySyclQueueRef` corresponding
154154
to ``sycl::queue`` to be associated with this allocation
155-
:param owner: Python object instance whose deleter triggers freeing of this USM allocation
155+
:param owner: Python object instance whose deleter triggers freeing of this USM allocation. Specify `owner=None`
156+
to pass ownership to created Python memory object, which will use ``sycl::free(ptr, sycl_queue)`` for
157+
deallocation.
158+
159+
.. c:function:: void * Memory_GetOpaquePointer(struct Py_MemoryObject *o)
160+
161+
:param o: Input ojbect
162+
:returns: Returns opaque pointer to `std::shared_ptr<void>` which manages the USM allocation,
163+
or a `nullptr` if this USM allocation represented by `o` is not managed by the smart
164+
pointer.
156165
157166
API for :c:struct:`PyUSMArrayObject`
158167
------------------------------------
@@ -221,6 +230,11 @@ API for :c:struct:`PyUSMArrayObject`
221230
:returns: Offset of zero multi-index array element from the beginning of
222231
the USM allocation.
223232
233+
.. c:function:: PyObject * UsmNDArray_GetUSMData(struct PyUSMArrayObject *arr)
234+
235+
:param arr: Input object
236+
:returns: Python memory object underlying input array `arr`.
237+
224238
.. c:function:: void UsmNDArray_SetWritableFlag(struct PyUSMArrayObject *arr, int flag)
225239
226240
:param arr: Input object

0 commit comments

Comments
 (0)