10 #ifndef STOKHOS_STATIC_STORAGE_HPP
11 #define STOKHOS_STATIC_STORAGE_HPP
15 #include "Kokkos_Macros.hpp"
17 #include "Sacado_Traits.hpp"
24 template <
typename ordinal_t,
typename value_t,
int Num,
typename device_t>
46 template <
typename ord_t,
typename val_t = value_t ,
typename dev_t = device_t >
52 KOKKOS_INLINE_FUNCTION
59 KOKKOS_INLINE_FUNCTION
65 KOKKOS_INLINE_FUNCTION
69 KOKKOS_INLINE_FUNCTION
75 KOKKOS_INLINE_FUNCTION
81 KOKKOS_INLINE_FUNCTION
85 KOKKOS_INLINE_FUNCTION
93 KOKKOS_INLINE_FUNCTION
101 KOKKOS_INLINE_FUNCTION
109 KOKKOS_INLINE_FUNCTION
117 KOKKOS_INLINE_FUNCTION
123 KOKKOS_INLINE_FUNCTION
129 KOKKOS_INLINE_FUNCTION
138 KOKKOS_INLINE_FUNCTION
147 KOKKOS_INLINE_FUNCTION
153 KOKKOS_INLINE_FUNCTION
159 KOKKOS_INLINE_FUNCTION
167 KOKKOS_INLINE_FUNCTION
175 KOKKOS_INLINE_FUNCTION
180 KOKKOS_INLINE_FUNCTION
185 KOKKOS_INLINE_FUNCTION
189 KOKKOS_INLINE_FUNCTION
193 KOKKOS_INLINE_FUNCTION
199 KOKKOS_INLINE_FUNCTION
205 KOKKOS_INLINE_FUNCTION
209 KOKKOS_INLINE_FUNCTION
215 KOKKOS_INLINE_FUNCTION
219 KOKKOS_INLINE_FUNCTION
223 KOKKOS_INLINE_FUNCTION
227 KOKKOS_INLINE_FUNCTION
231 KOKKOS_INLINE_FUNCTION
235 KOKKOS_INLINE_FUNCTION
239 KOKKOS_INLINE_FUNCTION
243 KOKKOS_INLINE_FUNCTION
261 #endif // STOKHOS_STATIC_STORAGE_HPP
KOKKOS_INLINE_FUNCTION volatile StaticStorage & operator=(const volatile StaticStorage &s) volatile
Assignment operator.
KOKKOS_INLINE_FUNCTION ordinal_type size() const
Return size.
KOKKOS_INLINE_FUNCTION void init(const_reference v) volatile
Initialize values to a constant value.
KOKKOS_INLINE_FUNCTION const_volatile_reference getCoeff() const volatile
KOKKOS_INLINE_FUNCTION StaticStorage(const ordinal_type &sz, pointer v, bool owned)
Constructor for creating a view (not allowed)
KOKKOS_INLINE_FUNCTION StaticStorage(const ordinal_type &sz, const value_type *x)
Constructor from array.
const value_type & const_reference
KOKKOS_INLINE_FUNCTION ~StaticStorage()
Destructor.
KOKKOS_INLINE_FUNCTION void load(pointer v) volatile
Load values to an array of values.
Static array allocation class.
ordinal_type sz_
Size of array used.
static const int static_size
KOKKOS_INLINE_FUNCTION const_reference operator[](const ordinal_type &i) const
Coefficient access (avoid if possible)
KOKKOS_INLINE_FUNCTION void init(const_pointer v, const ordinal_type &sz=0) volatile
Initialize values to an array of values.
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value >::type fill(const Kokkos::View< XD, XP...> &x, const typename Kokkos::View< XD, XP...>::non_const_value_type &val)
KOKKOS_INLINE_FUNCTION ordinal_type size() const volatile
Return size.
KOKKOS_INLINE_FUNCTION void load(pointer v)
Load values to an array of values.
value_type coeff_[Num]
Coefficient values.
KOKKOS_INLINE_FUNCTION const_reference getCoeff() const
KOKKOS_INLINE_FUNCTION StaticStorage & operator=(const volatile StaticStorage &s)
Assignment operator.
KOKKOS_INLINE_FUNCTION void init(const_pointer v, const ordinal_type &sz=0)
Initialize values to an array of values.
const value_type * const_pointer
static const bool is_static
KOKKOS_INLINE_FUNCTION StaticStorage(const ordinal_type &sz=1, const value_type &x=value_type(0.0))
Constructor.
KOKKOS_INLINE_FUNCTION StaticStorage(const StaticStorage &s)
Copy constructor.
StaticStorage< ord_t, val_t, Num, dev_t > type
volatile value_type & volatile_reference
KOKKOS_INLINE_FUNCTION void shallowReset(pointer v, const ordinal_type &sz, const ordinal_type &stride, bool owned) volatile
Reset storage to given array, size, and stride.
KOKKOS_INLINE_FUNCTION StaticStorage & operator=(const StaticStorage &s)
Assignment operator.
KOKKOS_INLINE_FUNCTION const_volatile_pointer coeff() const volatile
Get coefficients.
const volatile value_type & const_volatile_reference
static const bool supports_reset
KOKKOS_INLINE_FUNCTION volatile_reference getCoeff() volatile
Stokhos::StaticArrayTraits< value_type, execution_space > ss
KOKKOS_INLINE_FUNCTION StaticStorage(const volatile StaticStorage &s)
Copy constructor.
KOKKOS_INLINE_FUNCTION volatile StaticStorage & operator=(const StaticStorage &s) volatile
Assignment operator.
KOKKOS_INLINE_FUNCTION void resize(const ordinal_type &sz)
Resize to new size (values are preserved)
KOKKOS_INLINE_FUNCTION reference getCoeff()
KOKKOS_INLINE_FUNCTION void shallowReset(pointer v, const ordinal_type &sz, const ordinal_type &stride, bool owned)
Reset storage to given array, size, and stride.
Turn StaticStorage into a meta-function class usable with mpl::apply.
KOKKOS_INLINE_FUNCTION void init(const_reference v)
Initialize values to a constant value.
KOKKOS_INLINE_FUNCTION volatile_pointer coeff() volatile
Get coefficients.
volatile value_type * volatile_pointer
KOKKOS_INLINE_FUNCTION pointer coeff()
Get coefficients.
const volatile value_type * const_volatile_pointer
Statically allocated storage class.
KOKKOS_INLINE_FUNCTION const_pointer coeff() const
Get coefficients.
#define STOKHOS_STORAGE_HELPER_STRINGNAME_STATIC(__storagename__)
KOKKOS_INLINE_FUNCTION void resize(const ordinal_type &sz) volatile
Resize to new size (values are preserved)