Skip to content

Commit fbd30bc

Browse files
committed
Fix issue with newer thrust.
Implicit conversions from `nvbench::cuda_stream` -> `cudaStream_t` no longer work when creating Thrust execution policies, as the `cudaStream_t` overload of `thrust::device.on(...)` was removed and replaced with `cuda::stream_ref`. Explicitly pulling the `cudaStream_t` out of the `nvbench::cuda_stream` and passing it to `on` so that the implicit constructor of `stream_ref` can handle it seems to be the only way to fix this while preserving support back to CTK 12.0 (`stream_ref` was added in CTK 12.3).
1 parent eadb913 commit fbd30bc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/exec_tag_sync.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void sequence_bench(nvbench::state &state)
5353

5454
// nvbench::exec_tag::sync indicates that this will implicitly sync:
5555
state.exec(nvbench::exec_tag::sync, [&data](nvbench::launch &launch) {
56-
thrust::sequence(thrust::device.on(launch.get_stream()), data.begin(), data.end());
56+
thrust::sequence(thrust::device.on(launch.get_stream().get_stream()), data.begin(), data.end());
5757
});
5858
}
5959
NVBENCH_BENCH(sequence_bench);

examples/exec_tag_timer.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void mod2_inplace(nvbench::state &state)
5757
(void)num_values; // clang thinks this is unused...
5858

5959
// Reset working data:
60-
thrust::copy(thrust::device.on(launch.get_stream()),
60+
thrust::copy(thrust::device.on(launch.get_stream().get_stream()),
6161
input.cbegin(),
6262
input.cend(),
6363
data.begin());

0 commit comments

Comments
 (0)