kokkos-utils 0.0.1
 
Loading...
Searching...
No Matches
RegionTimerListener.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_UTILS_CALLBACKS_REGIONTIMERLISTENER_HPP
2#define KOKKOS_UTILS_CALLBACKS_REGIONTIMERLISTENER_HPP
3
8
10{
11
24template <MatcherFor<PushRegionEvent> MatcherType, typename TimerType = Kokkos::utils::timer::Timer<void>>
25struct RegionTimerListener : public TimerListener<EventTypeMatcher<EventRegionMatcher<MatcherType, true>, PushRegionEvent, PopRegionEvent>, TimerType>
26{
29 using timer_t = TimerType;
31
32 template <typename T, typename U = TimerType>
33 RegionTimerListener(T&& matcher_, U&& timer_ = TimerType{}) : base_t{
34 matcher_t{matcher_t{.matcher = {.matcher = {std::forward<T>(matcher_)}}}},
35 timer_t{std::forward<U>(timer_)}
36 } {}
37};
38
39} // namespace Kokkos::utils::callbacks
40
41#endif // KOKKOS_UTILS_CALLBACKS_REGIONTIMERLISTENER_HPP
Matcher to select events that occur within a region.
Restrict the event types that can be matched by matcher to the subset EventTypes.
RegionTimerListener(T &&matcher_, U &&timer_=TimerType{})
EventRegionMatcher< MatcherType, true > region_matcher_t
TimerListener< matcher_t, timer_t > base_t
EventTypeMatcher< region_matcher_t, PushRegionEvent, PopRegionEvent > matcher_t
Listener that starts a timer when a begin event is received and stops it when a corresponding end eve...