Event¶
- class paddle.device. Event ( device=None, enable_timing=False, blocking=False, interprocess=False ) [source]
-
A device event wrapper around StreamBase. :param device: Which device the stream runn on. If device is None, the device is the current device. Default: None.
It can be
gpu
,gpu:x
,``custom_device``,custom_device:x
, wherecustom_device
is the name of CustomDevicec, wherex
is the index of the GPUs, XPUs. And it can be paddle.CUDAPlace(n) or paddle.CustomPlace(n).- Parameters
-
enable_timing (bool, optional) – indicates if the event should measure time, default is False
blocking (bool, optional) – if True,
wait
will be blocking, default is Falseinterprocess (bool) – if True, the event can be shared between processes, default is False
- Returns
-
The event.
- Return type
-
Event
Examples
-
record
(
stream=None
)
record¶
-
Records the event in a given stream. :param stream: The given stream. By default, stream is None, :type stream: Stream, optional :param event will be recorded in current_stream.:
- Returns
-
None.
Examples
-
query
(
)
query¶
-
Checks if all work currently captured by event has completed. :returns: Whether all work currently captured by event has completed. :rtype: bool
Examples
-
elapsed_time
(
end_event
)
elapsed_time¶
-
Returns the time elapsed in milliseconds after the event was recorded and before the end_event was recorded. :returns: The time. :rtype: int
Examples