kokkos-utils 0.0.1
 
Loading...
Searching...
No Matches
Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType > Struct Template Reference

Listener that starts a timer when a begin event is received and stops it when a corresponding end event is received. More...

#include <TimerListener.hpp>

Inheritance diagram for Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >:
Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginParallelForEvent, Exec > Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginParallelReduceEvent, Exec > Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginParallelScanEvent, Exec > Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginDeepCopyEvent, Exec > Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginParallelForEvent, Exec, EnqueuedEventWithLaunchTimer< Exec > > Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginParallelReduceEvent, Exec, EnqueuedEventWithLaunchTimer< Exec > > Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginParallelScanEvent, Exec, EnqueuedEventWithLaunchTimer< Exec > > Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginDeepCopyEvent, Exec, EnqueuedEventWithLaunchTimer< Exec > > Kokkos::utils::callbacks::RegionTimerListener< EventRegexMatcher > Kokkos::utils::callbacks::BeginEndTimerListener< MatcherType, BeginEventType, Exec, TimerType > Kokkos::utils::callbacks::RegionTimerListener< MatcherType, TimerType >

Public Member Functions

template<Event EventType>
requires MatcherFor<BeginEndMatcherType, EventType>
void operator() (const EventType &event)
 
bool connected () const
 When the listener has matched the begin, but not yet the end event, it is said to be "connected".
 
bool closed () const
 When the listener has matched both the begin and end events, it is said to be "closed".
 
void reset ()
 Reset the listener so that it can be reused to match a begin event again.
 

Public Attributes

BeginEndMatcherType matcher {}
 
TimerType timer {}
 
bool matched_begin = false
 
bool matched_end = false
 

Detailed Description

template<Matcher BeginEndMatcherType, typename TimerType>
struct Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >

Listener that starts a timer when a begin event is received and stops it when a corresponding end event is received.

The begin event is selected by requiring it to be a match for BeginEndMatcherType while no begin event has been matched before. The end event is selected by requiring it to be a match for BeginEndMatcherType after a begin event has been matched.

The listener can be reset by using the member function reset. After calling reset, a new begin event can be matched.

Definition at line 45 of file TimerListener.hpp.

Member Function Documentation

◆ closed()

template<Matcher BeginEndMatcherType, typename TimerType>
bool Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >::closed ( ) const
inline

When the listener has matched both the begin and end events, it is said to be "closed".

Definition at line 82 of file TimerListener.hpp.

◆ connected()

template<Matcher BeginEndMatcherType, typename TimerType>
bool Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >::connected ( ) const
inline

When the listener has matched the begin, but not yet the end event, it is said to be "connected".

Definition at line 79 of file TimerListener.hpp.

◆ operator()()

template<Matcher BeginEndMatcherType, typename TimerType>
template<Event EventType>
requires MatcherFor<BeginEndMatcherType, EventType>
void Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >::operator() ( const EventType & event)
inline

Start when the event matches while no begin event has been matched before.

Stop when the event matches after a begin event has been matched.

Definition at line 48 of file TimerListener.hpp.

◆ reset()

template<Matcher BeginEndMatcherType, typename TimerType>
void Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >::reset ( )
inline

Reset the listener so that it can be reused to match a begin event again.

Definition at line 85 of file TimerListener.hpp.

Member Data Documentation

◆ matched_begin

template<Matcher BeginEndMatcherType, typename TimerType>
bool Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >::matched_begin = false

Definition at line 91 of file TimerListener.hpp.

◆ matched_end

template<Matcher BeginEndMatcherType, typename TimerType>
bool Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >::matched_end = false

Definition at line 92 of file TimerListener.hpp.

◆ matcher

template<Matcher BeginEndMatcherType, typename TimerType>
BeginEndMatcherType Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >::matcher {}

Definition at line 89 of file TimerListener.hpp.

◆ timer

template<Matcher BeginEndMatcherType, typename TimerType>
TimerType Kokkos::utils::callbacks::TimerListener< BeginEndMatcherType, TimerType >::timer {}

Definition at line 90 of file TimerListener.hpp.


The documentation for this struct was generated from the following file: