-
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 spheres to new hyper-dimensional ones #1146
Conversation
@@ -55,7 +55,7 @@ struct ArborX::AccessTraits<Spheres, ArborX::PredicatesTag> | |||
static KOKKOS_FUNCTION auto get(Spheres const &d, std::size_t i) | |||
{ | |||
return ArborX::intersects( | |||
ArborX::Sphere{{{d.d_x[i], d.d_y[i], d.d_z[i]}}, d.d_r[i]}); | |||
ArborX::Sphere{ArborX::Point{d.d_x[i], d.d_y[i], d.d_z[i]}, d.d_r[i]}); |
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.
Much nicer!
@@ -110,8 +110,7 @@ struct approx_expand_by_radius<PointTag, Point> | |||
{ | |||
constexpr int DIM = GeometryTraits::dimension_v<Box>; | |||
using Coordinate = GeometryTraits::coordinate_type_t<Point>; | |||
return ExperimentalHyperGeometry::Sphere<DIM, Coordinate>{ | |||
Kokkos::bit_cast<::ArborX::Point<DIM, Coordinate>>(point), r}; | |||
return Sphere{Kokkos::bit_cast<::ArborX::Point<DIM, Coordinate>>(point), r}; |
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.
Is the bit_cast
still necessary here?
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. This geometries may come from users. We do an implicit undocumented cast here as we don't have a well defined concept of a point. It's ok for now but will need to change in the future.
auto const &hyper_point = | ||
reinterpret_cast<::ArborX::Point<dim, Coordinate> const &>(pair.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.
Do you still need the reinterpret_cast
?
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.
Could be replaced by bit_cast
but the issue is same as above: user data.
auto const &hyper_point = | ||
reinterpret_cast<::ArborX::Point<dim, Coordinate> const &>(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.
Same here.
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.
User data.
auto const &hyper_point = | ||
reinterpret_cast<::ArborX::Point<dim> const &>(pair.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.
Same here.
auto const &hyper_point = | ||
reinterpret_cast<::ArborX::Point<dim> const &>(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.
Same here.
So, all the comments are about I think this is a larger discussion and is outside of the scope of this PR. |
@masterleinad I have a patch to address the conversion routines. Will do a separate PR after this one is merged. |
No description provided.