Skip to content

Commit

Permalink
Rename Details::{ -> AccessTraits}Helper
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Jun 10, 2020
1 parent 7acf30a commit 251d784
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/ArborX_DistributedSearchTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class DistributedSearchTree
{
static_assert(Kokkos::is_execution_space<ExecutionSpace>::value, "");
using Access = AccessTraits<Predicates, PredicatesTag>;
using Tag = typename Details::Helper<Access>::tag;
using Tag = typename Details::AccessTraitsHelper<Access>::tag;
using DeviceType = Kokkos::Device<ExecutionSpace, MemorySpace>;
Details::DistributedSearchTreeImpl<DeviceType>::queryDispatch(
Tag{}, *this, space, predicates, std::forward<Args>(args)...);
Expand Down
2 changes: 1 addition & 1 deletion src/ArborX_LinearBVH.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BoundingVolumeHierarchy
Details::check_valid_callback_if_first_argument_is_not_a_view(
callback_or_view, predicates, view);

using Tag = typename Details::Helper<Access>::tag;
using Tag = typename Details::AccessTraitsHelper<Access>::tag;

Details::BoundingVolumeHierarchyImpl::queryDispatch(
Tag{}, *this, space, predicates,
Expand Down
4 changes: 2 additions & 2 deletions src/details/ArborX_AccessTraits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ using AccessTraitsGetArchetypeExpression = decltype(
Traits::get(std::declval<first_template_parameter_t<Traits> const &>(), 0));

template <typename Access>
struct Helper
struct AccessTraitsHelper
{
// Deduce return type of get()
using type =
Expand Down Expand Up @@ -124,7 +124,7 @@ void check_valid_access_traits(PredicatesTag, Predicates const &)
"AccessTraits<Predicates,PredicatesTag> must define "
"'get()' static member function");

using Tag = typename Helper<Access>::tag;
using Tag = typename AccessTraitsHelper<Access>::tag;
static_assert(std::is_same<Tag, NearestPredicateTag>{} ||
std::is_same<Tag, SpatialPredicateTag>{},
"Invalid tag for the predicates");
Expand Down
4 changes: 2 additions & 2 deletions src/details/ArborX_Callbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ void check_valid_callback(Callback const &, Predicates const &,
#endif

using Access = AccessTraits<Predicates, PredicatesTag>;
using PredicateTag = typename Helper<Access>::tag;
using Predicate = typename Helper<Access>::type;
using PredicateTag = typename AccessTraitsHelper<Access>::tag;
using Predicate = typename AccessTraitsHelper<Access>::type;

static_assert(
(std::is_same<PredicateTag, SpatialPredicateTag>{} &&
Expand Down
6 changes: 3 additions & 3 deletions src/details/ArborX_DetailsBatchedQueries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ struct BatchedQueries
applyPermutation(ExecutionSpace const &space,
Kokkos::View<unsigned int const *, DeviceType> permute,
Predicates const &v)
-> Kokkos::View<
typename Helper<AccessTraits<Predicates, PredicatesTag>>::type *,
DeviceType>
-> Kokkos::View<typename AccessTraitsHelper<
AccessTraits<Predicates, PredicatesTag>>::type *,
DeviceType>
{
using Access = AccessTraits<Predicates, PredicatesTag>;
auto const n = Access::size(v);
Expand Down
2 changes: 1 addition & 1 deletion src/details/ArborX_DetailsBufferOptimization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct InsertGenerator

using ValueType = typename OutputView::value_type;
using Access = AccessTraits<Predicates, PredicatesTag>;
using Tag = typename Helper<Access>::tag;
using Tag = typename AccessTraitsHelper<Access>::tag;

template <typename U = PassTag, typename V = Tag>
KOKKOS_FUNCTION std::enable_if_t<std::is_same<U, FirstPassTag>{} &&
Expand Down
7 changes: 4 additions & 3 deletions src/details/ArborX_DetailsDistributedSearchTreeImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void DistributedSearchTreeImpl<DeviceType>::queryDispatch(

// Forward queries
using Access = AccessTraits<Predicates, PredicatesTag>;
using Query = typename Helper<Access>::type;
using Query = typename AccessTraitsHelper<Access>::type;
Kokkos::View<int *, DeviceType> ids("query_ids", 0);
Kokkos::View<Query *, DeviceType> fwd_queries("fwd_queries", 0);
forwardQueries(comm, space, queries, indices, offset, fwd_queries, ids,
Expand Down Expand Up @@ -481,7 +481,7 @@ void DistributedSearchTreeImpl<DeviceType>::queryDispatch(

// Forward queries
using Access = AccessTraits<Predicates, PredicatesTag>;
using Query = typename Helper<Access>::type;
using Query = typename AccessTraitsHelper<Access>::type;
Kokkos::View<int *, DeviceType> ids("query_ids", 0);
Kokkos::View<Query *, DeviceType> fwd_queries("fwd_queries", 0);
forwardQueries(comm, space, queries, indices, offset, fwd_queries, ids,
Expand Down Expand Up @@ -569,7 +569,8 @@ void DistributedSearchTreeImpl<DeviceType>::forwardQueries(
int const n_exports = lastElement(offset);
int const n_imports = distributor.createFromSends(space, indices);

static_assert(std::is_same<Query, typename Helper<Access>::type>::value, "");
static_assert(
std::is_same<Query, typename AccessTraitsHelper<Access>::type>{}, "");
Kokkos::View<Query *, DeviceType> exports(
Kokkos::ViewAllocateWithoutInitializing("queries"), n_exports);
Kokkos::parallel_for(ARBORX_MARK_REGION("forward_queries_fill_buffer"),
Expand Down
4 changes: 2 additions & 2 deletions src/details/ArborX_DetailsTreeConstruction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ inline void assignMortonCodes(
auto const n = Access::size(primitives);
ARBORX_ASSERT(morton_codes.extent(0) == n);

using Tag = typename Helper<Access>::tag;
using Tag = typename AccessTraitsHelper<Access>::tag;
assignMortonCodesDispatch(Tag{}, space, primitives, morton_codes,
scene_bounding_box);
}
Expand Down Expand Up @@ -309,7 +309,7 @@ inline void initializeLeafNodes(
ARBORX_ASSERT(permutation_indices.extent(0) == n);
ARBORX_ASSERT(leaf_nodes.extent(0) == n);

using Tag = typename Helper<Access>::tag;
using Tag = typename AccessTraitsHelper<Access>::tag;
initializeLeafNodesDispatch(Tag{}, space, primitives, permutation_indices,
leaf_nodes);
}
Expand Down
2 changes: 1 addition & 1 deletion src/details/ArborX_DetailsTreeTraversal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ void traverse(ExecutionSpace const &space, BVH const &bvh,
Predicates const &predicates, Callback const &callback)
{
using Access = AccessTraits<Predicates, PredicatesTag>;
using Tag = typename Helper<Access>::tag;
using Tag = typename AccessTraitsHelper<Access>::tag;
TreeTraversal<BVH, Predicates, Callback, Tag>(space, bvh, predicates,
callback);
}
Expand Down

0 comments on commit 251d784

Please sign in to comment.