NVIDIA/nvbench
Add option to add plain text description to a benchmark declaration
开放
#12 创建于 2021年4月22日
P2: nice to havegood first issuetype: enhancement
仓库指标
- 星标
- (914 个星标)
- PR 合并指标
- (PR 指标待抓取)
描述
One of my favorite things about Catch2 is that you can provide a plain text, human readable description with each test.
TEST_CASE( "Factorials are computed", "[factorial]" ) {
REQUIRE( Factorial(1) == 1 );
REQUIRE( Factorial(2) == 2 );
REQUIRE( Factorial(3) == 6 );
REQUIRE( Factorial(10) == 3628800 );
}
It would be nice to extend this idea to benchmark declaration.
Taking from the example project, this could look something like:
NVBENCH_BENCH("Benchmarks sleep across a range of values", sleep_benchmark)
.add_int64_axis("Duration (us)", nvbench::range(0, 100, 5))
.set_timeout(1); // Limit to one second per measurement.
or it could be an additional member to the builder:
NVBENCH_BENCH(sleep_benchmark)
.add_int64_axis("Duration (us)", nvbench::range(0, 100, 5))
.set_timeout(1) // Limit to one second per measurement.
.description("Benchmarks sleep across a range of values");
This description could then be included when doing things like --list.