diff --git a/src/pcms/localization/point_search.cpp b/src/pcms/localization/point_search.cpp index 17bec5a0..97d025c1 100644 --- a/src/pcms/localization/point_search.cpp +++ b/src/pcms/localization/point_search.cpp @@ -44,10 +44,11 @@ AABBox<2> triangle_bbox(const Omega_h::Matrix<2, 3>& coords) } template -AABBox simplex_bbox(const Omega_h::Matrix& coords) +KOKKOS_INLINE_FUNCTION AABBox simplex_bbox( + const Omega_h::Matrix& coords) { - std::array max; - std::array min; + Kokkos::Array max; + Kokkos::Array min; for (int j = 0; j < dim; ++j) { max[j] = coords(j, 0); min[j] = coords(j, 0); @@ -59,8 +60,8 @@ AABBox simplex_bbox(const Omega_h::Matrix& coords) } } - std::array center; - std::array half_width; + Kokkos::Array center; + Kokkos::Array half_width; for (int j = 0; j < dim; ++j) { center[j] = (max[j] + min[j]) / 2.0; @@ -208,8 +209,7 @@ template * Check if a triangle element represented by 3 coordinates in two dimensions * intersects with a bounding box */ -[[nodiscard]] -KOKKOS_FUNCTION bool triangle_intersects_bbox( +[[nodiscard]] KOKKOS_FUNCTION bool triangle_intersects_bbox( const Omega_h::Matrix<2, 3>& coords, const AABBox<2>& bbox, Real fuzz) { // triangle and grid cell bounding box intersect @@ -234,8 +234,7 @@ KOKKOS_FUNCTION bool triangle_intersects_bbox( } template -[[nodiscard]] -KOKKOS_FUNCTION bool simplex_intersects_bbox( +[[nodiscard]] KOKKOS_FUNCTION bool simplex_intersects_bbox( const Omega_h::Matrix& coords, const AABBox& bbox) { return intersects(simplex_bbox(coords), bbox); diff --git a/src/pcms/utility/bounding_box.h b/src/pcms/utility/bounding_box.h index 9bc7ca0b..32a0c21b 100644 --- a/src/pcms/utility/bounding_box.h +++ b/src/pcms/utility/bounding_box.h @@ -10,9 +10,9 @@ template struct AABBox { static constexpr int dim = DIM; - std::array center; + Kokkos::Array center; // half length of bounding box - std::array half_width; + Kokkos::Array half_width; }; template diff --git a/src/pcms/utility/uniform_grid.h b/src/pcms/utility/uniform_grid.h index 5fa07a24..1a478fec 100644 --- a/src/pcms/utility/uniform_grid.h +++ b/src/pcms/utility/uniform_grid.h @@ -58,7 +58,7 @@ struct UniformGrid auto index = GetDimensionedIndex(idx); reverse(index); - std::array half_width, center; + Kokkos::Array half_width, center; for (size_t i = 0; i < dim; ++i) { half_width[i] = edge_length[i] / divisions[i] / 2;