ComPPare 1.0.0
Loading...
Searching...
No Matches
comppare::config Class Reference

Configuration singleton for the ComPPare library. More...

#include <config.hpp>

Public Types

using clock_t = std::chrono::steady_clock
 Type alias for the clock used in timing operations.
 
using time_point_t = std::chrono::time_point< clock_t >
 Type alias for the time point used in timing operations.
 

Public Member Functions

 config (const config &)=delete
 Deleted copy constructor.
 
 config (config &&)=delete
 Deleted move constructor.
 
configoperator= (const config &)=delete
 Deleted copy assignment operator.
 
configoperator= (config &&)=delete
 Deleted move assignment operator.
 

Static Public Member Functions

static uint64_t warmup_iters ()
 Get the number of warmup iterations.
 
static void set_warmup_iters (uint64_t v)
 Set the number of warmup iterations.
 
static uint64_t bench_iters ()
 Get the number of benchmark iterations.
 
static void set_bench_iters (uint64_t v)
 Set the number of benchmark iterations.
 
static void reset_roi_us ()
 Reset the ROI time to zero.
 
static void set_roi_us (const time_point_t &start, const time_point_t &end)
 Set the roi us value using time points.
 
static void set_roi_us (const float start, const float end)
 Set the roi us value using float.
 
static void set_roi_us (const double start, const double end)
 Set the roi us value using double.
 
template<typename Rep , typename Period >
static void set_roi_us (std::chrono::duration< Rep, Period > v)
 Set the roi us value using a std::chrono::duration.
 
static void set_roi_us (const double v)
 Set the roi us value using double.
 
static void set_roi_us (const float v)
 Set the roi us value using float.
 
template<typename Rep , typename Period >
static void increment_roi_us (std::chrono::duration< Rep, Period > v)
 Increment the roi us value using time points.
 
static void increment_roi_us (const double v)
 Increment the roi us value using double.
 
static void increment_roi_us (const float v)
 Increment the roi us value using float.
 
static void set_warmup_us (const time_point_t &start, const time_point_t &end)
 Set the warmup us value using time points.
 
static void set_warmup_us (const float start, const float end)
 Set the warmup us value using float.
 
static void set_warmup_us (const double start, const double end)
 Set the warmup us value using double.
 
template<typename Rep , typename Period >
static void set_warmup_us (std::chrono::duration< Rep, Period > v)
 Set the warmup us value using a std::chrono::duration.
 
static void set_warmup_us (const double v)
 Set the warmup us value using double.
 
static void set_warmup_us (const float v)
 Set the warmup us value using float.
 
static double get_roi_us ()
 Get the current roi us value.
 
static double get_warmup_us ()
 Get the current warmup us value.
 
template<std::floating_point T = double>
static T & fp_tolerance ()
 Get the floating-point tolerance for a specific floating-point type.
 
template<std::floating_point T = double>
static void set_fp_tolerance (T v)
 Set the floating-point tolerance for a specific floating-point type.
 
static void set_all_fp_tolerance (long double v)
 Set the floating-point tolerance for all supported types.
 

Private Member Functions

 config ()=default
 Construct a new config object.
 

Static Private Member Functions

static configinstance ()
 Get the singleton instance of the config class.
 

Private Attributes

double roi_ {0.0}
 The current roi us value.
 
double warmup_ {0.0}
 The current warmup us value.
 
uint64_t warmup_iters_ {100}
 The number of warmup iterations.
 
uint64_t bench_iters_ {100}
 The number of benchmark iterations.
 

Detailed Description

Configuration singleton for the ComPPare library.

Note
Singleton is chosen as this is a header only library, using global variables will require user to declare them in a .cpp file.

Member Typedef Documentation

◆ clock_t

using comppare::config::clock_t = std::chrono::steady_clock

Type alias for the clock used in timing operations.

◆ time_point_t

using comppare::config::time_point_t = std::chrono::time_point<clock_t>

Type alias for the time point used in timing operations.

Constructor & Destructor Documentation

◆ config() [1/3]

comppare::config::config ( const config )
delete

Deleted copy constructor.

◆ config() [2/3]

comppare::config::config ( config &&  )
delete

Deleted move constructor.

◆ config() [3/3]

comppare::config::config ( )
privatedefault

Construct a new config object.

Note
This constructor is private to enforce the singleton pattern.

Member Function Documentation

◆ bench_iters()

static uint64_t comppare::config::bench_iters ( )
inlinestatic

Get the number of benchmark iterations.

◆ fp_tolerance()

template<std::floating_point T = double>
static T & comppare::config::fp_tolerance ( )
inlinestatic

Get the floating-point tolerance for a specific floating-point type.

Template Parameters
T
Returns
T&

◆ get_roi_us()

static double comppare::config::get_roi_us ( )
inlinestatic

