Measure elapsed time between events. More...
#include <Timer.hpp>
Public Types | |
using | event_t = Event<T> |
Public Member Functions | |
bool | is_valid () const |
Returns true if start and stop have been called. | |
template<typename Duration = milliseconds> | |
Duration | duration () |
template<typename U = T> requires std::is_void_v<U> | |
void | start () |
Start the timer. | |
template<typename Exec = T> requires Kokkos::utils::concepts::ExecutionSpace<Exec> | |
void | start (const Exec &exec) |
template<typename U = T> requires std::is_void_v<U> | |
void | stop () |
Stop the timer. | |
template<typename Exec = T> requires Kokkos::utils::concepts::ExecutionSpace<Exec> | |
void | stop (const Exec &exec) |
Private Attributes | |
std::optional< event_t > | tick = std::nullopt |
std::optional< event_t > | tock = std::nullopt |
Measure elapsed time between events.
This class uses Event to create, destroy, record, and compute the elapsed time between events.
using Kokkos::utils::timer::Timer< T >::event_t = Event<T> |
|
inline |
Get a std::chrono::duration
object representing the elapsed time.
const
because it calls Event::duration, whose device specializations are not const
.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |