|
5 | 5 | #include <thrust/fill.h> |
6 | 6 | #include <thrust/mismatch.h> |
7 | 7 |
|
| 8 | +#include <cuda/iterator> |
8 | 9 | #include <cuda/memory_pool> |
9 | | -#include <cuda/std/__pstl_algorithm> |
10 | 10 | #include <cuda/stream> |
11 | 11 |
|
12 | 12 | #include "nvbench_helper.cuh" |
@@ -40,39 +40,3 @@ NVBENCH_BENCH_TYPES(range_iter, NVBENCH_TYPE_AXES(fundamental_types)) |
40 | 40 | .set_name("base_range_iter") |
41 | 41 | .add_int64_power_of_two_axis("Elements", nvbench::range(16, 28, 4)) |
42 | 42 | .add_float64_axis("MismatchAt", std::vector{1.0, 0.5, 0.01}); |
43 | | - |
44 | | -template <typename T> |
45 | | -static void range_range(nvbench::state& state, nvbench::type_list<T>) |
46 | | -{ |
47 | | - T val = 1; |
48 | | - // set up input |
49 | | - const auto elements = static_cast<std::size_t>(state.get_int64("Elements")); |
50 | | - const auto common_prefix = state.get_float64("MismatchAt"); |
51 | | - const auto mismatch_point = static_cast<std::size_t>(elements * common_prefix); |
52 | | - |
53 | | - thrust::device_vector<T> dinput(elements, thrust::no_init); |
54 | | - thrust::fill(dinput.begin(), dinput.begin() + mismatch_point, T{0}); |
55 | | - thrust::fill(dinput.begin() + mismatch_point, dinput.end(), val); |
56 | | - |
57 | | - state.add_global_memory_reads<T>(mismatch_point + 1); |
58 | | - state.add_global_memory_writes<size_t>(1); |
59 | | - |
60 | | - cuda::stream stream{cuda::device_ref{0}}; |
61 | | - cuda::device_memory_pool_ref alloc = cuda::device_default_memory_pool(stream.device()); |
62 | | - |
63 | | - auto policy = cuda::execution::__cub_par_unseq.with_stream(stream).with_memory_resource(alloc); |
64 | | - state.exec(nvbench::exec_tag::gpu | nvbench::exec_tag::no_batch | nvbench::exec_tag::sync, |
65 | | - [&](nvbench::launch& launch) { |
66 | | - (void) cuda::std::mismatch( |
67 | | - policy.with_stream(launch.get_stream().get_stream()), |
68 | | - dinput.begin(), |
69 | | - dinput.end(), |
70 | | - cuda::constant_iterator<T>{0}, |
71 | | - cuda::constant_iterator<T>{0, elements}); |
72 | | - }); |
73 | | -} |
74 | | - |
75 | | -NVBENCH_BENCH_TYPES(range_range, NVBENCH_TYPE_AXES(fundamental_types)) |
76 | | - .set_name("base_range_range") |
77 | | - .add_int64_power_of_two_axis("Elements", nvbench::range(16, 28, 4)) |
78 | | - .add_float64_axis("MismatchAt", std::vector{1.0, 0.5, 0.01}); |
0 commit comments