-
Notifications
You must be signed in to change notification settings - Fork 41
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
Unify old and new interfaces in a single class #970
Conversation
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.
Still undecided what to do with ArborX::BVH
alias. It could be extended to all template arguments, but that would require changing many things in testing (ArborXTest_TreeTypeTraits.hppp
and such). Benchmarks and examples would be fine.
Updated the alias.
class BruteForce | ||
: public BasicBruteForce<MemorySpace, Details::PairIndexVolume<Box>, | ||
Details::DefaultIndexableGetter, BoundingVolume> | ||
template <typename MemorySpace> |
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 number of template arguments and actually breaks backwards compatibility if someone was using ArborX::BruteForce<MemorySpace, BoundingVolume>
. But to my knowledge, no one had done it, as we have not documented it.
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 think that is fine.
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.
The approach here looks good enough to me.
f59c7ee
to
6516ac3
Compare
class BruteForce | ||
: public BasicBruteForce<MemorySpace, Details::PairIndexVolume<Box>, | ||
Details::DefaultIndexableGetter, BoundingVolume> | ||
template <typename MemorySpace> |
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 think that is fine.
: public BasicBruteForce<MemorySpace, Details::PairIndexVolume<Box>, | ||
Details::DefaultIndexableGetter, BoundingVolume> | ||
template <typename MemorySpace> | ||
class BruteForce<MemorySpace, Details::LegacyDefaultTemplateValue, |
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 did you give a default template argument to Value
in the primary template then?
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.
So that ArborX::BruteForce<MemorySpace>
and ArborX::BoundingVolumeHierarchy<MemorySpace>
still works. If you try to remove it, you get things like
test/tstQueryTreeCallbacks_BF.cpp:5:39: error:
too few template arguments for class template 'BruteForce'
using ArborX_BruteForce_Box = ArborX::BruteForce<MemorySpace>;
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.
template <class MS>
using BF = ArborX::BruteForce<MemorySpace>;
template <class MemorySpace>
using ArborX_BruteForce_Box = BF<MemorySpace>;
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 don't understand it. If a user had a code like ArborX::BruteForce<MemorySpace> blah
, your code does nothing to it. For example, examples/brute_force
would simply break.
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.
Still looks good to me.
Just looking for feedback for this way of unification. Essentially, it introduced an (undocumented and unused) default value to the
Value
template argument, and then hacks the inherited legacy class based on that.