Loading...
Searching...
No Matches
gpr::ScopedPredictTimer Class Reference

#include <gpr/ml/PhaseTimers.h>

Public Member Functions

 ScopedPredictTimer () noexcept
 ~ScopedPredictTimer ()
 ScopedPredictTimer (const ScopedPredictTimer &)=delete
ScopedPredictTimer & operator= (const ScopedPredictTimer &)=delete

Detailed Description

Times one surrogate prediction into predict_seconds and predict_count. The model's dispatchers and the drivers that wrap them both open one; only the outermost scope counts.

Definition at line 763 of file PhaseTimers.h.

Constructor & Destructor Documentation

◆ ScopedPredictTimer() [1/2]

gpr::ScopedPredictTimer::ScopedPredictTimer ( )
inlinenoexcept

Definition at line 765 of file PhaseTimers.h.

766 : outermost_(depth_++ == 0), start_(std::chrono::steady_clock::now())
767 {
768 if (outermost_) ++PhaseTimers::predict_count;
769 }
static int predict_count

◆ ~ScopedPredictTimer()

gpr::ScopedPredictTimer::~ScopedPredictTimer ( )
inline

Definition at line 770 of file PhaseTimers.h.

771 {
772 --depth_;
773 if (outermost_)
775 std::chrono::duration<double>(std::chrono::steady_clock::now() -
776 start_)
777 .count();
778 }
static double predict_seconds

◆ ScopedPredictTimer() [2/2]

gpr::ScopedPredictTimer::ScopedPredictTimer ( const ScopedPredictTimer & )
delete

Member Function Documentation

◆ operator=()

ScopedPredictTimer & gpr::ScopedPredictTimer::operator= ( const ScopedPredictTimer & )
delete

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