Copy
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
deviceisNone(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.
- 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.
Help improve this page
Found an error, an unclear step, or a missing example?
