42 #ifndef STOKHOS_STATIC_STORAGE_HPP
43 #define STOKHOS_STATIC_STORAGE_HPP
47 #include "Kokkos_Macros.hpp"
49 #include "Sacado_Traits.hpp"
56 template <
typename ordinal_t,
typename value_t,
int Num,
typename device_t>
78 template <
typename ord_t,
typename val_t = value_t ,
typename dev_t = device_t >
84 KOKKOS_INLINE_FUNCTION
91 KOKKOS_INLINE_FUNCTION
97 KOKKOS_INLINE_FUNCTION
101 KOKKOS_INLINE_FUNCTION
107 KOKKOS_INLINE_FUNCTION
113 KOKKOS_INLINE_FUNCTION
117 KOKKOS_INLINE_FUNCTION
125 KOKKOS_INLINE_FUNCTION
133 KOKKOS_INLINE_FUNCTION
141 KOKKOS_INLINE_FUNCTION
149 KOKKOS_INLINE_FUNCTION
155 KOKKOS_INLINE_FUNCTION
161 KOKKOS_INLINE_FUNCTION
170 KOKKOS_INLINE_FUNCTION
179 KOKKOS_INLINE_FUNCTION
185 KOKKOS_INLINE_FUNCTION
191 KOKKOS_INLINE_FUNCTION
199 KOKKOS_INLINE_FUNCTION
207 KOKKOS_INLINE_FUNCTION
212 KOKKOS_INLINE_FUNCTION
217 KOKKOS_INLINE_FUNCTION
221 KOKKOS_INLINE_FUNCTION
225 KOKKOS_INLINE_FUNCTION
231 KOKKOS_INLINE_FUNCTION
237 KOKKOS_INLINE_FUNCTION
241 KOKKOS_INLINE_FUNCTION
247 KOKKOS_INLINE_FUNCTION
251 KOKKOS_INLINE_FUNCTION
255 KOKKOS_INLINE_FUNCTION
259 KOKKOS_INLINE_FUNCTION
263 KOKKOS_INLINE_FUNCTION
267 KOKKOS_INLINE_FUNCTION
271 KOKKOS_INLINE_FUNCTION
275 KOKKOS_INLINE_FUNCTION
291 template <
typename ordinal_t,
typename value_t,
int Num,
typename device_t>
292 struct StringName< Stokhos::StaticStorage<ordinal_t,
297 std::stringstream ss;
298 ss <<
"Stokhos::StaticStorage<"
299 << StringName<ordinal_t>::eval() <<
","
300 << StringName<value_t>::eval() <<
","
302 << StringName<device_t>::eval() <<
">";
308 #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.
static std::string eval()
const volatile value_type * const_volatile_pointer
Statically allocated storage class.
KOKKOS_INLINE_FUNCTION const_pointer coeff() const
Get coefficients.
KOKKOS_INLINE_FUNCTION void resize(const ordinal_type &sz) volatile
Resize to new size (values are preserved)