From c64e572716b09c7e537afb728eaa4e0a94aaf2d5 Mon Sep 17 00:00:00 2001 From: Andrey Prokopenko Date: Wed, 27 Dec 2023 23:41:53 -0500 Subject: [PATCH] Modernize space filling curve checks --- src/ArborX_LinearBVH.hpp | 5 ++-- src/details/ArborX_DetailsBatchedQueries.hpp | 3 +-- src/details/ArborX_SpaceFillingCurves.hpp | 26 +++++++------------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/ArborX_LinearBVH.hpp b/src/ArborX_LinearBVH.hpp index 6e7e51fe8..6d17e19d3 100644 --- a/src/ArborX_LinearBVH.hpp +++ b/src/ArborX_LinearBVH.hpp @@ -307,9 +307,8 @@ BoundingVolumeHierarchy:: Kokkos::Profiling::pushRegion("ArborX::BVH::BVH::compute_linear_ordering"); // Map indexables from multidimensional domain to one-dimensional interval - using LinearOrderingValueType = Kokkos::detected_t< - Details::SpaceFillingCurveProjectionArchetypeExpression, - SpaceFillingCurve, decltype(bbox), indexable_type>; + using LinearOrderingValueType = + std::invoke_result_t; Kokkos::View linear_ordering_indices( Kokkos::view_alloc(space, Kokkos::WithoutInitializing, "ArborX::BVH::BVH::linear_ordering"), diff --git a/src/details/ArborX_DetailsBatchedQueries.hpp b/src/details/ArborX_DetailsBatchedQueries.hpp index 0dc778f45..b06bd848d 100644 --- a/src/details/ArborX_DetailsBatchedQueries.hpp +++ b/src/details/ArborX_DetailsBatchedQueries.hpp @@ -57,8 +57,7 @@ struct BatchedQueries using Point = std::decay_t; using LinearOrderingValueType = - Kokkos::detected_t; + std::invoke_result_t; Kokkos::View linear_ordering_indices( Kokkos::view_alloc(space, Kokkos::WithoutInitializing, "ArborX::BVH::query::linear_ordering"), diff --git a/src/details/ArborX_SpaceFillingCurves.hpp b/src/details/ArborX_SpaceFillingCurves.hpp index dbe19aef5..bc27ded2e 100644 --- a/src/details/ArborX_SpaceFillingCurves.hpp +++ b/src/details/ArborX_SpaceFillingCurves.hpp @@ -20,6 +20,8 @@ #include #include +#include + namespace ArborX { namespace Experimental @@ -74,32 +76,22 @@ struct Morton64 namespace Details { -template -using SpaceFillingCurveProjectionArchetypeExpression = - std::invoke_result_t; - template void check_valid_space_filling_curve(SpaceFillingCurve const &) { using Point = ExperimentalHyperGeometry::Point; using Box = ExperimentalHyperGeometry::Box; - static_assert( - Kokkos::is_detected::value); - static_assert( - Kokkos::is_detected::value); + static_assert(std::is_invocable_v); + static_assert(std::is_invocable_v); + using OrderValueType = - Kokkos::detected_t; + std::invoke_result_t; static_assert(std::is_same::value || std::is_same::value); - static_assert( - std::is_same< - OrderValueType, - Kokkos::detected_t>::value); + static_assert(std::is_same_v< + OrderValueType, + std::invoke_result_t>); } } // namespace Details