From 6139dcebf33e5d77b656ce356f214118194862ec Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 26 May 2021 09:44:28 -0400 Subject: [PATCH] Correct unused parameter warnings in rolling algorithms --- cpp/src/rolling/grouped_rolling.cu | 2 +- .../rolling/range_window_bounds_detail.hpp | 1 + cpp/src/rolling/rolling_detail.cuh | 52 +++++++++---------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/cpp/src/rolling/grouped_rolling.cu b/cpp/src/rolling/grouped_rolling.cu index 5702a32536c..a6399a88e9a 100644 --- a/cpp/src/rolling/grouped_rolling.cu +++ b/cpp/src/rolling/grouped_rolling.cu @@ -864,7 +864,7 @@ struct to_duration_bounds { } template (), void>* = nullptr> - range_window_bounds operator()(size_type num_days) const + range_window_bounds operator()(size_type) const { CUDF_FAIL("Expected timestamp orderby column."); } diff --git a/cpp/src/rolling/range_window_bounds_detail.hpp b/cpp/src/rolling/range_window_bounds_detail.hpp index 47c9273a232..e09e474d9de 100644 --- a/cpp/src/rolling/range_window_bounds_detail.hpp +++ b/cpp/src/rolling/range_window_bounds_detail.hpp @@ -79,6 +79,7 @@ namespace { template void assert_non_negative(T const& value) { + (void)value; if constexpr (std::numeric_limits::is_signed) { CUDF_EXPECTS(value >= T{0}, "Range scalar must be >= 0."); } diff --git a/cpp/src/rolling/rolling_detail.cuh b/cpp/src/rolling/rolling_detail.cuh index 9e6d135b153..7f86c19e483 100644 --- a/cpp/src/rolling/rolling_detail.cuh +++ b/cpp/src/rolling/rolling_detail.cuh @@ -111,7 +111,7 @@ struct DeviceRolling { // perform the windowing operation template bool __device__ operator()(column_device_view const& input, - column_device_view const& ignored_default_outputs, + column_device_view const&, mutable_column_device_view& output, size_type start_index, size_type end_index, @@ -164,7 +164,7 @@ struct DeviceRollingArgMinMax { template bool __device__ operator()(column_device_view const& input, - column_device_view const& ignored_default_outputs, + column_device_view const&, mutable_column_device_view& output, size_type start_index, size_type end_index, @@ -217,7 +217,7 @@ struct DeviceRollingCountValid { template bool __device__ operator()(column_device_view const& input, - column_device_view const& ignored_default_outputs, + column_device_view const&, mutable_column_device_view& output, size_type start_index, size_type end_index, @@ -262,8 +262,8 @@ struct DeviceRollingCountAll { DeviceRollingCountAll(size_type _min_periods) : min_periods(_min_periods) {} template - bool __device__ operator()(column_device_view const& input, - column_device_view const& ignored_default_outputs, + bool __device__ operator()(column_device_view const&, + column_device_view const&, mutable_column_device_view& output, size_type start_index, size_type end_index, @@ -295,8 +295,8 @@ struct DeviceRollingRowNumber { DeviceRollingRowNumber(size_type _min_periods) : min_periods(_min_periods) {} template - bool __device__ operator()(column_device_view const& input, - column_device_view const& ignored_default_outputs, + bool __device__ operator()(column_device_view const&, + column_device_view const&, mutable_column_device_view& output, size_type start_index, size_type end_index, @@ -338,7 +338,7 @@ struct DeviceRollingLead { bool __device__ operator()(column_device_view const& input, column_device_view const& default_outputs, mutable_column_device_view& output, - size_type start_index, + size_type, size_type end_index, size_type current_index) { @@ -395,7 +395,7 @@ struct DeviceRollingLag { column_device_view const& default_outputs, mutable_column_device_view& output, size_type start_index, - size_type end_index, + size_type, size_type current_index) { // Offsets have already been normalized. @@ -488,7 +488,7 @@ struct create_rolling_operator< typename T = InputType, aggregation::Kind O = op, std::enable_if_t* = nullptr> - auto operator()(size_type min_periods, rolling_aggregation const& agg) + auto operator()(size_type min_periods, rolling_aggregation const&) { return typename corresponding_rolling_operator::type(min_periods); } @@ -496,7 +496,7 @@ struct create_rolling_operator< template * = nullptr> - auto operator()(size_type min_periods, rolling_aggregation const& agg) + auto operator()(size_type, rolling_aggregation const& agg) { return DeviceRollingLead{ dynamic_cast(agg).row_offset}; @@ -505,7 +505,7 @@ struct create_rolling_operator< template * = nullptr> - auto operator()(size_type min_periods, rolling_aggregation const& agg) + auto operator()(size_type, rolling_aggregation const& agg) { return DeviceRollingLag{ dynamic_cast(agg).row_offset}; @@ -552,7 +552,7 @@ class rolling_aggregation_preprocessor final : public cudf::detail::simple_aggre // Then a second pass uses those indices to gather the final strings. This step // translates the the MIN -> ARGMIN aggregation std::vector> visit(data_type col_type, - cudf::detail::min_aggregation const& agg) override + cudf::detail::min_aggregation const&) override { std::vector> aggs; aggs.push_back(col_type.id() == type_id::STRING ? make_argmin_aggregation() @@ -565,7 +565,7 @@ class rolling_aggregation_preprocessor final : public cudf::detail::simple_aggre // Then a second pass uses those indices to gather the final strings. This step // translates the the MAX -> ARGMAX aggregation std::vector> visit(data_type col_type, - cudf::detail::max_aggregation const& agg) override + cudf::detail::max_aggregation const&) override { std::vector> aggs; aggs.push_back(col_type.id() == type_id::STRING ? make_argmax_aggregation() @@ -576,7 +576,7 @@ class rolling_aggregation_preprocessor final : public cudf::detail::simple_aggre // COLLECT_LIST aggregations do not peform a rolling operation at all. They get processed // entirely in the finalize() step. std::vector> visit( - data_type col_type, cudf::detail::collect_list_aggregation const& agg) override + data_type, cudf::detail::collect_list_aggregation const&) override { return {}; } @@ -632,10 +632,10 @@ class rolling_aggregation_postprocessor final : public cudf::detail::aggregation } // all non-specialized aggregation types simply pass the intermediate result through. - void visit(aggregation const& agg) override { result = std::move(intermediate); } + void visit(aggregation const&) override { result = std::move(intermediate); } // perform a final gather on the generated ARGMIN data - void visit(cudf::detail::min_aggregation const& agg) override + void visit(cudf::detail::min_aggregation const&) override { if (result_type.id() == type_id::STRING) { // The rows that represent null elements will have negative values in gather map, @@ -653,7 +653,7 @@ class rolling_aggregation_postprocessor final : public cudf::detail::aggregation } // perform a final gather on the generated ARGMAX data - void visit(cudf::detail::max_aggregation const& agg) override + void visit(cudf::detail::max_aggregation const&) override { if (result_type.id() == type_id::STRING) { // The rows that represent null elements will have negative values in gather map, @@ -890,14 +890,14 @@ struct rolling_window_launcher { typename FollowingWindowIterator> std::enable_if_t::type::is_supported(), std::unique_ptr> - operator()(column_view const& input, - column_view const& default_outputs, - PrecedingWindowIterator preceding_window_begin, - FollowingWindowIterator following_window_begin, - int min_periods, - rolling_aggregation const& agg, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + operator()(column_view const&, + column_view const&, + PrecedingWindowIterator, + FollowingWindowIterator, + int, + rolling_aggregation const&, + rmm::cuda_stream_view, + rmm::mr::device_memory_resource*) { CUDF_FAIL("Invalid aggregation type/pair"); }