Skip to content

Commit

Permalink
Merge pull request #326 from dalg24/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop authored May 29, 2020
2 parents 32835a5 + facb831 commit 5d8f04e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
16 changes: 8 additions & 8 deletions src/ArborX_LinearBVH.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <ArborX_DetailsKokkosExt.hpp>
#include <ArborX_DetailsNode.hpp>
#include <ArborX_DetailsSortUtils.hpp>
#include <ArborX_DetailsTags.hpp>
#include <ArborX_DetailsTreeConstruction.hpp>

#include <Kokkos_Core.hpp>
Expand Down Expand Up @@ -47,12 +46,13 @@ class BoundingVolumeHierarchy
BoundingVolumeHierarchy(ExecutionSpace const &space,
Primitives const &primitives);

KOKKOS_INLINE_FUNCTION
KOKKOS_FUNCTION
size_type size() const noexcept { return _size; }

KOKKOS_INLINE_FUNCTION
KOKKOS_FUNCTION
bool empty() const noexcept { return size() == 0; }

KOKKOS_FUNCTION
bounding_volume_type bounds() const noexcept { return _bounds; }

template <typename ExecutionSpace, typename Predicates,
Expand Down Expand Up @@ -100,22 +100,22 @@ class BoundingVolumeHierarchy
std::make_pair(size() - 1, 2 * size() - 1));
}

KOKKOS_INLINE_FUNCTION
KOKKOS_FUNCTION
Node const *getRoot() const { return _internal_and_leaf_nodes.data(); }

KOKKOS_INLINE_FUNCTION
KOKKOS_FUNCTION
Node *getRoot() { return _internal_and_leaf_nodes.data(); }

KOKKOS_INLINE_FUNCTION
KOKKOS_FUNCTION
Node const *getNodePtr(int i) const { return &_internal_and_leaf_nodes(i); }

KOKKOS_INLINE_FUNCTION
KOKKOS_FUNCTION
bounding_volume_type const &getBoundingVolume(Node const *node) const
{
return node->bounding_box;
}

KOKKOS_INLINE_FUNCTION
KOKKOS_FUNCTION
bounding_volume_type &getBoundingVolume(Node *node)
{
return node->bounding_box;
Expand Down
13 changes: 1 addition & 12 deletions src/details/ArborX_DetailsBatchedQueries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ struct BatchedQueries
sortQueriesAlongZOrderCurve(ExecutionSpace const &space,
Box const &scene_bounding_box,
Predicates const &predicates)
{
Kokkos::View<Box, DeviceType> bounds("bounds");
Kokkos::deep_copy(space, bounds, scene_bounding_box);
return sortQueriesAlongZOrderCurve(space, bounds, predicates);
}

template <typename ExecutionSpace, typename Predicates>
static Kokkos::View<unsigned int *, DeviceType>
sortQueriesAlongZOrderCurve(ExecutionSpace const &space,
Kokkos::View<Box const, DeviceType> bounds,
Predicates const &predicates)
{
using Access = Traits::Access<Predicates, Traits::PredicatesTag>;
auto const n_queries = Access::size(predicates);
Expand All @@ -75,7 +64,7 @@ struct BatchedQueries
KOKKOS_LAMBDA(int i) {
Point xyz =
Details::returnCentroid(getGeometry(Access::get(predicates, i)));
translateAndScale(xyz, xyz, bounds());
translateAndScale(xyz, xyz, scene_bounding_box);
morton_codes(i) = morton3D(xyz[0], xyz[1], xyz[2]);
});

Expand Down

0 comments on commit 5d8f04e

Please sign in to comment.