Skip to content

Commit 881648c

Browse files
committed
add doc
1 parent c6a9b73 commit 881648c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/source/user/cuda_ffi.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@ CUDA C/C++ source code will be compiled with the `NVIDIA Runtime Compiler
160160
kernel as either PTX or LTOIR, depending on whether LTO is enabled. Other files
161161
will be passed directly to the CUDA Linker.
162162

163+
For cumodules linked to a linkable code object, additional setup
164+
and teardown callbacks are available. Setup functions are invoked once for
165+
every new module loaded. Teardown functions are invoked before the module is
166+
garbage collected by python. These callbacks are defined as follows:
167+
168+
.. code::
169+
170+
def setup_callback(
171+
mod: cuda.driver.CtypeModule, stream: cuda.driver.Stream
172+
)
173+
174+
The `stream` argument is the same stream user passes in to launch the kernel.
175+
163176
:class:`LinkableCode <numba.cuda.LinkableCode>` objects are initialized using
164177
the parameters of their base class:
165178

0 commit comments

Comments
 (0)