From 89c385607150663a99f95942474e961bffdc0701 Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Tue, 2 Jan 2024 21:55:20 -0500 Subject: [PATCH 1/3] Fixup ArborX access traits specialization not specialized enough --- core/src/Cabana_Experimental_NeighborList.hpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/src/Cabana_Experimental_NeighborList.hpp b/core/src/Cabana_Experimental_NeighborList.hpp index a5d9aa3ba..1ef0e771a 100644 --- a/core/src/Cabana_Experimental_NeighborList.hpp +++ b/core/src/Cabana_Experimental_NeighborList.hpp @@ -96,24 +96,26 @@ struct AccessTraits -struct AccessTraits +template +struct AccessTraits, + PredicatesTag> { + using Self = Cabana::Experimental::Impl::SubsliceAndRadius; //! Kokkos memory space. - using memory_space = typename SliceLike::memory_space; + using memory_space = typename Self::memory_space; //! Size type. - using size_type = typename SliceLike::size_type; + using size_type = typename Self::size_type; //! Get number of particles. - static KOKKOS_FUNCTION size_type size( SliceLike const& x ) + static KOKKOS_FUNCTION size_type size( Self const& x ) { return x.last - x.first; } //! Get the particle at the index. - static KOKKOS_FUNCTION auto get( SliceLike const& x, size_type i ) + static KOKKOS_FUNCTION auto get( Self const& x, size_type i ) { assert( i < size( x ) ); auto const point = - AccessTraits::get( + AccessTraits::get( x.slice, x.first + i ); return attach( intersects( Sphere{ point, x.radius } ), (int)i ); } From 765f32923b53cff59a3df1786536e12416a07061 Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Tue, 2 Jan 2024 21:55:59 -0500 Subject: [PATCH 2/3] Fixup remove const qualifier from predicates before passing to the access traits --- core/src/Cabana_Experimental_NeighborList.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/Cabana_Experimental_NeighborList.hpp b/core/src/Cabana_Experimental_NeighborList.hpp index 1ef0e771a..11eda2356 100644 --- a/core/src/Cabana_Experimental_NeighborList.hpp +++ b/core/src/Cabana_Experimental_NeighborList.hpp @@ -415,7 +415,7 @@ auto make2DNeighborList( ExecutionSpace space, Tag, Impl::makePredicates( coordinate_slice, first, last, radius ); auto const n_queries = - ArborX::AccessTraits, ArborX::PredicatesTag>::size( predicates ); Kokkos::View neighbors; From 12fac0b1033539df8c86546d0dc4bccdde696a6d Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:08:15 -0500 Subject: [PATCH 3/3] fixup: ArborX typedef and doxygen --- core/src/Cabana_Experimental_NeighborList.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/Cabana_Experimental_NeighborList.hpp b/core/src/Cabana_Experimental_NeighborList.hpp index 11eda2356..02a48b6c3 100644 --- a/core/src/Cabana_Experimental_NeighborList.hpp +++ b/core/src/Cabana_Experimental_NeighborList.hpp @@ -100,22 +100,23 @@ template struct AccessTraits, PredicatesTag> { - using Self = Cabana::Experimental::Impl::SubsliceAndRadius; + //! Slice wrapper with partial range and radius information. + using SliceLike = Cabana::Experimental::Impl::SubsliceAndRadius; //! Kokkos memory space. - using memory_space = typename Self::memory_space; + using memory_space = typename SliceLike::memory_space; //! Size type. - using size_type = typename Self::size_type; + using size_type = typename SliceLike::size_type; //! Get number of particles. - static KOKKOS_FUNCTION size_type size( Self const& x ) + static KOKKOS_FUNCTION size_type size( SliceLike const& x ) { return x.last - x.first; } //! Get the particle at the index. - static KOKKOS_FUNCTION auto get( Self const& x, size_type i ) + static KOKKOS_FUNCTION auto get( SliceLike const& x, size_type i ) { assert( i < size( x ) ); auto const point = - AccessTraits::get( + AccessTraits::get( x.slice, x.first + i ); return attach( intersects( Sphere{ point, x.radius } ), (int)i ); }