NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
nimble::ProfilingTimer Class Reference

#include <nimble_profiling_timer.h>

Public Member Functions

 ProfilingTimer ()
 
 ~ProfilingTimer ()=default
 
void push_region (const std::string &profiling_region_name)
 
double pop_region_and_report_time ()
 

Constructor & Destructor Documentation

◆ ProfilingTimer()

nimble::ProfilingTimer::ProfilingTimer ( )
inline
63 {
64#ifndef NIMBLE_HAVE_KOKKOS
65 n_timer_ = std::unique_ptr<nimble::Timer>(new nimble::Timer());
66#endif
67 }

◆ ~ProfilingTimer()

nimble::ProfilingTimer::~ProfilingTimer ( )
default

Member Function Documentation

◆ pop_region_and_report_time()

double nimble::ProfilingTimer::pop_region_and_report_time ( )
inline
85 {
86 double t = 0.0;
87#ifdef NIMBLE_HAVE_KOKKOS
88 t = k_timer_.seconds();
89 Kokkos::Profiling::popRegion();
90#else
91 t = n_timer_->StopReport(current_region_.top());
92#endif
93 current_region_.pop();
94 return t;
95 }

◆ push_region()

void nimble::ProfilingTimer::push_region ( const std::string & profiling_region_name)
inline
73 {
74 current_region_.push(profiling_region_name);
75#ifdef NIMBLE_HAVE_KOKKOS
76 Kokkos::Profiling::pushRegion("NimbleSM: " + profiling_region_name);
77 k_timer_.reset();
78#else
79 n_timer_->Start(profiling_region_name);
80#endif
81 }

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