Skip to content

Commit

Permalink
Fix unused parameter warning/error in grouped_rolling.cu (#13192)
Browse files Browse the repository at this point in the history
Fixes unused parameter warning/error introduced by #13143 in `grouped_rolling.cu`
```
CMakeFiles/cudf.dir/src/rolling/grouped_rolling.cu.o
/cudf/cpp/src/rolling/grouped_rolling.cu(280): error #177-D: parameter "delta" was declared but never referenced
```
This was found when building with nvcc 11.5.
I was hoping there would be some clever partial specialization or function overloading that could be done here but none were as clean as the current implementation. Solution was to just add `[[maybe_unused]]` to offending parameter declaration.

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Bradley Dice (https://github.com/bdice)

URL: #13192
  • Loading branch information
davidwendt authored Apr 24, 2023
1 parent 2a7fd5b commit 9ffd30f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/src/rolling/grouped_rolling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ __device__ T subtract_safe(T const& value, T const& delta)
template <typename ElementT, typename ElementIter>
__device__ ElementT compute_lowest_in_window(ElementIter orderby_iter,
size_type idx,
ElementT delta)
[[maybe_unused]] ElementT delta)
{
if constexpr (std::is_same_v<ElementT, cudf::string_view>) {
return orderby_iter[idx];
Expand All @@ -293,7 +293,7 @@ __device__ ElementT compute_lowest_in_window(ElementIter orderby_iter,
template <typename ElementT, typename ElementIter>
__device__ ElementT compute_highest_in_window(ElementIter orderby_iter,
size_type idx,
ElementT delta)
[[maybe_unused]] ElementT delta)
{
if constexpr (std::is_same_v<ElementT, cudf::string_view>) {
return orderby_iter[idx];
Expand Down

0 comments on commit 9ffd30f

Please sign in to comment.