NVIDIA/nvbench

Add option to add plain text description to a benchmark declaration

Aberta

#12 aberto em 22 de abr. de 2021

 (2 comentários) (0 reação) (0 responsável)Cuda (115 forks)auto 404
P2: nice to havegood first issuetype: enhancement

Métricas do repositório

Stars
 (914 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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.

Guia do colaborador