51 using clock_t = std::chrono::steady_clock;
97 template <
typename Rep,
typename Period>
98 static void set_roi_us(std::chrono::duration<Rep, Period> v)
100 double micros = std::chrono::duration<double, std::micro>(v).count();
114 template <
typename Rep,
typename Period>
117 double micros = std::chrono::duration<double, std::micro>(v).count();
151 template <
typename Rep,
typename Period>
154 double micros = std::chrono::duration<double, std::micro>(v).count();
173 template <std::
floating_po
int T =
double>
176 static T tol = std::numeric_limits<T>::epsilon() * 1e3;
186 template <std::
floating_po
int T =
double>
189 fp_tolerance<T>() = v;
199 fp_tolerance<float>() =
static_cast<float>(v);
200 fp_tolerance<double>() =
static_cast<double>(v);
201 fp_tolerance<long double>() = v;
Configuration singleton for the ComPPare library.
Definition config.hpp:48
static void set_warmup_us(const double start, const double end)
Set the warmup us value using double.
Definition config.hpp:142
static void set_roi_us(std::chrono::duration< Rep, Period > v)
Set the roi us value using a std::chrono::duration.
Definition config.hpp:98
static void set_roi_us(const float v)
Set the roi us value using float.
Definition config.hpp:106
static void set_warmup_us(const double v)
Set the warmup us value using double.
Definition config.hpp:158
static config & instance()
Get the singleton instance of the config class.
Definition config.hpp:213
std::chrono::steady_clock clock_t
Type alias for the clock used in timing operations.
Definition config.hpp:51
config()=default
Construct a new config object.
config & operator=(config &&)=delete
Deleted move assignment operator.
config(const config &)=delete
Deleted copy constructor.
static void set_warmup_iters(uint64_t v)
Set the number of warmup iterations.
Definition config.hpp:68
static void increment_roi_us(const float v)
Increment the roi us value using float.
Definition config.hpp:123
double roi_
The current roi us value.
Definition config.hpp:220
std::chrono::time_point< clock_t > time_point_t
Type alias for the time point used in timing operations.
Definition config.hpp:54
static void increment_roi_us(const double v)
Increment the roi us value using double.
Definition config.hpp:121
uint64_t bench_iters_
The number of benchmark iterations.
Definition config.hpp:227
static void set_roi_us(const double v)
Set the roi us value using double.
Definition config.hpp:104
static double get_roi_us()
Get the current roi us value.
Definition config.hpp:163
static uint64_t bench_iters()
Get the number of benchmark iterations.
Definition config.hpp:71
static void reset_roi_us()
Reset the ROI time to zero.
Definition config.hpp:76
uint64_t warmup_iters_
The number of warmup iterations.
Definition config.hpp:225
static T & fp_tolerance()
Get the floating-point tolerance for a specific floating-point type.
Definition config.hpp:174
static void set_roi_us(const float start, const float end)
Set the roi us value using float.
Definition config.hpp:86
config & operator=(const config &)=delete
Deleted copy assignment operator.
static double get_warmup_us()
Get the current warmup us value.
Definition config.hpp:165
static void increment_roi_us(std::chrono::duration< Rep, Period > v)
Increment the roi us value using time points.
Definition config.hpp:115
static uint64_t warmup_iters()
Get the number of warmup iterations.
Definition config.hpp:66
static void set_warmup_us(const float v)
Set the warmup us value using float.
Definition config.hpp:160
static void set_fp_tolerance(T v)
Set the floating-point tolerance for a specific floating-point type.
Definition config.hpp:187
double warmup_
The current warmup us value.
Definition config.hpp:222
config(config &&)=delete
Deleted move constructor.
static void set_warmup_us(const time_point_t &start, const time_point_t &end)
Set the warmup us value using time points.
Definition config.hpp:130
static void set_warmup_us(std::chrono::duration< Rep, Period > v)
Set the warmup us value using a std::chrono::duration.
Definition config.hpp:152
static void set_all_fp_tolerance(long double v)
Set the floating-point tolerance for all supported types.
Definition config.hpp:197
static void set_roi_us(const double start, const double end)
Set the roi us value using double.
Definition config.hpp:88
static void set_bench_iters(uint64_t v)
Set the number of benchmark iterations.
Definition config.hpp:73
static void set_roi_us(const time_point_t &start, const time_point_t &end)
Set the roi us value using time points.
Definition config.hpp:84
static void set_warmup_us(const float start, const float end)
Set the warmup us value using float.
Definition config.hpp:136
Singleton class for the current state.
Definition config.hpp:243
static current_state & instance()
Get the singleton instance of the current_state class.
Definition config.hpp:269
current_state(current_state &&)=delete
Deleted move constructor.
static void set_using_plugin(bool v)
Set if a plugin is being used currently.
Definition config.hpp:257
current_state(const current_state &)=delete
Deleted copy constructor.
current_state & operator=(current_state &&)=delete
Deleted move assignment operator.
static void set_impl_name(std::string_view name)
Set the name of the current implementation.
Definition config.hpp:262
current_state & operator=(const current_state &)=delete
Deleted copy assignment operator.
bool using_plugin_
The current state of plugin usage.
Definition config.hpp:276
current_state()=default
Private Default kconstructor.
std::string_view impl_name_
The name of the current implementation.
Definition config.hpp:278
static bool using_plugin()
Get if a plugin is being used currently.
Definition config.hpp:255
static std::string_view impl_name()
Get the name of the current implementation.
Definition config.hpp:260
ComPPare framework main namespace.