-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cut down on the number of AccessTraits #967
Cut down on the number of AccessTraits #967
Conversation
7c3118f
to
15f9594
Compare
15f9594
to
cd40a3d
Compare
Updated the PR to include |
CUDA 11.0.3 has something weird
(aka This looks like a compiler bug, but I don't know how to fix. |
ArborX::Details::PairIndexVolume<Point>> | ||
bvh(exec_space, ArborX::Details::LegacyValues<Points, Point>{points}); |
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.
This changes the leaf node type as well, right?
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.
Yes. Instead of storing boxes, it will now store points. It was an oversight from some previous PRs.
src/ArborX_BruteForce.hpp
Outdated
@@ -63,23 +63,23 @@ class BasicBruteForce | |||
void query(ExecutionSpace const &space, Predicates const &predicates, | |||
Callback const &callback, Ignore = Ignore()) const; | |||
|
|||
template <typename ExecutionSpace, typename Predicates, | |||
template <typename ExecutionSpace, typename UserPredicates, |
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.
Why do you only change the name here and not in the other overloads? I would rather change the name in the implementation than in the interface. Maybe Predicates
->PredicatesAccessor
.
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.
I changed the name only here because we will wrap the provided predicates in AccessValues
. In other places, where no wrapping is done, it does not matter.
I don't feel strongly either way.
src/details/ArborX_AccessTraits.hpp
Outdated
@@ -199,16 +199,18 @@ void check_valid_access_traits(PrimitivesTag, Primitives const &, | |||
} | |||
} | |||
|
|||
template <typename Values> | |||
template <typename Values, typename Tag = PrimitivesTag> |
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.
If multiple tags can be used, I would rather not have a default value.
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.
I thought about it. The thing is that in this case it would increase of size of this patch, as I would also have to change all places where I used AccessValues
for primitives. I am not sure I want to do this.
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.
As long as it's a separate commit, it's pretty clean/clear.
The goal is to avoid using AccessTraits internally in ArborX, only at the user interface functions. In preparation for RangeTraits introduction.
aa590f6
to
e70bd45
Compare
Dropping |
Everything passes except HIP OOM. |
@@ -263,8 +239,8 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives, | |||
{ | |||
Kokkos::Profiling::pushRegion("ArborX::DBSCAN"); | |||
|
|||
using Access = AccessTraits<Primitives, PrimitivesTag>; | |||
using MemorySpace = typename Access::memory_space; | |||
using Points = Details::AccessValues<Primitives>; |
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 is the reasoning for the parameters naming in DBSCAN?
It went for Primitives/Points as compared to the spatial indexes where we did UserValues/Values.
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.
OK I see below that we assert the value type is point.
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.
Generally, I try to name the variables based on the context. In DBSCAN, the values are points and nothing else. Spatial indexes have to deal with unknown values, and I thus call them UserValues. I use Primitives as something that has valid AccessTraits as a rule of thumb, to indicate that it uses the old interface.
The goal is to avoid using
AccessTraits
internally in ArborX, only at the user interface functions. Motivated by #729, and in preparation forRangeTraits
introduction.