cupy.cuda.Event

class cupy.cuda.Event

CUDA event, a synchronization point of CUDA streams.

This class handles the CUDA event handle in RAII way, i.e., when an Event instance is destroyed by the GC, its handle is also destroyed.

Parameters:
  • block (bool) – If True, the event blocks on the synchronize() method.
  • disable_timing (bool) – If True, the event does not prepare the timing data.
  • interprocess (bool) – If True, the event can be passed to other processes.
Variables:

ptr (size_t) – Raw stream handle. It can be passed to the CUDA Runtime API via ctypes.

Methods

Attributes

done

True if the event is done.

record

Records the event to a stream.

Parameters:stream (cupy.cuda.Stream) – CUDA stream to record event. The null stream is used by default.
synchronize

Synchronizes all device work to the event.

If the event is created as a blocking event, it also blocks the CPU thread until the event is done.