diff --git a/cpp/benchmarks/reduction/segment_reduce.cu b/cpp/benchmarks/reduction/segment_reduce.cu index 47e47943d36..3723147d95c 100644 --- a/cpp/benchmarks/reduction/segment_reduce.cu +++ b/cpp/benchmarks/reduction/segment_reduce.cu @@ -14,12 +14,10 @@ * limitations under the License. */ +#include #include #include -#include -#include - #include #include #include @@ -33,7 +31,6 @@ #include #include -#include namespace cudf { @@ -71,20 +68,21 @@ std::pair, thrust::device_vector> make_test_d auto segment_length = column_size / num_segments; - test::UniformRandomGenerator rand_gen(0, 100); - auto data_it = detail::make_counting_transform_iterator( - 0, [&rand_gen](auto i) { return rand_gen.generate(); }); + auto const dtype = cudf::type_to_id(); + data_profile profile; + profile.set_null_frequency(std::nullopt); + profile.set_cardinality(0); + profile.set_distribution_params(dtype, distribution_id::UNIFORM, 0, 100); + auto input = create_random_table({dtype}, row_count{column_size}, profile); auto offset_it = - detail::make_counting_transform_iterator(0, [&column_size, &segment_length](auto i) { + detail::make_counting_transform_iterator(0, [column_size, segment_length] __device__(auto i) { return column_size < i * segment_length ? column_size : i * segment_length; }); - test::fixed_width_column_wrapper input(data_it, data_it + column_size); - std::vector h_offsets(offset_it, offset_it + num_segments + 1); - thrust::device_vector d_offsets(h_offsets); + thrust::device_vector d_offsets(offset_it, offset_it + num_segments + 1); - return std::make_pair(input.release(), d_offsets); + return std::make_pair(std::move((input->release())[0]), d_offsets); } template