Skip to content

Commit

Permalink
Correct unused parameter warnings in rolling algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard committed May 26, 2021
1 parent c398054 commit 6139dce
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion cpp/src/rolling/grouped_rolling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ struct to_duration_bounds {
}

template <typename OrderBy, std::enable_if_t<!cudf::is_timestamp<OrderBy>(), void>* = nullptr>
range_window_bounds operator()(size_type num_days) const
range_window_bounds operator()(size_type) const
{
CUDF_FAIL("Expected timestamp orderby column.");
}
Expand Down
1 change: 1 addition & 0 deletions cpp/src/rolling/range_window_bounds_detail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ namespace {
template <typename T>
void assert_non_negative(T const& value)
{
(void)value;
if constexpr (std::numeric_limits<T>::is_signed) {
CUDF_EXPECTS(value >= T{0}, "Range scalar must be >= 0.");
}
Expand Down
52 changes: 26 additions & 26 deletions cpp/src/rolling/rolling_detail.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct DeviceRolling {
// perform the windowing operation
template <typename OutputType, bool has_nulls>
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,
Expand Down Expand Up @@ -164,7 +164,7 @@ struct DeviceRollingArgMinMax {

template <typename OutputType, bool has_nulls>
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,
Expand Down Expand Up @@ -217,7 +217,7 @@ struct DeviceRollingCountValid {

template <typename OutputType, bool has_nulls>
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,
Expand Down Expand Up @@ -262,8 +262,8 @@ struct DeviceRollingCountAll {
DeviceRollingCountAll(size_type _min_periods) : min_periods(_min_periods) {}

template <typename OutputType, bool has_nulls>
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,
Expand Down Expand Up @@ -295,8 +295,8 @@ struct DeviceRollingRowNumber {
DeviceRollingRowNumber(size_type _min_periods) : min_periods(_min_periods) {}

template <typename OutputType, bool has_nulls>
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,
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -488,15 +488,15 @@ struct create_rolling_operator<
typename T = InputType,
aggregation::Kind O = op,
std::enable_if_t<O != aggregation::Kind::LEAD && O != aggregation::Kind::LAG>* = 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<InputType, op>::type(min_periods);
}

template <typename T = InputType,
aggregation::Kind O = op,
std::enable_if_t<O == aggregation::Kind::LEAD>* = nullptr>
auto operator()(size_type min_periods, rolling_aggregation const& agg)
auto operator()(size_type, rolling_aggregation const& agg)
{
return DeviceRollingLead<InputType>{
dynamic_cast<cudf::detail::lead_lag_aggregation const&>(agg).row_offset};
Expand All @@ -505,7 +505,7 @@ struct create_rolling_operator<
template <typename T = InputType,
aggregation::Kind O = op,
std::enable_if_t<O == aggregation::Kind::LAG>* = nullptr>
auto operator()(size_type min_periods, rolling_aggregation const& agg)
auto operator()(size_type, rolling_aggregation const& agg)
{
return DeviceRollingLag<InputType>{
dynamic_cast<cudf::detail::lead_lag_aggregation const&>(agg).row_offset};
Expand Down Expand Up @@ -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<std::unique_ptr<aggregation>> visit(data_type col_type,
cudf::detail::min_aggregation const& agg) override
cudf::detail::min_aggregation const&) override
{
std::vector<std::unique_ptr<aggregation>> aggs;
aggs.push_back(col_type.id() == type_id::STRING ? make_argmin_aggregation()
Expand All @@ -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<std::unique_ptr<aggregation>> visit(data_type col_type,
cudf::detail::max_aggregation const& agg) override
cudf::detail::max_aggregation const&) override
{
std::vector<std::unique_ptr<aggregation>> aggs;
aggs.push_back(col_type.id() == type_id::STRING ? make_argmax_aggregation()
Expand All @@ -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<std::unique_ptr<aggregation>> visit(
data_type col_type, cudf::detail::collect_list_aggregation const& agg) override
data_type, cudf::detail::collect_list_aggregation const&) override
{
return {};
}
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -890,14 +890,14 @@ struct rolling_window_launcher {
typename FollowingWindowIterator>
std::enable_if_t<!corresponding_rolling_operator<InputType, op>::type::is_supported(),
std::unique_ptr<column>>
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");
}
Expand Down

0 comments on commit 6139dce

Please sign in to comment.