Skip to content

Commit

Permalink
Correct unused parameter warnings in rolling algorithms (#8390)
Browse files Browse the repository at this point in the history
Starting in CUDA 11.3, nvcc will start to unconditionally warn about unused parameters on functions/methods that are in anonymous namespaces.

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Karthikeyan (https://github.com/karthikeyann)

URL: #8390
  • Loading branch information
robertmaynard authored Jun 9, 2021
1 parent 8df3c6a commit b41b2ea
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 @@ -112,7 +112,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 @@ -165,7 +165,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 @@ -218,7 +218,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 @@ -263,8 +263,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 @@ -296,8 +296,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 @@ -381,7 +381,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 @@ -438,7 +438,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 @@ -531,15 +531,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 @@ -548,7 +548,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 @@ -595,7 +595,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 @@ -608,7 +608,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 @@ -619,7 +619,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 @@ -683,10 +683,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 @@ -704,7 +704,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 @@ -957,14 +957,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 b41b2ea

Please sign in to comment.