From 61772d8d8e06eba0b71e7fb37ec8a6122d9fb643 Mon Sep 17 00:00:00 2001 From: David Wendt <45795991+davidwendt@users.noreply.github.com> Date: Mon, 14 Mar 2022 13:18:21 -0400 Subject: [PATCH] Fix benchmarks to work with new aggregation types (#10428) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes benchmarks compile errors introduced by #10357 Example: ``` /cudf/cpp/benchmarks/reduction/reduce.cpp: In function ‘void BM_reduction(benchmark::State&, const std::unique_ptr&)’: /cudf/cpp/benchmarks/reduction/reduce.cpp:52:46: error: invalid initialization of reference of type ‘const std::unique_ptr&’ from expression of type ‘const std::unique_ptr’ 52 | auto result = cudf::reduce(input_column, agg, output_dtype); ``` Aggregation types for reduce and scan were modified to include template types. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - https://github.com/nvdbaranec URL: https://github.com/rapidsai/cudf/pull/10428 --- cpp/benchmarks/reduction/anyall.cpp | 7 ++++--- cpp/benchmarks/reduction/dictionary.cpp | 7 ++++--- cpp/benchmarks/reduction/reduce.cpp | 6 +++--- cpp/benchmarks/reduction/scan.cpp | 3 ++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cpp/benchmarks/reduction/anyall.cpp b/cpp/benchmarks/reduction/anyall.cpp index 3dcb433ec52..d16292655ce 100644 --- a/cpp/benchmarks/reduction/anyall.cpp +++ b/cpp/benchmarks/reduction/anyall.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,8 @@ class Reduction : public cudf::benchmark { }; template -void BM_reduction_anyall(benchmark::State& state, std::unique_ptr const& agg) +void BM_reduction_anyall(benchmark::State& state, + std::unique_ptr const& agg) { const cudf::size_type column_size{static_cast(state.range(0))}; @@ -48,7 +49,7 @@ void BM_reduction_anyall(benchmark::State& state, std::unique_ptr()) // TYPE, OP #define RBM_BENCHMARK_DEFINE(name, type, aggregation) \ diff --git a/cpp/benchmarks/reduction/dictionary.cpp b/cpp/benchmarks/reduction/dictionary.cpp index cb66e3744e2..01fb17e31f0 100644 --- a/cpp/benchmarks/reduction/dictionary.cpp +++ b/cpp/benchmarks/reduction/dictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,8 @@ class ReductionDictionary : public cudf::benchmark { }; template -void BM_reduction_dictionary(benchmark::State& state, std::unique_ptr const& agg) +void BM_reduction_dictionary(benchmark::State& state, + std::unique_ptr const& agg) { const cudf::size_type column_size{static_cast(state.range(0))}; @@ -53,7 +54,7 @@ void BM_reduction_dictionary(benchmark::State& state, std::unique_ptr()) // TYPE, OP #define RBM_BENCHMARK_DEFINE(name, type, aggregation) \ diff --git a/cpp/benchmarks/reduction/reduce.cpp b/cpp/benchmarks/reduction/reduce.cpp index 0d76a4a8ba4..d7350ace65c 100644 --- a/cpp/benchmarks/reduction/reduce.cpp +++ b/cpp/benchmarks/reduction/reduce.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ class Reduction : public cudf::benchmark { }; template -void BM_reduction(benchmark::State& state, std::unique_ptr const& agg) +void BM_reduction(benchmark::State& state, std::unique_ptr const& agg) { const cudf::size_type column_size{(cudf::size_type)state.range(0)}; @@ -54,7 +54,7 @@ void BM_reduction(benchmark::State& state, std::unique_ptr co } #define concat(a, b, c) a##b##c -#define get_agg(op) concat(cudf::make_, op, _aggregation()) +#define get_agg(op) concat(cudf::make_, op, _aggregation()) // TYPE, OP #define RBM_BENCHMARK_DEFINE(name, type, aggregation) \ diff --git a/cpp/benchmarks/reduction/scan.cpp b/cpp/benchmarks/reduction/scan.cpp index 7a0d3f9515f..aef4960789a 100644 --- a/cpp/benchmarks/reduction/scan.cpp +++ b/cpp/benchmarks/reduction/scan.cpp @@ -39,7 +39,8 @@ static void BM_reduction_scan(benchmark::State& state, bool include_nulls) for (auto _ : state) { cuda_event_timer timer(state, true); - auto result = cudf::scan(input, cudf::make_min_aggregation(), cudf::scan_type::INCLUSIVE); + auto result = cudf::scan( + input, cudf::make_min_aggregation(), cudf::scan_type::INCLUSIVE); } }