Add --run-once option.

Fixes #10.

Adds a mode that forces a benchmark to only run once, simplifying
profiling usecases. This can be enabled by any of the following methods:

* Passing `--run-once` on the command line
* `NVBENCH_CREATE(...).set_run_once(true)` when declaring a benchmark
* `state.set_run_once(true)` from within the benchmark implementation.
This commit is contained in:
Allison Vacanti
2021-10-07 16:28:15 -04:00
parent 2de82f3041
commit 6d79c80152
10 changed files with 79 additions and 3 deletions

View File

@@ -94,3 +94,10 @@
noise).
* Applies to the most recent `--benchmark`, or all benchmarks if specified
before any `--benchmark` arguments.
* `--run-once`
* Only run the benchmark once, skipping any warmup runs and batched
measurements.
* Intended for use with external profiling tools.
* Applies to the most recent `--benchmark`, or all benchmarks if specified
before any `--benchmark` arguments.