kokkos-utils
0.0.1
Loading...
Searching...
No Matches
EnqueuedEventTimer.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_UTILS_CALLBACKS_ENQUEUEDEVENTTIMER_HPP
2
#define KOKKOS_UTILS_CALLBACKS_ENQUEUEDEVENTTIMER_HPP
3
4
#include "
kokkos-utils/callbacks/Events.hpp
"
5
#include "
kokkos-utils/concepts/ExecutionSpace.hpp
"
6
#include "
kokkos-utils/timer/Duration.hpp
"
7
#include "
kokkos-utils/timer/Timer.hpp
"
8
9
namespace
Kokkos::utils::callbacks
10
{
11
13
template
<Kokkos::utils::concepts::ExecutionSpace Exec>
14
struct
EnqueuedEventTimer
15
{
17
template
<EnqueuedEvent EventType>
18
void
start
(
const
EventType& event)
19
{
20
if
(event.dev_id !=
dev_id
)
21
Kokkos::abort(
"EnqueuedEventTimer cannot be started for a wrongly enqueued event."
);
22
23
timer
.start(
exec
);
24
}
25
27
template
<Event EventType>
28
void
stop
(
const
EventType&) {
29
timer
.stop(
exec
);
30
}
31
32
template
<
typename
Duration = Kokkos::utils::timer::milliseconds>
33
Duration
duration
() {
return
timer
.template
duration<Duration>
(); }
34
35
Exec
exec
;
36
uint32_t
dev_id
= Kokkos::Tools::Experimental::device_id(
exec
);
37
Kokkos::utils::timer::Timer<Exec>
timer
{};
38
};
39
40
}
// namespace Kokkos::utils::callbacks
41
42
#endif
// KOKKOS_UTILS_CALLBACKS_ENQUEUEDEVENTTIMER_HPP
Duration.hpp
Events.hpp
Timer.hpp
Kokkos::utils::timer::Timer
Measure elapsed time between events.
Definition
Timer.hpp:18
ExecutionSpace.hpp
Kokkos::utils::callbacks
Definition
BeginEndTimerListener.hpp:12
Kokkos::utils::callbacks::EnqueuedEventTimer
Timer for events that are enqueued on exec.
Definition
EnqueuedEventTimer.hpp:15
Kokkos::utils::callbacks::EnqueuedEventTimer::duration
Duration duration()
Definition
EnqueuedEventTimer.hpp:33
Kokkos::utils::callbacks::EnqueuedEventTimer::exec
Exec exec
Definition
EnqueuedEventTimer.hpp:35
Kokkos::utils::callbacks::EnqueuedEventTimer::stop
void stop(const EventType &)
Stop the timer.
Definition
EnqueuedEventTimer.hpp:28
Kokkos::utils::callbacks::EnqueuedEventTimer::start
void start(const EventType &event)
Start the timer. The event must be on exec.
Definition
EnqueuedEventTimer.hpp:18
Kokkos::utils::callbacks::EnqueuedEventTimer::timer
Kokkos::utils::timer::Timer< Exec > timer
Definition
EnqueuedEventTimer.hpp:37
Kokkos::utils::callbacks::EnqueuedEventTimer::dev_id
uint32_t dev_id
Definition
EnqueuedEventTimer.hpp:36
include
kokkos-utils
callbacks
EnqueuedEventTimer.hpp
Generated on Wed Sep 10 2025 05:44:08 for kokkos-utils by
1.13.2