Skip to content

Commit

Permalink
Correct unused parameter warnings in dictonary algorithms (#8239)
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:
  - David Wendt (https://github.com/davidwendt)
  - Karthikeyan (https://github.com/karthikeyann)

URL: #8239
  • Loading branch information
robertmaynard authored May 18, 2021
1 parent 65e8372 commit 975d22f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 45 deletions.
12 changes: 3 additions & 9 deletions cpp/src/dictionary/detail/concatenate.cu
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,12 @@ struct dispatch_compute_indices {
return result;
}

template <typename Element>
template <typename Element, typename... Args>
typename std::enable_if_t<!cudf::is_relationally_comparable<Element, Element>(),
std::unique_ptr<column>>
operator()(column_view const&,
column_view const&,
column_view const&,
offsets_pair const*,
size_type const*,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource*)
operator()(Args&&...)
{
CUDF_FAIL("list_view as keys for dictionary not supported");
CUDF_FAIL("dictionary concatenate not supported for this column type");
}
};

Expand Down
45 changes: 15 additions & 30 deletions cpp/src/dictionary/search.cu
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct dispatch_scalar_index {
template <typename IndexType,
typename... Args,
std::enable_if_t<not is_index_type<IndexType>()>* = nullptr>
std::unique_ptr<scalar> operator()(Args&&... args)
std::unique_ptr<scalar> operator()(Args&&...)
{
CUDF_FAIL("indices must be an integral type");
}
Expand Down Expand Up @@ -89,33 +89,18 @@ struct find_index_fn {
stream,
mr);
}
template <typename Element,
std::enable_if_t<std::is_same<Element, dictionary32>::value>* = nullptr>
std::unique_ptr<scalar> operator()(dictionary_column_view const& input,
scalar const& key,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr) const
{
CUDF_FAIL("dictionary column cannot be the keys column of another dictionary");
}

template <typename Element, std::enable_if_t<std::is_same<Element, list_view>::value>* = nullptr>
std::unique_ptr<scalar> operator()(dictionary_column_view const& input,
scalar const& key,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr) const
{
CUDF_FAIL("list_view column cannot be the keys column of a dictionary");
}

template <typename Element,
std::enable_if_t<std::is_same<Element, struct_view>::value>* = nullptr>
std::unique_ptr<scalar> operator()(dictionary_column_view const& input,
scalar const& key,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr) const
std::enable_if_t<std::is_same<Element, dictionary32>::value or
std::is_same<Element, list_view>::value or
std::is_same<Element, struct_view>::value>* = nullptr>
std::unique_ptr<scalar> operator()(dictionary_column_view const&,
scalar const&,
rmm::cuda_stream_view,
rmm::mr::device_memory_resource*) const
{
CUDF_FAIL("struct_view column cannot be the keys column of a dictionary");
CUDF_FAIL(
"dictionary, list_view, and struct_view columns cannot be the keys column of a dictionary");
}
};

Expand Down Expand Up @@ -151,12 +136,12 @@ struct find_insert_index_fn {
std::enable_if_t<std::is_same<Element, dictionary32>::value or
std::is_same<Element, list_view>::value or
std::is_same<Element, struct_view>::value>* = nullptr>
std::unique_ptr<scalar> operator()(dictionary_column_view const& input,
scalar const& key,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr) const
std::unique_ptr<scalar> operator()(dictionary_column_view const&,
scalar const&,
rmm::cuda_stream_view,
rmm::mr::device_memory_resource*) const
{
CUDF_FAIL("column cannot be the keys for dictionary");
CUDF_FAIL("dictionary, list_view, and struct_view columns cannot be the keys for a dictionary");
}
};

Expand Down
9 changes: 3 additions & 6 deletions cpp/src/dictionary/set_keys.cu
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,12 @@ struct dispatch_compute_indices {
return result;
}

template <typename Element>
template <typename Element, typename... Args>
typename std::enable_if_t<!cudf::is_relationally_comparable<Element, Element>(),
std::unique_ptr<column>>
operator()(dictionary_column_view const& input,
column_view const& new_keys,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr)
operator()(Args&&...)
{
CUDF_FAIL("list_view dictionary set_keys not supported yet");
CUDF_FAIL("dictionary set_keys not supported for this column type");
}
};

Expand Down

0 comments on commit 975d22f

Please sign in to comment.