TensorPlay
API symbolscuda
Copy
View MarkdownDownload .md

Event

class tensorplay.cuda.streams.Event(enable_timing=False, blocking=False, interprocess=False, external=False)[source]

Wrapper around a CUDA event.

CUDA events are synchronization markers that can be used to monitor the device’s progress, to accurately measure timing, and to synchronize CUDA streams.

Parameters:
  • enable_timing (bool, optional) – indicates if the event should measure time (default: False)

  • blocking (bool, optional) – if True, wait() will be blocking (default: False)

  • interprocess (bool) – if True, the event can be shared between processes (default: False)

elapsed_time(end_event: Event)[source]

Return the time elapsed.

Time reported in milliseconds after the event was recorded and before the end_event was recorded.

Parameters:

end_event (Event) – the end event.

classmethod from_ipc_handle(device, handle)[source]

Reconstruct an event from an IPC handle on the given device.

ipc_handle()[source]

Return an IPC handle of this event.

query()[source]

Check if all work currently captured by event has completed.

record(stream: Stream | None = None)[source]

Record the event in a given stream.

Parameters:

stream (Stream, optional) – Uses tensorplay.cuda.current_stream() if no stream is specified.

synchronize() None[source]

Wait for the event to complete.

wait(stream: Stream | None = None) None[source]

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

Parameters:

stream (Stream, optional) – Uses tensorplay.cuda.current_stream() if no stream is specified.

Ask DeepWiki