This class allows to use external streams in CuPy by providing the stream pointer obtained from the CUDA runtime call. The user is in charge of managing the life-cycle of the stream.
ptr (intptr_t) – Address of the cudaStream_t object.
ptr (intptr_t) – Raw stream handle. It can be passed to the CUDA Runtime API via ctypes.
add_callback(self, callback, arg)¶
Adds a callback that is called when all queued work is done.
callback (function) – Callback function. It must take three arguments (Stream object, int error status, and user data object), and returns nothing.
arg (object) – Argument to the callback.
Records an event on the stream.
The recorded event.
- Return type
Waits for the stream completing all queued work.
Makes this stream current.
If you want to switch a stream temporarily, use the with statement.
Makes the stream wait for an event.
The future work on this stream will be done after the event.
event (cupy.cuda.Event) – CUDA event.
True if all work on this stream has been done.