Skip to content

Commit

Permalink
Move OrderedSpatialPredicateTag where it belongs that is namespace …
Browse files Browse the repository at this point in the history
…`Details::` (arborx#1074)

Move {Experimental:: -> Details::}OrderedSpatialPredicateTag

The predicate tags really are implementation details and do not belong
to the Experimental:: namespace.
  • Loading branch information
dalg24 committed Apr 19, 2024
1 parent d264a9d commit a0279ca
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/ArborX_LinearBVH.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ void BoundingVolumeHierarchy<
{
profiling_prefix += "nearest";
}
else if constexpr (std::is_same_v<Tag,
Experimental::OrderedSpatialPredicateTag>)
else if constexpr (std::is_same_v<Tag, Details::OrderedSpatialPredicateTag>)
{
profiling_prefix += "ordered_spatial";
}
Expand Down
3 changes: 1 addition & 2 deletions src/details/ArborX_Callbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ void check_valid_callback(Callback const &callback, Predicates const &)

static_assert(
!(std::is_same_v<PredicateTag, SpatialPredicateTag> ||
std::is_same_v<PredicateTag,
Experimental::OrderedSpatialPredicateTag>) ||
std::is_same_v<PredicateTag, OrderedSpatialPredicateTag>) ||
(std::is_same_v<
CallbackTreeTraversalControl,
std::invoke_result_t<Callback const &, Predicate, Value>> ||
Expand Down
5 changes: 2 additions & 3 deletions src/details/ArborX_DetailsCrsGraphWrapperImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ struct Iota
template <typename Tag, typename ExecutionSpace, typename Predicates,
typename OffsetView, typename OutView>
std::enable_if_t<std::is_same_v<Tag, SpatialPredicateTag> ||
std::is_same_v<Tag, Experimental::OrderedSpatialPredicateTag>>
std::is_same_v<Tag, OrderedSpatialPredicateTag>>
allocateAndInitializeStorage(Tag, ExecutionSpace const &space,
Predicates const &predicates, OffsetView &offset,
OutView &out, int buffer_size)
Expand Down Expand Up @@ -354,8 +354,7 @@ queryDispatch(Tag, Tree const &tree, ExecutionSpace const &space,
{
profiling_prefix += "spatial";
}
else if constexpr (std::is_same_v<Tag,
Experimental::OrderedSpatialPredicateTag>)
else if constexpr (std::is_same_v<Tag, OrderedSpatialPredicateTag>)
{
profiling_prefix += "ordered_spatial";
}
Expand Down
3 changes: 1 addition & 2 deletions src/details/ArborX_DetailsTreeTraversal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ struct TreeTraversal<BVH, Predicates, Callback, NearestPredicateTag>
};

template <class BVH, class Predicates, class Callback>
struct TreeTraversal<BVH, Predicates, Callback,
Experimental::OrderedSpatialPredicateTag>
struct TreeTraversal<BVH, Predicates, Callback, OrderedSpatialPredicateTag>
{
BVH _bvh;
Predicates _predicates;
Expand Down
10 changes: 2 additions & 8 deletions src/details/ArborX_Predicates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,17 @@ struct NearestPredicateTag
{};
struct SpatialPredicateTag
{};
} // namespace Details
namespace Experimental
{
struct OrderedSpatialPredicateTag
{};
} // namespace Experimental

namespace Details
{
// nvcc has problems with using std::interal_constant here.
template <typename PredicateTag>
struct is_valid_predicate_tag
{
static constexpr bool value =
std::is_same<PredicateTag, SpatialPredicateTag>{} ||
std::is_same<PredicateTag, NearestPredicateTag>{} ||
std::is_same<PredicateTag, Experimental::OrderedSpatialPredicateTag>{};
std::is_same<PredicateTag, OrderedSpatialPredicateTag>{};
};
} // namespace Details

Expand Down Expand Up @@ -92,7 +86,7 @@ namespace Experimental
template <typename Geometry>
struct OrderedSpatial
{
using Tag = Experimental::OrderedSpatialPredicateTag;
using Tag = Details::OrderedSpatialPredicateTag;

KOKKOS_DEFAULTED_FUNCTION
OrderedSpatial() = default;
Expand Down

0 comments on commit a0279ca

Please sign in to comment.