TensorPlay

Latest development documentation · Updated 2026-09-08. A documentation snapshot for package 1.2.0.dev20261027 is not available.

On this page

ExternalStream

class tensorplay.cuda.streams.ExternalStream(stream_ptr, device=None, **kwargs)[source]

Wrapper around an externally allocated CUDA stream.

This class is used to wrap streams allocated in other libraries in order to facilitate data exchange and multi-library interactions.

Note

This class doesn’t manage the stream life-cycle, it is the user responsibility to keep the referenced stream alive while this class is being used.

Parameters:
  • stream_ptr (int) – Integer representation of the cudaStream_t value allocated externally.

  • device (tensorplay.Device or int, optional) – the device where the stream was originally allocated. If device is specified incorrectly, subsequent launches using this stream may fail.

query() → bool

Check if all the work submitted has been completed.

record_event(event: Event | None = None)

Record an event.

Parameters:

event (Event, optional) – event to record. If not given, a new one will be allocated.

Returns:

Recorded event.

synchronize() → None

Wait for all the kernels in this stream to complete.

wait_event(event: Event | tensorplay.Event) → None

Make all future work submitted to the stream wait for an event.

wait_stream(stream: Stream) → None

Synchronize with another stream.

Search documentation

Search all 1,743 documentation pages.

Keyboard shortcuts

Global

  • /Focus search
  • ?This dialog
  • ,Open settings
  • ⌘jAI assistant

Search

  • ↑↓Navigate results
  • ↵Open result
  • escClose

Package

  • mMain information
  • dDocs
  • .Code
  • -Changelog
  • tTimeline
  • sStats
  • vVersions