Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions benchmarks/cluster/ArborX_DBSCANVerification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ struct IndexLabelCallback
}
};

template <typename ExecutionSpace, typename Primitives, typename Labels,
typename Coordinate>
template <typename ExecutionSpace, Details::Concepts::Primitives Primitives,
typename Labels, typename Coordinate>
bool verifyDBSCAN(ExecutionSpace exec_space, Primitives const &primitives,
Coordinate eps, int core_min_size, Labels const &labels,
bool verbose = false)
Expand Down Expand Up @@ -385,8 +385,8 @@ struct IndexRankLabelCoreCallback
}
};

template <typename ExecutionSpace, typename Primitives, typename Labels,
typename Coordinate>
template <typename ExecutionSpace, Details::Concepts::Primitives Primitives,
typename Labels, typename Coordinate>
bool verifyDBSCAN(MPI_Comm comm, ExecutionSpace exec_space,
Primitives const &primitives, Coordinate eps,
int core_min_size, Labels const &labels, bool verbose = false)
Expand Down
5 changes: 3 additions & 2 deletions src/cluster/ArborX_DBSCAN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct MixedBoxPrimitives

} // namespace Details

template <typename Primitives, typename PermuteFilter>
template <Details::Concepts::Primitives Primitives, typename PermuteFilter>
struct AccessTraits<
Details::PointsWithRadiusReorderedAndFiltered<Primitives, PermuteFilter>>
{
Expand Down Expand Up @@ -204,7 +204,8 @@ struct Parameters
};
} // namespace DBSCAN

template <typename ExecutionSpace, typename Primitives, typename Coordinate>
template <typename ExecutionSpace, Details::Concepts::Primitives Primitives,
typename Coordinate>
Kokkos::View<int *, typename AccessTraits<Primitives>::memory_space>
dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
Coordinate eps, int core_min_size,
Expand Down
4 changes: 2 additions & 2 deletions src/cluster/ArborX_DistributedDBSCAN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
namespace ArborX::Experimental
{

template <typename ExecutionSpace, typename Primitives, typename Coordinate,
typename Labels>
template <typename ExecutionSpace, Details::Concepts::Primitives Primitives,
typename Coordinate, typename Labels>
void dbscan(MPI_Comm comm, ExecutionSpace const &space,
Primitives const &primitives, Coordinate eps, int core_min_size,
Labels &labels,
Expand Down
2 changes: 1 addition & 1 deletion src/cluster/ArborX_HDBSCAN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace ArborX::Experimental
{

template <typename ExecutionSpace, typename Primitives>
template <typename ExecutionSpace, Details::Concepts::Primitives Primitives>
auto hdbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
int core_min_size,
DendrogramImplementation dendrogram_impl =
Expand Down
11 changes: 6 additions & 5 deletions src/cluster/detail/ArborX_FDBSCANDenseBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace ArborX
namespace Details
{

template <typename MemorySpace, typename Primitives, typename DenseCellOffsets,
typename Permutation>
template <typename MemorySpace, Details::Concepts::Primitives Primitives,
typename DenseCellOffsets, typename Permutation>
struct CountUpToN_DenseBox
{
using Coordinate =
Expand Down Expand Up @@ -92,8 +92,9 @@ struct CountUpToN_DenseBox
}
};

template <typename UnionFind, typename CorePointsType, typename Primitives,
typename DenseCellOffsets, typename Permutation>
template <typename UnionFind, typename CorePointsType,
Details::Concepts::Primitives Primitives, typename DenseCellOffsets,
typename Permutation>
struct FDBSCANDenseBoxCallback
{
using Coordinate =
Expand Down Expand Up @@ -187,7 +188,7 @@ struct FDBSCANDenseBoxCallback
}
};

template <typename ExecutionSpace, typename Primitives>
template <typename ExecutionSpace, Details::Concepts::Primitives Primitives>
Kokkos::View<size_t *, typename Primitives::memory_space> computeCellIndices(
ExecutionSpace const &exec_space, Primitives const &primitives,
CartesianGrid<GeometryTraits::dimension_v<typename Primitives::value_type>,
Expand Down
31 changes: 17 additions & 14 deletions src/distributed/detail/ArborX_DistributedTreeImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,64 +24,67 @@ struct DistributedTreeImpl
{
// spatial queries
template <typename DistributedTree, typename ExecutionSpace,
typename Predicates, typename Values, typename Offset>
Details::Concepts::Predicates Predicates, typename Values,
typename Offset>
static std::enable_if_t<Kokkos::is_view_v<Values> &&
Kokkos::is_view_v<Offset>>
queryDispatch(SpatialPredicateTag, DistributedTree const &tree,
ExecutionSpace const &space, Predicates const &queries,
Values &values, Offset &offset);

template <typename DistributedTree, typename ExecutionSpace,
typename Predicates, typename OutputView, typename OffsetView,
typename Callback>
Details::Concepts::Predicates Predicates, typename OutputView,
typename OffsetView, typename Callback>
static std::enable_if_t<Kokkos::is_view_v<OutputView> &&
Kokkos::is_view_v<OffsetView>>
queryDispatch(SpatialPredicateTag, DistributedTree const &tree,
ExecutionSpace const &space, Predicates const &queries,
Callback const &callback, OutputView &out, OffsetView &offset);

template <typename DistributedTree, typename ExecutionSpace,
typename Predicates, typename Callback>
Details::Concepts::Predicates Predicates, typename Callback>
static void queryDispatch(SpatialPredicateTag, DistributedTree const &tree,
ExecutionSpace const &space,
Predicates const &predicates,
Callback const &callback);

// nearest neighbors queries
template <typename DistributedTree, typename ExecutionSpace,
typename Predicates, typename Callback, typename Indices,
typename Offset>
Details::Concepts::Predicates Predicates, typename Callback,
typename Indices, typename Offset>
static void
queryDispatch2RoundImpl(NearestPredicateTag, DistributedTree const &tree,
ExecutionSpace const &space,
Predicates const &queries, Callback const &callback,
Indices &indices, Offset &offset);

template <typename DistributedTree, typename ExecutionSpace,
typename Predicates, typename Values, typename Offset>
Details::Concepts::Predicates Predicates, typename Values,
typename Offset>
static std::enable_if_t<Kokkos::is_view_v<Values> &&
Kokkos::is_view_v<Offset>>
queryDispatch(NearestPredicateTag tag, DistributedTree const &tree,
ExecutionSpace const &space, Predicates const &queries,
Values &values, Offset &offset);
template <typename Tree, typename ExecutionSpace, typename Predicates,
typename Callback, typename Values, typename Offset>
template <typename Tree, typename ExecutionSpace,
Details::Concepts::Predicates Predicates, typename Callback,
typename Values, typename Offset>
static std::enable_if_t<Kokkos::is_view_v<Values> &&
Kokkos::is_view_v<Offset>>
queryDispatch(NearestPredicateTag, Tree const &tree,
ExecutionSpace const &space, Predicates const &predicates,
Callback const &callback, Values &values, Offset &offset);

// nearest neighbors helpers
template <typename ExecutionSpace, typename Tree, typename Predicates,
typename Distances>
template <typename ExecutionSpace, typename Tree,
Details::Concepts::Predicates Predicates, typename Distances>
static void phaseI(ExecutionSpace const &space, Tree const &tree,
Predicates const &predicates,
Distances &farthest_distances);

template <typename ExecutionSpace, typename Tree, typename Predicates,
typename Callback, typename Distances, typename Offset,
typename Values>
template <typename ExecutionSpace, typename Tree,
Details::Concepts::Predicates Predicates, typename Callback,
typename Distances, typename Offset, typename Values>
static void phaseII(ExecutionSpace const &space, Tree const &tree,
Predicates const &predicates, Callback const &callback,
Distances &distances, Offset &offset, Values &values);
Expand Down
25 changes: 14 additions & 11 deletions src/distributed/detail/ArborX_DistributedTreeNearest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ struct PairValueDistance
Coordinate distance;
};

template <typename ExecutionSpace, typename Tree, typename Predicates,
typename Distances>
template <typename ExecutionSpace, typename Tree,
Details::Concepts::Predicates Predicates, typename Distances>
void DistributedTreeImpl::phaseI(ExecutionSpace const &space, Tree const &tree,
Predicates const &predicates,
Distances &farthest_distances)
Expand Down Expand Up @@ -124,9 +124,9 @@ void DistributedTreeImpl::phaseI(ExecutionSpace const &space, Tree const &tree,
});
}

template <typename ExecutionSpace, typename Tree, typename Predicates,
typename Callback, typename Distances, typename Offset,
typename Values>
template <typename ExecutionSpace, typename Tree,
Details::Concepts::Predicates Predicates, typename Callback,
typename Distances, typename Offset, typename Values>
void DistributedTreeImpl::phaseII(ExecutionSpace const &space, Tree const &tree,
Predicates const &predicates,
Callback const &callback,
Expand Down Expand Up @@ -174,8 +174,9 @@ void DistributedTreeImpl::phaseII(ExecutionSpace const &space, Tree const &tree,
DistributedTree::filterResults(space, predicates, distances, values, offset);
}

template <typename Tree, typename ExecutionSpace, typename Predicates,
typename Callback, typename Values, typename Offset>
template <typename Tree, typename ExecutionSpace,
Details::Concepts::Predicates Predicates, typename Callback,
typename Values, typename Offset>
void DistributedTreeImpl::queryDispatch2RoundImpl(
NearestPredicateTag, Tree const &tree, ExecutionSpace const &space,
Predicates const &predicates, Callback const &callback, Values &values,
Expand Down Expand Up @@ -222,8 +223,9 @@ void DistributedTreeImpl::queryDispatch2RoundImpl(
values);
}

template <typename Tree, typename ExecutionSpace, typename Predicates,
typename Values, typename Offset>
template <typename Tree, typename ExecutionSpace,
Details::Concepts::Predicates Predicates, typename Values,
typename Offset>
std::enable_if_t<Kokkos::is_view_v<Values> && Kokkos::is_view_v<Offset>>
DistributedTreeImpl::queryDispatch(NearestPredicateTag tag, Tree const &tree,
ExecutionSpace const &space,
Expand All @@ -234,8 +236,9 @@ DistributedTreeImpl::queryDispatch(NearestPredicateTag tag, Tree const &tree,
values, offset);
}

template <typename Tree, typename ExecutionSpace, typename Predicates,
typename Callback, typename Values, typename Offset>
template <typename Tree, typename ExecutionSpace,
Details::Concepts::Predicates Predicates, typename Callback,
typename Values, typename Offset>
std::enable_if_t<Kokkos::is_view_v<Values> && Kokkos::is_view_v<Offset>>
DistributedTreeImpl::queryDispatch(NearestPredicateTag, Tree const &tree,
ExecutionSpace const &space,
Expand Down
14 changes: 8 additions & 6 deletions src/distributed/detail/ArborX_DistributedTreeSpatial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
namespace ArborX::Details
{

template <typename Tree, typename ExecutionSpace, typename Predicates,
typename Values, typename Offset, typename Callback>
template <typename Tree, typename ExecutionSpace,
Details::Concepts::Predicates Predicates, typename Values,
typename Offset, typename Callback>
std::enable_if_t<Kokkos::is_view_v<Values> && Kokkos::is_view_v<Offset>>
DistributedTreeImpl::queryDispatch(SpatialPredicateTag, Tree const &tree,
ExecutionSpace const &space,
Expand Down Expand Up @@ -58,8 +59,8 @@ DistributedTreeImpl::queryDispatch(SpatialPredicateTag, Tree const &tree,
intersected_ranks, offset, values);
}

template <typename Tree, typename ExecutionSpace, typename Predicates,
typename Callback>
template <typename Tree, typename ExecutionSpace,
Details::Concepts::Predicates Predicates, typename Callback>
void DistributedTreeImpl::queryDispatch(SpatialPredicateTag, Tree const &tree,
ExecutionSpace const &space,
Predicates const &predicates,
Expand Down Expand Up @@ -94,8 +95,9 @@ void DistributedTreeImpl::queryDispatch(SpatialPredicateTag, Tree const &tree,
bottom_tree.query(space, fwd_predicates, callback);
}

template <typename Tree, typename ExecutionSpace, typename Predicates,
typename Values, typename Offset>
template <typename Tree, typename ExecutionSpace,
Details::Concepts::Predicates Predicates, typename Values,
typename Offset>
std::enable_if_t<Kokkos::is_view_v<Values> && Kokkos::is_view_v<Offset>>
DistributedTreeImpl::queryDispatch(SpatialPredicateTag, Tree const &tree,
ExecutionSpace const &space,
Expand Down
19 changes: 11 additions & 8 deletions src/distributed/detail/ArborX_DistributedTreeUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <ArborX_Config.hpp>

#include <detail/ArborX_AccessTraits.hpp>
#include <detail/ArborX_Distributor.hpp>
#include <detail/ArborX_PairValueIndex.hpp>
#include <kokkos_ext/ArborX_KokkosExtSort.hpp>
Expand Down Expand Up @@ -45,8 +46,9 @@ void countResults(ExecutionSpace const &space, int n_queries,
KokkosExt::exclusive_scan(space, offset, offset, 0);
}

template <typename ExecutionSpace, typename Predicates, typename RanksTo,
typename Offset, typename FwdQueries, typename FwdIds, typename Ranks>
template <typename ExecutionSpace, Details::Concepts::Predicates Predicates,
typename RanksTo, typename Offset, typename FwdQueries,
typename FwdIds, typename Ranks>
void forwardQueries(MPI_Comm comm, ExecutionSpace const &space,
Predicates const &queries, RanksTo const &ranks_to,
Offset const &offset, FwdQueries &fwd_queries,
Expand Down Expand Up @@ -112,8 +114,8 @@ void forwardQueries(MPI_Comm comm, ExecutionSpace const &space,
}
}

template <typename ExecutionSpace, typename Predicates, typename RanksTo,
typename Offset, typename FwdQueries>
template <typename ExecutionSpace, Details::Concepts::Predicates Predicates,
typename RanksTo, typename Offset, typename FwdQueries>
void forwardQueries(MPI_Comm comm, ExecutionSpace const &space,
Predicates const &queries, RanksTo const &ranks_to,
Offset const &offset, FwdQueries &fwd_queries)
Expand Down Expand Up @@ -221,8 +223,9 @@ void communicateResultsBack(MPI_Comm comm, ExecutionSpace const &space,
}
}

template <typename ExecutionSpace, typename BottomTree, typename Predicates,
typename Callback, typename RanksTo, typename Offset, typename Values>
template <typename ExecutionSpace, typename BottomTree,
Details::Concepts::Predicates Predicates, typename Callback,
typename RanksTo, typename Offset, typename Values>
void forwardQueriesAndCommunicateResults(
MPI_Comm comm, ExecutionSpace const &space, BottomTree const &bottom_tree,
Predicates const &predicates, Callback const &callback,
Expand Down Expand Up @@ -259,8 +262,8 @@ void forwardQueriesAndCommunicateResults(
Kokkos::Profiling::popRegion();
}

template <typename ExecutionSpace, typename Predicates, typename Distances,
typename Values, typename Offset>
template <typename ExecutionSpace, Details::Concepts::Predicates Predicates,
typename Distances, typename Values, typename Offset>
void filterResults(ExecutionSpace const &space, Predicates const &queries,
Distances const &distances, Values &values, Offset &offset)
{
Expand Down
8 changes: 4 additions & 4 deletions src/interpolation/ArborX_InterpMovingLeastSquares.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ template <typename MemorySpace, typename FloatingCalculationType = double>
class MovingLeastSquares
{
public:
template <typename ExecutionSpace, typename SourcePoints,
typename TargetPoints, typename CRBFunc = CRBF::Wendland<0>,
template <typename ExecutionSpace,
::ArborX::Details::Concepts::AccessTraits SourcePoints,
::ArborX::Details::Concepts::AccessTraits TargetPoints,
typename CRBFunc = CRBF::Wendland<0>,
typename PolynomialDegree = PolynomialDegree<2>>
MovingLeastSquares(ExecutionSpace const &space,
SourcePoints const &source_points,
Expand All @@ -80,7 +82,6 @@ class MovingLeastSquares
"Memory space must be accessible from the execution space");

// SourcePoints is an access trait of points
ArborX::Details::check_valid_access_traits(source_points);
using SourceAccess = ArborX::Details::AccessValues<SourcePoints>;
static_assert(
KokkosExt::is_accessible_from<typename SourceAccess::memory_space,
Expand All @@ -93,7 +94,6 @@ class MovingLeastSquares
static constexpr int dimension = GeometryTraits::dimension_v<SourcePoint>;

// TargetPoints is an access trait of points
ArborX::Details::check_valid_access_traits(target_points);
using TargetAccess = ArborX::Details::AccessValues<TargetPoints>;
static_assert(
KokkosExt::is_accessible_from<typename TargetAccess::memory_space,
Expand Down
Loading