Skip to content

[FR] How to scale statistical time proportionally? #2124

@0400H

Description

@0400H

I want use the ->MinWarmUpTime(0.5)->MinTime(1) to sub whole pipeline time.

but How to get the avg time of Func in pipeline without any user-defined metric?

for (auto _ : state) {
    timer.start();
    // cuda kernel pipeline
    for (int i = 0; i < pipeline_size; i++) {
        Func();
    }
    timer.stop();
    state.SetIterationTime(timer.elapsed_ms() / 1000.0);
}
state.SetIteration(state.Iterations() * pipeline_size); // not support

#define REG_BENCHMARK(DATA, FUNC, T) \
    BENCHMARK(FUNC) \
        ->UseManualTime() \
        ->Unit(benchmark::kMillisecond) \
        ->MinWarmUpTime(0.5)->MinTime(1)

Maybe add the state.SetIteration mutable API make it work?

Or

?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions