kokkos-utils 0.0.1
 
Loading...
Searching...
No Matches
Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType > Struct Template Reference

Time a sequence of push/pop regions. More...

#include <SequenceOfRegionTimerListener.hpp>

Public Types

using region_timer_t = RegionTimerListener<MatcherType>
 
using matcher_t = typename region_timer_t::matcher_t
 
using timer_t = typename region_timer_t::timer_t
 

Public Member Functions

template<typename... Ms>
 SequenceOfRegionTimerListener (Ms &&... matchers_)
 
void reset ()
 
bool all_matched () const
 Returns true if all regions were correctly matched and timed.
 
void operator() (const PushRegionEvent &event)
 Deal with a Kokkos::utils::callbacks::PushRegionEvent event. Only the current timer is auditioned.
 
void operator() (const PopRegionEvent &event)
 Deal with a Kokkos::utils::callbacks::PopRegionEvent event. If the current timer matches, current is incremented.
 

Public Attributes

std::vector< matcher_tmatchers
 
std::vector< timer_ttimers
 

Private Attributes

size_t current = 0
 

Detailed Description

template<Matcher MatcherType>
struct Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >

Time a sequence of push/pop regions.

The regions of interest must not be interleaved.

Note
Overhead should be as low as possible. This is done by storing the matchers in a list and looking only at the current one. Already-matched and next matchers will not be called.

Definition at line 18 of file SequenceOfRegionTimerListener.hpp.

Member Typedef Documentation

◆ matcher_t

template<Matcher MatcherType>
using Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::matcher_t = typename region_timer_t::matcher_t

Definition at line 22 of file SequenceOfRegionTimerListener.hpp.

◆ region_timer_t

template<Matcher MatcherType>
using Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::region_timer_t = RegionTimerListener<MatcherType>

Definition at line 21 of file SequenceOfRegionTimerListener.hpp.

◆ timer_t

template<Matcher MatcherType>
using Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::timer_t = typename region_timer_t::timer_t

Definition at line 23 of file SequenceOfRegionTimerListener.hpp.

Constructor & Destructor Documentation

◆ SequenceOfRegionTimerListener()

template<Matcher MatcherType>
template<typename... Ms>
Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::SequenceOfRegionTimerListener ( Ms &&... matchers_)
inlineexplicit

Definition at line 26 of file SequenceOfRegionTimerListener.hpp.

Member Function Documentation

◆ all_matched()

template<Matcher MatcherType>
bool Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::all_matched ( ) const
inline

Returns true if all regions were correctly matched and timed.

Definition at line 34 of file SequenceOfRegionTimerListener.hpp.

◆ operator()() [1/2]

template<Matcher MatcherType>
void Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::operator() ( const PopRegionEvent & event)
inline

Deal with a Kokkos::utils::callbacks::PopRegionEvent event. If the current timer matches, current is incremented.

Definition at line 50 of file SequenceOfRegionTimerListener.hpp.

◆ operator()() [2/2]

template<Matcher MatcherType>
void Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::operator() ( const PushRegionEvent & event)
inline

Deal with a Kokkos::utils::callbacks::PushRegionEvent event. Only the current timer is auditioned.

Definition at line 39 of file SequenceOfRegionTimerListener.hpp.

◆ reset()

template<Matcher MatcherType>
void Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::reset ( )
inline

Definition at line 31 of file SequenceOfRegionTimerListener.hpp.

Member Data Documentation

◆ current

template<Matcher MatcherType>
size_t Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::current = 0
private

Definition at line 68 of file SequenceOfRegionTimerListener.hpp.

◆ matchers

template<Matcher MatcherType>
std::vector<matcher_t> Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::matchers

Definition at line 64 of file SequenceOfRegionTimerListener.hpp.

◆ timers

template<Matcher MatcherType>
std::vector<timer_t> Kokkos::utils::callbacks::SequenceOfRegionTimerListener< MatcherType >::timers

Definition at line 65 of file SequenceOfRegionTimerListener.hpp.


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