42#ifndef STOKHOS_DYNAMIC_STRIDED_STORAGE_HPP
43#define STOKHOS_DYNAMIC_STRIDED_STORAGE_HPP
47#include "Kokkos_Macros.hpp"
49#include "Sacado_Traits.hpp"
55 template <
typename ordinal_t,
typename value_t,
typename device_t>
77 template <
typename ord_t,
typename val_t = value_t,
typename dev_t = device_t >
83 KOKKOS_INLINE_FUNCTION
91 KOKKOS_INLINE_FUNCTION
98 KOKKOS_INLINE_FUNCTION
103 KOKKOS_INLINE_FUNCTION
116 KOKKOS_INLINE_FUNCTION
129 KOKKOS_INLINE_FUNCTION
135 KOKKOS_INLINE_FUNCTION
164 KOKKOS_INLINE_FUNCTION
193 KOKKOS_INLINE_FUNCTION
223 KOKKOS_INLINE_FUNCTION
253 KOKKOS_INLINE_FUNCTION
263 KOKKOS_INLINE_FUNCTION
273 KOKKOS_INLINE_FUNCTION
286 KOKKOS_INLINE_FUNCTION
299 KOKKOS_INLINE_FUNCTION
308 KOKKOS_INLINE_FUNCTION
317 KOKKOS_INLINE_FUNCTION
339 KOKKOS_INLINE_FUNCTION
361 KOKKOS_INLINE_FUNCTION
373 KOKKOS_INLINE_FUNCTION
385 KOKKOS_INLINE_FUNCTION
389 KOKKOS_INLINE_FUNCTION
393 KOKKOS_INLINE_FUNCTION
399 KOKKOS_INLINE_FUNCTION
405 KOKKOS_INLINE_FUNCTION
411 KOKKOS_INLINE_FUNCTION
417 KOKKOS_INLINE_FUNCTION
421 KOKKOS_INLINE_FUNCTION
425 KOKKOS_INLINE_FUNCTION
429 KOKKOS_INLINE_FUNCTION
433 KOKKOS_INLINE_FUNCTION
437 KOKKOS_INLINE_FUNCTION
441 KOKKOS_INLINE_FUNCTION
445 KOKKOS_INLINE_FUNCTION
#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 DynamicStridedStorage & operator=(const volatile DynamicStridedStorage &s)
Assignment operator.
Stokhos::DynArrayTraits< value_type, execution_space > ds
KOKKOS_INLINE_FUNCTION volatile_pointer coeff() volatile
Get coefficients.
pointer coeff_
Coefficient values.
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const ordinal_type &sz, pointer v, bool owned)
Constructor for creating a view.
KOKKOS_INLINE_FUNCTION void resize(const ordinal_type &sz) volatile
Resize to new size (values are preserved)
KOKKOS_INLINE_FUNCTION volatile DynamicStridedStorage & operator=(const volatile DynamicStridedStorage &s) volatile
Assignment operator.
KOKKOS_INLINE_FUNCTION volatile DynamicStridedStorage & operator=(const DynamicStridedStorage &s) volatile
Assignment operator.
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 const_reference getCoeff() const
ordinal_type stride_
Stride of array.
KOKKOS_INLINE_FUNCTION const_volatile_pointer coeff() const volatile
Get coefficients.
volatile value_type & volatile_reference
KOKKOS_INLINE_FUNCTION ordinal_type size() const
Return size.
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const DynamicStridedStorage &s)
Constructor.
KOKKOS_INLINE_FUNCTION void init(const_reference v)
Initialize values to a constant value.
KOKKOS_INLINE_FUNCTION ordinal_type size() const volatile
Return size.
KOKKOS_INLINE_FUNCTION ~DynamicStridedStorage()
Destructor.
KOKKOS_INLINE_FUNCTION void init(const_pointer v, const ordinal_type &sz=0)
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.
static const int static_size
KOKKOS_INLINE_FUNCTION void init(const_reference v) volatile
Initialize values to a constant value.
const volatile value_type & const_volatile_reference
static const bool supports_reset
bool is_owned_
Do we own the array.
ordinal_type sz_
Size of array used.
KOKKOS_INLINE_FUNCTION volatile_reference getCoeff() volatile
const value_type * const_pointer
KOKKOS_INLINE_FUNCTION void resize(const ordinal_type &sz)
Resize to new size (values are preserved)
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const ordinal_type &sz=1, const value_type &x=value_type(0.0))
Constructor.
volatile value_type * volatile_pointer
static const bool is_static
KOKKOS_INLINE_FUNCTION reference getCoeff()
KOKKOS_INLINE_FUNCTION const_reference operator[](const ordinal_type &i) const
Coefficient access (avoid if possible)
KOKKOS_INLINE_FUNCTION const_pointer coeff() const
Get coefficients.
KOKKOS_INLINE_FUNCTION void load(pointer v) volatile
Load values to an array of values.
KOKKOS_INLINE_FUNCTION void load(pointer v)
Load values to an array of values.
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const volatile DynamicStridedStorage &s)
Constructor.
KOKKOS_INLINE_FUNCTION DynamicStridedStorage & operator=(const DynamicStridedStorage &s)
Assignment operator.
KOKKOS_INLINE_FUNCTION const_volatile_reference getCoeff() const volatile
KOKKOS_INLINE_FUNCTION DynamicStridedStorage(const ordinal_type &sz, const value_type *x)
Constructor from array.
KOKKOS_INLINE_FUNCTION pointer coeff()
Get coefficients.
const value_type & const_reference
const volatile value_type * const_volatile_pointer
Top-level namespace for Stokhos classes and functions.
Dynamic array allocation class that is specialized for scalar i.e., fundamental or built-in types (fl...
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.
static KOKKOS_INLINE_FUNCTION void destroy_and_release(T *m, std::size_t sz)
Destroy array elements and release memory.
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 void copy(const volatile T *src, volatile T *dest, std::size_t sz)
Copy array from src to dest of length sz.
Turn DynamicStridedStorage into a meta-function class usable with mpl::apply.
DynamicStridedStorage< ord_t, val_t, dev_t > type