-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to using invoke_result_t #939
Conversation
9e8dd1c
to
969e5d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
ArborX/test/tstCompileOnlyAccessTraits.cpp
Lines 85 to 88 in 5c55361
template <class V> | |
using deduce_point_t = | |
decltype(ArborX::AccessTraits<V, ArborX::PrimitivesTag>::get( | |
std::declval<V>(), 0)); |
ArborX/test/tstNeighborList.cpp
Line 68 in 5c55361
using size_type = decltype(Access::size(std::declval<Points const &>())); |
ArborX/benchmarks/dbscan/ArborX_DBSCANVerification.hpp
Lines 175 to 176 in 5c55361
decltype(Kokkos::create_mirror_view(Kokkos::HostSpace{}, | |
std::declval<LabelsView>())) |
ArborX/src/details/ArborX_DetailsBatchedQueries.hpp
Lines 96 to 97 in 5c55361
using T = std::decay_t<decltype(Access::get( | |
std::declval<Predicates const &>(), std::declval<int>()))>; |
ArborX/src/details/ArborX_DetailsDistributedTreeImpl.hpp
Lines 66 to 67 in 5c55361
using Geometry = | |
std::decay_t<decltype(getGeometry(std::declval<Predicate const &>()))>; |
using size_type = decltype(Access::size(std::declval<Predicates const &>())); |
ArborX/src/details/ArborX_DetailsDistributor.hpp
Lines 276 to 279 in 5c55361
using DestBufferMirrorViewType = | |
decltype(ArborX::Details::create_layout_right_mirror_view_and_copy( | |
space, std::declval<typename ImportView::memory_space>(), | |
std::declval<ExportViewWithoutMemoryTraits>())); |
I tried those (other than mirror views, those are different as they don't invoke anything), and they seem brittle and depend on compiler. Things like using size_type = decltype(Access::size(std::declval<Predicates const &>())); sometimes worked as using size_type = std::invoke_result_of<Access::size, Predicates>; sometimes as using size_type = std::invoke_result_of<decltype(Access::size), Predicates>; and sometimes didn't. So I limited this PR only to the absolutely straightforward cases. |
969e5d2
to
0650f3a
Compare
Rebased on master to take use #937. |
Couple builds failed due to disk space (SYCL and one of the CUDA). Otherwise, good. @dalg24 Do you have any reservations about merging this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunate that we mix style going forward but sure fine
0650f3a
to
f6b1b89
Compare
Rebased on |
HIP did not run, all others passed. Merging. |
We have few places that use a combination of
decltype
anddeclval
that could be simplified by usinginvoke_result_t
(available starting c++17).