Skip to content

Commit

Permalink
Deprecate/remove += in boxes, deprecate reduction_identity
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed May 4, 2024
1 parent fa35339 commit a1ba239
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 35 deletions.
10 changes: 6 additions & 4 deletions src/geometry/ArborX_Box.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ struct Box
Details::KokkosExt::ArithmeticTraits::finite_min<float>::value,
Details::KokkosExt::ArithmeticTraits::finite_min<float>::value}};

KOKKOS_FUNCTION Box &operator+=(Box const &other)
[[deprecated("Use expand(Box, Box) instead.")]] KOKKOS_FUNCTION Box &
operator+=(Box const &other)
{
using Details::KokkosExt::max;
using Details::KokkosExt::min;
Expand All @@ -72,7 +73,8 @@ struct Box
return *this;
}

KOKKOS_FUNCTION Box &operator+=(Point const &point)
[[deprecated("Use expand(Box, Point) instead.")]] KOKKOS_FUNCTION Box &
operator+=(Point const &point)
{
using Details::KokkosExt::max;
using Details::KokkosExt::min;
Expand All @@ -88,7 +90,7 @@ struct Box
// FIXME Temporary workaround until we clarify requirements on the Kokkos side.
#if defined(KOKKOS_ENABLE_OPENMPTARGET) || defined(KOKKOS_ENABLE_SYCL)
private:
friend KOKKOS_FUNCTION Box operator+(Box box, Box const &other)
[[deprecated]] friend KOKKOS_FUNCTION Box operator+(Box box, Box const &other)
{
return box += other;
}
Expand All @@ -114,7 +116,7 @@ struct ArborX::GeometryTraits::coordinate_type<ArborX::Box>
} // namespace ArborX

template <>
struct Kokkos::reduction_identity<ArborX::Box>
struct [[deprecated]] Kokkos::reduction_identity<ArborX::Box>
{
KOKKOS_FUNCTION static ArborX::Box sum() { return {}; }
};
Expand Down
32 changes: 1 addition & 31 deletions src/geometry/ArborX_HyperBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,36 +63,6 @@ struct Box

Point<DIM, Coordinate> _min_corner;
Point<DIM, Coordinate> _max_corner;

template <typename OtherBox,
std::enable_if_t<GeometryTraits::is_box<OtherBox>{}> * = nullptr>
KOKKOS_FUNCTION auto &operator+=(OtherBox const &other)
{
using Details::KokkosExt::max;
using Details::KokkosExt::min;

for (int d = 0; d < DIM; ++d)
{
minCorner()[d] = min(minCorner()[d], other.minCorner()[d]);
maxCorner()[d] = max(maxCorner()[d], other.maxCorner()[d]);
}
return *this;
}

template <typename Point,
std::enable_if_t<GeometryTraits::is_point_v<Point>> * = nullptr>
KOKKOS_FUNCTION auto &operator+=(Point const &point)
{
using Details::KokkosExt::max;
using Details::KokkosExt::min;

for (int d = 0; d < DIM; ++d)
{
minCorner()[d] = min(minCorner()[d], point[d]);
maxCorner()[d] = max(maxCorner()[d], point[d]);
}
return *this;
}
};

} // namespace ArborX::ExperimentalHyperGeometry
Expand All @@ -117,7 +87,7 @@ struct ArborX::GeometryTraits::coordinate_type<
};

template <int DIM, typename Coordinate>
struct Kokkos::reduction_identity<
struct [[deprecated]] Kokkos::reduction_identity<
ArborX::ExperimentalHyperGeometry::Box<DIM, Coordinate>>
{
KOKKOS_FUNCTION static ArborX::ExperimentalHyperGeometry::Box<DIM, Coordinate>
Expand Down

0 comments on commit a1ba239

Please sign in to comment.