kokkos-utils 0.0.1
 
Loading...
Searching...
No Matches
Kokkos::utils::timer::Timer< T > Class Template Reference

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_ttick = std::nullopt
 
std::optional< event_ttock = std::nullopt
 

Detailed Description

template<typename T>
requires Kokkos::utils::concepts::ExecutionSpace<T> || std::is_void_v<T>
class Kokkos::utils::timer::Timer< T >

Measure elapsed time between events.

This class uses Event to create, destroy, record, and compute the elapsed time between events.

Definition at line 17 of file Timer.hpp.

Member Typedef Documentation

◆ event_t

template<typename T>
using Kokkos::utils::timer::Timer< T >::event_t = Event<T>

Definition at line 20 of file Timer.hpp.

Member Function Documentation

◆ duration()

template<typename T>
template<typename Duration = milliseconds>
Duration Kokkos::utils::timer::Timer< T >::duration ( )
inline

Get a std::chrono::duration object representing the elapsed time.

Note
This function is not const because it calls Event::duration, whose device specializations are not const.

Definition at line 33 of file Timer.hpp.

◆ is_valid()

template<typename T>
bool Kokkos::utils::timer::Timer< T >::is_valid ( ) const
inline

Returns true if start and stop have been called.

Definition at line 24 of file Timer.hpp.

◆ start() [1/2]

template<typename T>
template<typename U = T>
requires std::is_void_v<U>
void Kokkos::utils::timer::Timer< T >::start ( )
inline

Start the timer.

Definition at line 38 of file Timer.hpp.

◆ start() [2/2]

template<typename T>
template<typename Exec = T>
requires Kokkos::utils::concepts::ExecutionSpace<Exec>
void Kokkos::utils::timer::Timer< T >::start ( const Exec & exec)
inline

Definition at line 46 of file Timer.hpp.

◆ stop() [1/2]

template<typename T>
template<typename U = T>
requires std::is_void_v<U>
void Kokkos::utils::timer::Timer< T >::stop ( )
inline

Stop the timer.

Definition at line 55 of file Timer.hpp.

◆ stop() [2/2]

template<typename T>
template<typename Exec = T>
requires Kokkos::utils::concepts::ExecutionSpace<Exec>
void Kokkos::utils::timer::Timer< T >::stop ( const Exec & exec)
inline

Definition at line 63 of file Timer.hpp.

Member Data Documentation

◆ tick

template<typename T>
std::optional<event_t> Kokkos::utils::timer::Timer< T >::tick = std::nullopt
private

Definition at line 70 of file Timer.hpp.

◆ tock

template<typename T>
std::optional<event_t> Kokkos::utils::timer::Timer< T >::tock = std::nullopt
private

Definition at line 70 of file Timer.hpp.


The documentation for this class was generated from the following file: