1#ifndef KOKKOS_UTILS_TIMER_TIMER_HPP
2#define KOKKOS_UTILS_TIMER_TIMER_HPP
16requires Kokkos::utils::concepts::ExecutionSpace<T> || std::is_void_v<T>
32 template <
typename Duration = milliseconds>
36 template <
typename U = T>
37 requires std::is_void_v<U>
40 if(!
tick.has_value())
tick.emplace();
44 template <
typename Exec = T>
48 if(!
tick.has_value())
tick.emplace();
53 template <
typename U = T>
54 requires std::is_void_v<U>
57 if(!
tock.has_value())
tock.emplace();
61 template <
typename Exec = T>
63 void stop(
const Exec& exec)
65 if(!
tock.has_value())
tock.emplace();
70 std::optional<event_t>
tick = std::nullopt,
tock = std::nullopt;
Measure elapsed time between events.
void stop()
Stop the timer.
bool is_valid() const
Returns true if start and stop have been called.
void start(const Exec &exec)
std::optional< event_t > tick
void start()
Start the timer.
std::optional< event_t > tock
void stop(const Exec &exec)
Specify that a type is a Kokkos execution space.