Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compile warning in search.cu (NVIDIA#10827)
Compile warning introduced with merge of PR NVIDIA#10802 ``` 10 warnings like this: 12:43:23 $SRC_DIR/cpp/src/search/search.cu(108): warning NVIDIA#177-D: parameter "args" was declared but never referenced 12:43:23 detected during instantiation of function "lambda [](auto &&...)->auto [with <auto-1>=<rmm::exec_policy, const thrust::counting_iterator<cudf::size_type, thrust::use_default, thrust::use_default, thrust::use_default> &, thrust::counting_iterator<cudf::size_type, thrust::use_default, thrust::use_default, thrust::use_default>, const thrust::counting_iterator<cudf::size_type, thrust::use_default, thrust::use_default, thrust::use_default> &, thrust::counting_iterator<cudf::size_type, thrust::use_default, thrust::use_default, thrust::use_default>, cudf::size_type *const &, const cudf::row_lexicographic_comparator<cudf::nullate::DYNAMIC> &>]" 12:43:23 (121): here ``` Line 108 has a lambda refactoring that seems to confuse the compiler. ``` auto const do_search = [find_first](auto&&... args) { if (find_first) { thrust::lower_bound(std::forward<decltype(args)>(args)...); } else { thrust::upper_bound(std::forward<decltype(args)>(args)...); } }; do_search(rmm::exec_policy(stream), count_it, count_it + haystack.num_rows(), count_it, count_it + needles.num_rows(), out_it, comp); ``` The warning is wrong and the compiler generates the correct code so this is likely a compiler bug. This PR fixes the warning by replacing the lambda with an if statement. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Nghia Truong (https://github.com/ttnghia) - Yunsong Wang (https://github.com/PointKernel) URL: rapidsai/cudf#10827
- Loading branch information