Skip to content

Commit 5a2d335

Browse files
committed
document SyclQueue_DeferRelease in the C-API reference
1 parent 815530a commit 5a2d335

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎docs/doc_sources/api_reference/dpctl_capi.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,25 @@ API for :c:struct:`PySyclQueueObject`
9797
Note that function does not change the ownership of the ``QRef`` instance and
9898
the caller remains responsible for freeing ``QRef`` as appropriate.
9999
100+
.. c:function:: int SyclQueue_DeferRelease(DPCTLSyclQueueRef QRef, DPCTLSyclEventRef *depERefs, size_t nDepERefs, void (*release)(void *), void *data, DPCTLSyclEventRef markerERef)
101+
102+
:param QRef: queue running the work that uses what ``release`` frees
103+
:param depERefs: array of events for that work
104+
:param nDepERefs: number of events in ``depERefs``
105+
:param release: function to call once the work has completed
106+
:param data: argument passed to ``release``
107+
:param markerERef: existing event the marker event is assigned to
108+
:returns: 0 on success, and 1 if nothing was deferred, in which case
109+
``release`` is never called.
110+
111+
Submits an empty kernel to ``QRef`` after ``depERefs``, assigns its event to
112+
the ``sycl::event`` behind ``markerERef``, and calls ``release(data)`` once
113+
that kernel has completed.
114+
115+
``release`` is called with the GIL held, on a thread owned by :py:mod:`dpctl`
116+
or on one draining the completed releases. Calling the function does not
117+
require the GIL.
118+
100119
API for :c:struct:`PySyclEventObject`
101120
-------------------------------------
102121

0 commit comments

Comments
 (0)