event_ref#
-
class event_ref#
An non-owning wrapper for an untimed
cudaEvent_t.Subclassed by event
Public Types
-
using value_type = ::cudaEvent_t#
Public Functions
-
inline constexpr event_ref(::cudaEvent_t __evnt) noexcept#
Construct a new
event_refobject from acudaEvent_tThis constructor provides an implicit conversion from
cudaEvent_tNote
: It is the callers responsibility to ensure the
event_refdoes not outlive the event denoted by thecudaEvent_thandle.- Post:
get() == __evnt
-
event_ref(int) = delete#
Disallow construction from an
int, e.g.,0.
-
event_ref(::cuda::std::nullptr_t) = delete#
Disallow construction from
nullptr.
-
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
Friends
- inline friend constexpr bool operator==( ) noexcept#
Compares two
event_refs for equality.Note
Allows comparison with
cudaEvent_tdue to implicit conversion toevent_ref.
-
using value_type = ::cudaEvent_t#