16#ifndef CABANA_EXECUTIONPOLICY_HPP
17#define CABANA_EXECUTIONPOLICY_HPP
21#include <Kokkos_Core.hpp>
38template <
int VectorLength,
class IndexType>
42 KOKKOS_INLINE_FUNCTION
43 static constexpr IndexType structBegin(
const IndexType begin )
45 return Index<VectorLength>::s( begin );
48 KOKKOS_INLINE_FUNCTION
49 static constexpr IndexType structEnd(
const IndexType end )
56 return ( 0 == Index<VectorLength>::a( end ) )
57 ? Index<VectorLength>::s( end )
58 : Index<VectorLength>::s( end ) + 1;
61 KOKKOS_INLINE_FUNCTION
62 static constexpr IndexType
size(
const IndexType begin,
65 return structEnd( end ) - structBegin( begin );
79template <
int VectorLength,
class... Properties>
80class SimdPolicy :
public Kokkos::TeamPolicy<Properties...,
81 Kokkos::Schedule<Kokkos::Dynamic>>
86 Kokkos::TeamPolicy<Properties..., Kokkos::Schedule<Kokkos::Dynamic>>;
106 , _array_begin( Impl::Index<VectorLength>::a( begin ) )
107 , _array_end( Impl::Index<VectorLength>::a( end ) )
114 return _struct_begin;
127 return ( s == _struct_begin ) ? _array_begin : 0;
136 return ( ( s == _struct_end - 1 ) && ( _array_end != 0 ) )
Kokkos::TeamPolicy< Properties..., Kokkos::Schedule< Kokkos::Dynamic > > base_type
Kokkos team policy.
Definition Cabana_ExecutionPolicy.hpp:85
SimdPolicy(const index_type begin, const index_type end)
Range constructor.
Definition Cabana_ExecutionPolicy.hpp:97
KOKKOS_INLINE_FUNCTION index_type arrayEnd(const index_type s) const
Given a struct id get the ending array index.
Definition Cabana_ExecutionPolicy.hpp:131
typename base_type::index_type index_type
Index type.
Definition Cabana_ExecutionPolicy.hpp:88
KOKKOS_INLINE_FUNCTION index_type arrayBegin(const index_type s) const
Given a struct id get the beginning array index.
Definition Cabana_ExecutionPolicy.hpp:121
KOKKOS_INLINE_FUNCTION index_type structEnd() const
Get the ending struct index.
Definition Cabana_ExecutionPolicy.hpp:118
KOKKOS_INLINE_FUNCTION index_type structBegin() const
Get the starting struct index.
Definition Cabana_ExecutionPolicy.hpp:112
Core: particle data structures and algorithms.
Definition Cabana_AoSoA.hpp:36
auto size(SliceType slice, typename std::enable_if< is_slice< SliceType >::value, int >::type *=0)
Check slice size (differs from Kokkos View).
Definition Cabana_Slice.hpp:1012