ZeroErr
载入中...
搜索中...
未找到
zeroerr::Benchmark结构体 参考

Benchmark create a core object for configuration of a benchmark. This class is a driver to run multiple times of a benchmark. Each time of a run will generate a row of data. Report will print the data in console. 更多...

#include <benchmark.h>

zeroerr::Benchmark 的协作图:

Public 类型

using ns = std::chrono::nanoseconds
 
using ms = std::chrono::milliseconds
 
using time = ns
 

Public 成员函数

 Benchmark (std::string title)
 
template<typename Op >
Benchmarkrun (std::string name, Op &&op)
 
template<typename Op >
Benchmarkrun (Op &&op)
 
void report ()
 

Public 属性

std::string title = "benchmark"
 
const char * op_unit = "op"
 
const char * time_unit = "ns"
 
uint64_t epochs = 10
 
uint64_t warmup = 0
 
uint64_t iter_per_epoch = 0
 
time mMaxEpochTime = ms(100)
 
time mMinEpochTime = ms(1)
 
uint64_t minimalResolutionMutipler = 1000
 
std::vector< BenchResultresult
 

详细描述

Benchmark create a core object for configuration of a benchmark. This class is a driver to run multiple times of a benchmark. Each time of a run will generate a row of data. Report will print the data in console.

成员类型定义说明

◆ ms

using zeroerr::Benchmark::ms = std::chrono::milliseconds

◆ ns

using zeroerr::Benchmark::ns = std::chrono::nanoseconds

◆ time

构造及析构函数说明

◆ Benchmark()

zeroerr::Benchmark::Benchmark ( std::string  title)
inline

成员函数说明

◆ report()

void zeroerr::Benchmark::report ( )

◆ run() [1/2]

template<typename Op >
Benchmark & zeroerr::Benchmark::run ( Op &&  op)
inline

◆ run() [2/2]

template<typename Op >
Benchmark & zeroerr::Benchmark::run ( std::string  name,
Op &&  op 
)
inline

类成员变量说明

◆ epochs

uint64_t zeroerr::Benchmark::epochs = 10

◆ iter_per_epoch

uint64_t zeroerr::Benchmark::iter_per_epoch = 0

◆ minimalResolutionMutipler

uint64_t zeroerr::Benchmark::minimalResolutionMutipler = 1000

◆ mMaxEpochTime

time zeroerr::Benchmark::mMaxEpochTime = ms(100)

◆ mMinEpochTime

time zeroerr::Benchmark::mMinEpochTime = ms(1)

◆ op_unit

const char* zeroerr::Benchmark::op_unit = "op"

◆ result

std::vector<BenchResult> zeroerr::Benchmark::result

◆ time_unit

const char* zeroerr::Benchmark::time_unit = "ns"

◆ title

std::string zeroerr::Benchmark::title = "benchmark"

◆ warmup

uint64_t zeroerr::Benchmark::warmup = 0

该结构体的文档由以下文件生成: