Add more examples.

- exec_tag_timer
- exec_tag_sync
- skip
- throughput
This commit is contained in:
Allison Vacanti
2021-03-09 16:02:34 -05:00
parent 3d83fe20ac
commit 3fc75f5ea6
9 changed files with 369 additions and 10 deletions

View File

@@ -223,8 +223,12 @@ state.add_global_memory_reads<InputType>(size);
state.add_global_memory_writes<OutputType>(size);
```
For meaningful results, specify the input element count, and include all reads
and writes to global memory.
In general::
- Add only the input element count (no outputs).
- Add all reads and writes to global memory.
More examples can found in [examples/throughput.cu](../examples/throughput.cu).
# Skip Uninteresting / Invalid Benchmarks
@@ -263,6 +267,8 @@ using Us = nvbench::type_list<...>;
NVBENCH_BENCH_TYPES(my_benchmark, NVBENCH_TYPE_AXES(Ts, Us));
```
More examples can found in [examples/skip.cu](../examples/skip.cu).
# Execution Tags For Special Cases
By default, NVBench assumes that the entire execution time of the
@@ -304,6 +310,9 @@ void sync_example(nvbench::state& state)
NVBENCH_BENCH(sync_example);
```
See [examples/exec_tag_sync.cu](../examples/exec_tag_sync.cu) for a complete
example.
## Explicit timer mode: `nvbench::exec_tag::timer`
For some kernels, the working data may need to be reset between launches. This
@@ -342,6 +351,9 @@ void timer_example(nvbench::state& state)
NVBENCH_BENCH(timer_example);
```
See [examples/exec_tag_timer.cu](../examples/exec_tag_timer.cu) for a complete
example.
# Beware: Combinatorial Explosion Is Lurking
Be very careful of how quickly the configuration space can grow. The following