TensorPlay

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

On this page

Stream

class tensorplay.cuda.streams.Stream(device=None, priority=0, **kwargs)[source]

Wrapper around a CUDA stream.

A CUDA stream is a linear sequence of execution that belongs to a specific device, independent from other streams. It supports with statement as a context manager to ensure the operators within the with block are running on the corresponding stream. See the CUDA semantics documentation for details.

Parameters:
  • device (tensorplay.Device or int, optional) – a device on which to allocate the stream. If device is None (default) or a negative integer, this will use the current device.

  • priority (int, optional) – priority of the stream, which can be positive, 0, or negative. A lower number indicates a higher priority. By default, the priority is set to 0.

query() bool[source]

Check if all the work submitted has been completed.

record_event(event: Event | None = None)[source]

Record an event.

Parameters:

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

Returns:

Recorded event.

synchronize() None[source]

Wait for all the kernels in this stream to complete.

wait_event(event: Event | tensorplay.Event) None[source]

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

wait_stream(stream: Stream) None[source]

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