10 #ifndef STOKHOS_DYNAMIC_STRIDED_STORAGE_HPP
11 #define STOKHOS_DYNAMIC_STRIDED_STORAGE_HPP
15 #include "Kokkos_Macros.hpp"
17 #include "Sacado_Traits.hpp"
23 template <
typename ordinal_t,
typename value_t,
typename device_t>
45 template <
typename ord_t,
typename val_t = value_t,
typename dev_t = device_t >
51 KOKKOS_INLINE_FUNCTION
59 KOKKOS_INLINE_FUNCTION
66 KOKKOS_INLINE_FUNCTION
71 KOKKOS_INLINE_FUNCTION
84 KOKKOS_INLINE_FUNCTION
97 KOKKOS_INLINE_FUNCTION
103 KOKKOS_INLINE_FUNCTION
132 KOKKOS_INLINE_FUNCTION
161 KOKKOS_INLINE_FUNCTION
191 KOKKOS_INLINE_FUNCTION
221 KOKKOS_INLINE_FUNCTION
231 KOKKOS_INLINE_FUNCTION
241 KOKKOS_INLINE_FUNCTION
254 KOKKOS_INLINE_FUNCTION
267 KOKKOS_INLINE_FUNCTION
276 KOKKOS_INLINE_FUNCTION
285 KOKKOS_INLINE_FUNCTION
307 KOKKOS_INLINE_FUNCTION
329 KOKKOS_INLINE_FUNCTION
341 KOKKOS_INLINE_FUNCTION
353 KOKKOS_INLINE_FUNCTION
357 KOKKOS_INLINE_FUNCTION
361 KOKKOS_INLINE_FUNCTION
367 KOKKOS_INLINE_FUNCTION
373 KOKKOS_INLINE_FUNCTION
379 KOKKOS_INLINE_FUNCTION
385 KOKKOS_INLINE_FUNCTION
389 KOKKOS_INLINE_FUNCTION
393 KOKKOS_INLINE_FUNCTION
397 KOKKOS_INLINE_FUNCTION
401 KOKKOS_INLINE_FUNCTION
405 KOKKOS_INLINE_FUNCTION
409 KOKKOS_INLINE_FUNCTION
413 KOKKOS_INLINE_FUNCTION
437 #endif // STOKHOS_DYNAMIC_STORAGE_HPP
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const ordinal_type &sz=1, const value_type &x=value_type(0.0))
Constructor.
KOKKOS_INLINE_FUNCTION void resize(const ordinal_type &sz)
Resize to new size (values are preserved)
KOKKOS_INLINE_FUNCTION volatile_pointer coeff() volatile
Get coefficients.
const value_type * const_pointer
#define STOKHOS_STORAGE_HELPER_STRINGNAME_DYNAMIC(__storagename__)
KOKKOS_INLINE_FUNCTION void init(const_pointer v, const ordinal_type &sz=0) volatile
Initialize values to an array of values.
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 void resize(const ordinal_type &sz) volatile
Resize to new size (values are preserved)
pointer coeff_
Coefficient values.
KOKKOS_INLINE_FUNCTION ordinal_type size() const
Return size.
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const volatile DynamicStridedStorage &s)
Constructor.
KOKKOS_INLINE_FUNCTION void init(const_reference v) volatile
Initialize values to a constant value.
KOKKOS_INLINE_FUNCTION const_volatile_pointer coeff() const volatile
Get coefficients.
KOKKOS_INLINE_FUNCTION const_volatile_reference getCoeff() const volatile
ordinal_type stride_
Stride of array.
KOKKOS_INLINE_FUNCTION ordinal_type size() const volatile
Return size.
Turn DynamicStridedStorage into a meta-function class usable with mpl::apply.
KOKKOS_INLINE_FUNCTION ~DynamicStridedStorage()
Destructor.
Stokhos::DynArrayTraits< value_type, execution_space > ds
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const ordinal_type &sz, pointer v, bool owned)
Constructor for creating a view.
static const int static_size
DynamicStridedStorage< ord_t, val_t, dev_t > type
static KOKKOS_INLINE_FUNCTION void fill(T *dest, std::size_t sz, const T &v)
Fill array dest of length sz with value v.
static KOKKOS_INLINE_FUNCTION T * get_and_fill(std::size_t sz, const T &x=T(0.0))
Get memory for new array of length sz and fill with zeros.
KOKKOS_INLINE_FUNCTION pointer coeff()
Get coefficients.
bool is_owned_
Do we own the array.
KOKKOS_INLINE_FUNCTION const_reference getCoeff() const
KOKKOS_INLINE_FUNCTION volatile DynamicStridedStorage & operator=(const DynamicStridedStorage &s) volatile
Assignment operator.
static const bool is_static
const volatile value_type & const_volatile_reference
const value_type & const_reference
KOKKOS_INLINE_FUNCTION const_reference operator[](const ordinal_type &i) const
Coefficient access (avoid if possible)
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.
KOKKOS_INLINE_FUNCTION reference getCoeff()
KOKKOS_INLINE_FUNCTION const_pointer coeff() const
Get coefficients.
KOKKOS_INLINE_FUNCTION DynamicStridedStorage & operator=(const volatile DynamicStridedStorage &s)
Assignment operator.
const volatile value_type * const_volatile_pointer
KOKKOS_INLINE_FUNCTION void load(pointer v) volatile
Load values to an array of values.
volatile value_type & volatile_reference
static KOKKOS_INLINE_FUNCTION void copy(const volatile T *src, volatile T *dest, std::size_t sz)
Copy array from src to dest of length sz.
ordinal_type sz_
Size of array used.
KOKKOS_INLINE_FUNCTION void init(const_reference v)
Initialize values to a constant value.
Dynamic array allocation class that is specialized for scalar i.e., fundamental or built-in types (fl...
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const ordinal_type &sz, const value_type *x)
Constructor from array.
KOKKOS_INLINE_FUNCTION void load(pointer v)
Load values to an array of values.
KOKKOS_INLINE_FUNCTION void init(const_pointer v, const ordinal_type &sz=0)
Initialize values to an array of values.
KOKKOS_INLINE_FUNCTION volatile DynamicStridedStorage & operator=(const volatile DynamicStridedStorage &s) volatile
Assignment operator.
KOKKOS_INLINE_FUNCTION DynamicStridedStorage & operator=(const DynamicStridedStorage &s)
Assignment operator.
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const DynamicStridedStorage &s)
Constructor.
KOKKOS_INLINE_FUNCTION volatile_reference getCoeff() volatile
static const bool supports_reset
volatile value_type * volatile_pointer
static KOKKOS_INLINE_FUNCTION void destroy_and_release(T *m, std::size_t sz)
Destroy array elements and release memory.