Get the current roi us value.

◆ get_warmup_us()

static double comppare::config::get_warmup_us ( )
inlinestatic

Get the current warmup us value.

◆ increment_roi_us() [1/3]

static void comppare::config::increment_roi_us ( const double  v)
inlinestatic

Increment the roi us value using double.

◆ increment_roi_us() [2/3]

static void comppare::config::increment_roi_us ( const float  v)
inlinestatic

Increment the roi us value using float.

◆ increment_roi_us() [3/3]

template<typename Rep , typename Period >
static void comppare::config::increment_roi_us ( std::chrono::duration< Rep, Period >  v)
inlinestatic

Increment the roi us value using time points.

Parameters
start
end

◆ instance()

static config & comppare::config::instance ( )
inlinestaticprivate

Get the singleton instance of the config class.

◆ operator=() [1/2]

config & comppare::config::operator= ( config &&  )
delete

Deleted move assignment operator.

◆ operator=() [2/2]

config & comppare::config::operator= ( const config )
delete

Deleted copy assignment operator.

◆ reset_roi_us()

static void comppare::config::reset_roi_us ( )
inlinestatic

Reset the ROI time to zero.

◆ set_all_fp_tolerance()

static void comppare::config::set_all_fp_tolerance ( long double  v)
inlinestatic

Set the floating-point tolerance for all supported types.

Parameters
vThe tolerance value to set for all floating-point types.

◆ set_bench_iters()

static void comppare::config::set_bench_iters ( uint64_t  v)
inlinestatic

Set the number of benchmark iterations.

◆ set_fp_tolerance()

template<std::floating_point T = double>
static void comppare::config::set_fp_tolerance ( v)
inlinestatic

Set the floating-point tolerance for a specific floating-point type.

Template Parameters
T
Parameters
vThe tolerance value to set.

◆ set_roi_us() [1/6]

static void comppare::config::set_roi_us ( const double  start,
const double  end 
)
inlinestatic

Set the roi us value using double.

◆ set_roi_us() [2/6]

static void comppare::config::set_roi_us ( const double  v)
inlinestatic

Set the roi us value using double.

◆ set_roi_us() [3/6]

static void comppare::config::set_roi_us ( const float  start,
const float  end 
)
inlinestatic

Set the roi us value using float.

◆ set_roi_us() [4/6]

static void comppare::config::set_roi_us ( const float  v)
inlinestatic

Set the roi us value using float.

◆ set_roi_us() [5/6]

static void comppare::config::set_roi_us ( const time_point_t start,
const time_point_t end 
)
inlinestatic

Set the roi us value using time points.

Parameters
start
end

◆ set_roi_us() [6/6]

template<typename Rep , typename Period >
static void comppare::config::set_roi_us ( std::chrono::duration< Rep, Period >  v)
inlinestatic

Set the roi us value using a std::chrono::duration.

Template Parameters
Rep
Period
Parameters
v

◆ set_warmup_iters()

static void comppare::config::set_warmup_iters ( uint64_t  v)
inlinestatic

Set the number of warmup iterations.

◆ set_warmup_us() [1/6]

static void comppare::config::set_warmup_us ( const double  start,
const double  end 
)
inlinestatic

Set the warmup us value using double.

Parameters
start
end

◆ set_warmup_us() [2/6]

static void comppare::config::set_warmup_us ( const double  v)
inlinestatic

Set the warmup us value using double.

◆ set_warmup_us() [3/6]

static void comppare::config::set_warmup_us ( const float  start,
const float  end 
)
inlinestatic

Set the warmup us value using float.

Parameters
start
end

◆ set_warmup_us() [4/6]

static void comppare::config::set_warmup_us ( const float  v)
inlinestatic

Set the warmup us value using float.

◆ set_warmup_us() [5/6]

static void comppare::config::set_warmup_us ( const time_point_t start,
const time_point_t end 
)
inlinestatic

Set the warmup us value using time points.

Parameters
start
end

◆ set_warmup_us() [6/6]

template<typename Rep , typename Period >
static void comppare::config::set_warmup_us ( std::chrono::duration< Rep, Period >  v)
inlinestatic

Set the warmup us value using a std::chrono::duration.

Template Parameters
Rep
Period
Parameters
v

◆ warmup_iters()

static uint64_t comppare::config::warmup_iters ( )
inlinestatic

Get the number of warmup iterations.

Member Data Documentation

◆ bench_iters_

uint64_t comppare::config::bench_iters_ {100}
private

The number of benchmark iterations.

◆ roi_

double comppare::config::roi_ {0.0}
private

The current roi us value.

◆ warmup_

double comppare::config::warmup_ {0.0}
private

The current warmup us value.

◆ warmup_iters_

uint64_t comppare::config::warmup_iters_ {100}
private

The number of warmup iterations.


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