kokkos-utils
0.0.5
Toggle main menu visibility
Loading...
Searching...
No Matches
BeginEndTimerListener.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_UTILS_CALLBACKS_BEGINENDTIMERLISTENER_HPP
2
#define KOKKOS_UTILS_CALLBACKS_BEGINENDTIMERLISTENER_HPP
3
4
#include "
kokkos-utils/callbacks/ConjunctionMatcher.hpp
"
5
#include "
kokkos-utils/callbacks/EnqueuedEventTimer.hpp
"
6
#include "
kokkos-utils/callbacks/EnqueuedEventWithLaunchTimer.hpp
"
7
#include "
kokkos-utils/callbacks/EventBeginEndIdMatcher.hpp
"
8
#include "
kokkos-utils/callbacks/EventQueueMatcher.hpp
"
9
#include "
kokkos-utils/callbacks/TimerListener.hpp
"
10
11
namespace
Kokkos::utils::callbacks
12
{
13
22
template
<Matcher MatcherType, Event BeginEventType, Kokkos::ExecutionSpace Exec,
typename
TimerType = EnqueuedEventTimer<Exec>>
23
requires
MatcherFor<MatcherType, BeginEventType>
24
struct
BeginEndTimerListener
:
public
TimerListener
<EventBeginEndIdMatcher<BeginEventType, ConjunctionMatcher<EventQueueMatcher<Exec>, MatcherType>>, TimerType>
25
{
26
using
queue_matcher_t
=
EventQueueMatcher<Exec>
;
27
using
matcher_t
=
EventBeginEndIdMatcher<BeginEventType, ConjunctionMatcher<queue_matcher_t, MatcherType>
>;
28
using
timer_t
= TimerType;
29
using
base_t
=
TimerListener<matcher_t, timer_t>
;
30
31
template
<
typename
T>
32
BeginEndTimerListener
(T&& matcher_,
const
Exec& exec) :
base_t
{
33
matcher_t
{.
matcher
=
ConjunctionMatcher
{
queue_matcher_t
{.exec = exec}, MatcherType{std::forward<T>(matcher_)}}},
34
timer_t
{.exec = exec}
35
} {}
36
};
37
41
template
<MatcherFor<BeginParallelForEvent> MatcherType, Kokkos::ExecutionSpace Exec>
42
using
ParallelForTimerListener
=
BeginEndTimerListener<MatcherType, BeginParallelForEvent, Exec>
;
43
45
template
<MatcherFor<BeginParallelReduceEvent> MatcherType, Kokkos::ExecutionSpace Exec>
46
using
ParallelReduceTimerListener
=
BeginEndTimerListener<MatcherType, BeginParallelReduceEvent, Exec>
;
47
49
template
<MatcherFor<BeginParallelScanEvent> MatcherType, Kokkos::ExecutionSpace Exec>
50
using
ParallelScanTimerListener
=
BeginEndTimerListener<MatcherType, BeginParallelScanEvent, Exec>
;
51
53
template
<MatcherFor<BeginDeepCopyEvent> MatcherType, Kokkos::ExecutionSpace Exec>
54
using
DeepCopyTimerListener
=
BeginEndTimerListener<MatcherType, BeginDeepCopyEvent, Exec>
;
56
60
template
<MatcherFor<BeginParallelForEvent> MatcherType, Kokkos::ExecutionSpace Exec>
61
using
ParallelForWithLaunchTimerListener
=
BeginEndTimerListener<MatcherType, BeginParallelForEvent, Exec, EnqueuedEventWithLaunchTimer<Exec>
>;
62
64
template
<MatcherFor<BeginParallelReduceEvent> MatcherType, Kokkos::ExecutionSpace Exec>
65
using
ParallelWithLaunchReduceTimerListener
=
BeginEndTimerListener<MatcherType, BeginParallelReduceEvent, Exec, EnqueuedEventWithLaunchTimer<Exec>
>;
66
68
template
<MatcherFor<BeginParallelScanEvent> MatcherType, Kokkos::ExecutionSpace Exec>
69
using
ParallelWithLaunchScanTimerListener
=
BeginEndTimerListener<MatcherType, BeginParallelScanEvent, Exec, EnqueuedEventWithLaunchTimer<Exec>
>;
70
72
template
<MatcherFor<BeginDeepCopyEvent> MatcherType, Kokkos::ExecutionSpace Exec>
73
using
DeepCopyWithLaunchTimerListener
=
BeginEndTimerListener<MatcherType, BeginDeepCopyEvent, Exec, EnqueuedEventWithLaunchTimer<Exec>
>;
75
76
}
// namespace Kokkos::utils::callbacks
77
78
#endif
// KOKKOS_UTILS_CALLBACKS_BEGINENDTIMERLISTENER_HPP
ConjunctionMatcher.hpp
EnqueuedEventTimer.hpp
EnqueuedEventWithLaunchTimer.hpp
EventBeginEndIdMatcher.hpp
EventQueueMatcher.hpp
TimerListener.hpp
Kokkos::utils::callbacks::MatcherFor
Check that Callable is a matcher for each event in EventTypes.
Definition
Matcher.hpp:35
Kokkos::utils::callbacks
Definition
BeginEndTimerListener.hpp:12
Kokkos::utils::callbacks::ParallelForWithLaunchTimerListener
BeginEndTimerListener< MatcherType, BeginParallelForEvent, Exec, EnqueuedEventWithLaunchTimer< Exec > > ParallelForWithLaunchTimerListener
Definition
BeginEndTimerListener.hpp:61
Kokkos::utils::callbacks::ParallelReduceTimerListener
BeginEndTimerListener< MatcherType, BeginParallelReduceEvent, Exec > ParallelReduceTimerListener
Timer listener for timing the execution of a parallel reduce that matches MatcherType.
Definition
BeginEndTimerListener.hpp:46
Kokkos::utils::callbacks::ParallelWithLaunchScanTimerListener
BeginEndTimerListener< MatcherType, BeginParallelScanEvent, Exec, EnqueuedEventWithLaunchTimer< Exec > > ParallelWithLaunchScanTimerListener
Timer listener for timing the execution and the launch of a parallel scan that matches MatcherType.
Definition
BeginEndTimerListener.hpp:69
Kokkos::utils::callbacks::ParallelForTimerListener
BeginEndTimerListener< MatcherType, BeginParallelForEvent, Exec > ParallelForTimerListener
Definition
BeginEndTimerListener.hpp:42
Kokkos::utils::callbacks::ParallelScanTimerListener
BeginEndTimerListener< MatcherType, BeginParallelScanEvent, Exec > ParallelScanTimerListener
Timer listener for timing the execution of a parallel scan that matches MatcherType.
Definition
BeginEndTimerListener.hpp:50
Kokkos::utils::callbacks::ParallelWithLaunchReduceTimerListener
BeginEndTimerListener< MatcherType, BeginParallelReduceEvent, Exec, EnqueuedEventWithLaunchTimer< Exec > > ParallelWithLaunchReduceTimerListener
Timer listener for timing the execution and the launch of a parallel reduce that matches MatcherType.
Definition
BeginEndTimerListener.hpp:65
Kokkos::utils::callbacks::DeepCopyTimerListener
BeginEndTimerListener< MatcherType, BeginDeepCopyEvent, Exec > DeepCopyTimerListener
Timer listener for timing the execution of a deep copy that matches MatcherType.
Definition
BeginEndTimerListener.hpp:54
Kokkos::utils::callbacks::DeepCopyWithLaunchTimerListener
BeginEndTimerListener< MatcherType, BeginDeepCopyEvent, Exec, EnqueuedEventWithLaunchTimer< Exec > > DeepCopyWithLaunchTimerListener
Timer listener for timing the execution and the launch of a deep copy that matches MatcherType.
Definition
BeginEndTimerListener.hpp:73
Kokkos::utils::callbacks::BeginEndTimerListener
Timer listener that is well-suited for timing the execution of a parallel workload enqueued on a part...
Definition
BeginEndTimerListener.hpp:25
Kokkos::utils::callbacks::BeginEndTimerListener::base_t
TimerListener< matcher_t, timer_t > base_t
Definition
BeginEndTimerListener.hpp:29
Kokkos::utils::callbacks::BeginEndTimerListener::matcher_t
EventBeginEndIdMatcher< BeginEventType, ConjunctionMatcher< queue_matcher_t, MatcherType > > matcher_t
Definition
BeginEndTimerListener.hpp:27
Kokkos::utils::callbacks::BeginEndTimerListener::BeginEndTimerListener
BeginEndTimerListener(T &&matcher_, const Exec &exec)
Definition
BeginEndTimerListener.hpp:32
Kokkos::utils::callbacks::BeginEndTimerListener::queue_matcher_t
EventQueueMatcher< Exec > queue_matcher_t
Definition
BeginEndTimerListener.hpp:26
Kokkos::utils::callbacks::BeginEndTimerListener::timer_t
TimerType timer_t
Definition
BeginEndTimerListener.hpp:28
Kokkos::utils::callbacks::ConjunctionMatcher
Conjunction of matchers that is true only if all matchers agree.
Definition
ConjunctionMatcher.hpp:17
Kokkos::utils::callbacks::EventBeginEndIdMatcher
Match a begin event and its corresponding end event based on their event_id.
Definition
EventBeginEndIdMatcher.hpp:23
Kokkos::utils::callbacks::EventQueueMatcher
Match an event whose dev_id is the same as the one of exec.
Definition
EventQueueMatcher.hpp:12
Kokkos::utils::callbacks::TimerListener
Listener that starts a timer when a begin event is received and stops it when a corresponding end eve...
Definition
TimerListener.hpp:46
Kokkos::utils::callbacks::TimerListener::matcher
BeginEndMatcherType matcher
Definition
TimerListener.hpp:89
include
kokkos-utils
callbacks
BeginEndTimerListener.hpp
Generated on
for kokkos-utils by
1.18.0