Skip to content
1 change: 1 addition & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ add_library(
src/sort/segmented_sort.cu
src/sort/sort_column.cu
src/sort/sort.cu
src/sort/stable_segmented_sort.cu
src/sort/stable_sort_column.cu
src/sort/stable_sort.cu
src/stream_compaction/apply_boolean_mask.cu
Expand Down
7 changes: 6 additions & 1 deletion cpp/benchmarks/sort/segmented_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void nvbench_segmented_sort(nvbench::state& state)
{
cudf::rmm_pool_raii pool_raii;

auto const stable = static_cast<bool>(state.get_int64("stable"));
auto const dtype = cudf::type_to_id<int32_t>();
auto const size_bytes = static_cast<size_t>(state.get_int64("size_bytes"));
auto const null_freq = state.get_float64("null_frequency");
Expand All @@ -50,12 +51,16 @@ void nvbench_segmented_sort(nvbench::state& state)
state.add_global_memory_writes<nvbench::int32_t>(rows);

state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
auto result = cudf::segmented_sorted_order(*input, *segments);
if (stable)
cudf::stable_segmented_sorted_order(*input, *segments);
else
cudf::segmented_sorted_order(*input, *segments);
});
}

NVBENCH_BENCH(nvbench_segmented_sort)
.set_name("segmented_sort")
.add_int64_axis("stable", {0, 1})
.add_int64_power_of_two_axis("size_bytes", {16, 18, 20, 22, 24, 28})
.add_float64_axis("null_frequency", {0, 0.1})
.add_int64_axis("row_width", {16, 128, 1024});
Loading