From ce5eb55185a6d702216f30556bc80edb43cee003 Mon Sep 17 00:00:00 2001 From: Andrey Prokopenko Date: Mon, 14 Oct 2024 10:42:50 -0400 Subject: [PATCH] Remove APIv1 convenience shortcuts from BVH and BruteForce --- src/spatial/ArborX_BruteForce.hpp | 35 ++++--------------------------- src/spatial/ArborX_LinearBVH.hpp | 35 ++++--------------------------- 2 files changed, 8 insertions(+), 62 deletions(-) diff --git a/src/spatial/ArborX_BruteForce.hpp b/src/spatial/ArborX_BruteForce.hpp index 09dd2b52b..0cdc3d5e7 100644 --- a/src/spatial/ArborX_BruteForce.hpp +++ b/src/spatial/ArborX_BruteForce.hpp @@ -81,37 +81,10 @@ class BruteForce using Predicates = Details::AccessValues; using Tag = typename Predicates::value_type::Tag; - // Automatically add LegacyDefaultCallback if - // 1. A user does not provide a callback - // 2. The index is constructed on PairValueIndex - // 3. The output value_type is an integral type - constexpr bool use_convenient_shortcut = []() { - if constexpr (!Kokkos::is_view_v>) - return false; - else if constexpr (!Details::is_pair_value_index_v) - return false; - else - return std::is_integral_v< - typename std::decay_t::value_type>; - }(); - - if constexpr (use_convenient_shortcut) - { - // Simplified way to get APIv1 result using APIv2 interface - Details::CrsGraphWrapperImpl::queryDispatch( - Tag{}, *this, space, Predicates{user_predicates}, - Details::LegacyDefaultCallback{}, // inject legacy callback arg - std::forward(callback_or_view), - std::forward(view), std::forward(args)...); - return; - } - else - { - Details::CrsGraphWrapperImpl::queryDispatch( - Tag{}, *this, space, Predicates{user_predicates}, - std::forward(callback_or_view), - std::forward(view), std::forward(args)...); - } + Details::CrsGraphWrapperImpl::queryDispatch( + Tag{}, *this, space, Predicates{user_predicates}, + std::forward(callback_or_view), + std::forward(view), std::forward(args)...); } KOKKOS_FUNCTION auto const &indexable_get() const diff --git a/src/spatial/ArborX_LinearBVH.hpp b/src/spatial/ArborX_LinearBVH.hpp index 29fa18fd4..b89b54478 100644 --- a/src/spatial/ArborX_LinearBVH.hpp +++ b/src/spatial/ArborX_LinearBVH.hpp @@ -103,37 +103,10 @@ class BoundingVolumeHierarchy using Predicates = Details::AccessValues; using Tag = typename Predicates::value_type::Tag; - // Automatically add LegacyDefaultCallback if - // 1. A user does not provide a callback - // 2. The index is constructed on PairValueIndex - // 3. The output value_type is an integral type - constexpr bool use_convenient_shortcut = []() { - if constexpr (!Kokkos::is_view_v>) - return false; - else if constexpr (!Details::is_pair_value_index_v) - return false; - else - return std::is_integral_v< - typename std::decay_t::value_type>; - }(); - - if constexpr (use_convenient_shortcut) - { - // Simplified way to get APIv1 result using APIv2 interface - Details::CrsGraphWrapperImpl::queryDispatch( - Tag{}, *this, space, Predicates{user_predicates}, - Details::LegacyDefaultCallback{}, // inject legacy callback arg - std::forward(callback_or_view), - std::forward(view), std::forward(args)...); - return; - } - else - { - Details::CrsGraphWrapperImpl::queryDispatch( - Tag{}, *this, space, Predicates{user_predicates}, - std::forward(callback_or_view), - std::forward(view), std::forward(args)...); - } + Details::CrsGraphWrapperImpl::queryDispatch( + Tag{}, *this, space, Predicates{user_predicates}, + std::forward(callback_or_view), + std::forward(view), std::forward(args)...); } template