event#
-
class event : public event_ref#
An owning wrapper for an untimed
cudaEvent_t.Subclassed by timed_event
Public Types
-
using value_type = ::cudaEvent_t#
Public Functions
- inline explicit event(
- stream_ref __stream,
- event_flags __flags = event_flags::none,
Construct a new
eventobject with timing disabled, and record the event in the specified stream.- Throws:
cuda_error – if the event creation fails.
- inline explicit event(
- device_ref __device,
- event_flags __flags = event_flags::none,
Construct a new
eventobject with timing disabled.The event can only be recorded on streams from the specified device.
- Throws:
cuda_error – if the event creation fails.
-
inline explicit constexpr event(no_init_t) noexcept#
Construct a new
eventobject into the moved-from state.- Post:
get()returnscudaEvent_t().
-
inline constexpr event(event &&__other) noexcept#
Move-construct a new
eventobject.- Parameters:
__other –
- Post:
__otheris in a moved-from state.
-
inline ~event()#
Destroy the
eventobject.Note
If the event fails to be destroyed, the error is silently ignored.
-
inline event &operator=(event &&__other) noexcept#
Move-assign an
eventobject.- Parameters:
__other –
- Post:
__otheris in a moved-from state.
-
inline constexpr ::cudaEvent_t release() noexcept#
Retrieve the native
cudaEvent_thandle and give up ownership.- Returns:
cudaEvent_t The native handle being held by the
eventobject.- Post:
The event object is in a moved-from state.
-
inline void record(stream_ref __stream) const#
Records an event on the specified stream.
- Parameters:
__stream –
- Throws:
cuda_error – if the event record fails
-
inline void sync() const#
Synchronizes the event.
- Throws:
cuda_error – if waiting for the event fails
-
inline bool is_done() const#
Checks if all the work in the stream prior to the record of the event has completed.
If is_done returns true, calling sync() on this event will return immediately
- Throws:
cuda_error – if the event query fails
Public Static Functions
-
using value_type = ::cudaEvent_t#