Update docs

This commit is contained in:
Yunsong Wang
2022-02-06 19:34:57 -05:00
parent a2a12c689c
commit e7c29c1c1b

View File

@@ -20,7 +20,8 @@ stream-ordered operation. A `cudaStream_t` may be provided via `state::set_cuda_
It is assumed that all work of interest executes on or synchronizes with this stream. It is assumed that all work of interest executes on or synchronizes with this stream.
```cpp ```cpp
void my_benchmark(nvbench::state& state) { void my_benchmark(nvbench::state& state) {
state.set_cuda_stream(nvbench::cuda_stream{cudaStreamDefault, false}); cudaStream_t default_stream = 0;
state.set_cuda_stream(nvbench::cuda_stream{default_stream, false});
state.exec([](nvbench::launch&) { state.exec([](nvbench::launch&) {
my_func(); // a host API invoking GPU kernels without taking an explicit stream my_func(); // a host API invoking GPU kernels without taking an explicit stream
my_kernel<<<num_blocks, 256>>>(); // or a kernel launched with the default stream my_kernel<<<num_blocks, 256>>>(); // or a kernel launched with the default stream