10 #ifndef STOKHOS_VIEW_STORAGE_HPP
11 #define STOKHOS_VIEW_STORAGE_HPP
15 #include "Kokkos_Macros.hpp"
16 #include "impl/Kokkos_Traits.hpp"
18 #include "Sacado_Traits.hpp"
28 template <
typename ordinal_t ,
30 unsigned static_length ,
31 unsigned static_stride ,
55 template <
typename ord_t,
typename val_t = value_t ,
typename dev_t = device_t >
61 KOKKOS_INLINE_FUNCTION
67 KOKKOS_INLINE_FUNCTION
74 KOKKOS_INLINE_FUNCTION
78 KOKKOS_INLINE_FUNCTION
83 KOKKOS_INLINE_FUNCTION
87 KOKKOS_INLINE_FUNCTION
95 KOKKOS_INLINE_FUNCTION
100 KOKKOS_INLINE_FUNCTION
105 KOKKOS_INLINE_FUNCTION
118 KOKKOS_INLINE_FUNCTION
130 KOKKOS_INLINE_FUNCTION
141 KOKKOS_INLINE_FUNCTION
146 KOKKOS_INLINE_FUNCTION
153 KOKKOS_INLINE_FUNCTION
157 KOKKOS_INLINE_FUNCTION
164 KOKKOS_INLINE_FUNCTION
168 KOKKOS_INLINE_FUNCTION
172 KOKKOS_INLINE_FUNCTION
176 KOKKOS_INLINE_FUNCTION
185 const Kokkos::Impl::integral_nonzero_constant< ordinal_t , static_length >
size_ ;
188 const Kokkos::Impl::integral_nonzero_constant< ordinal_t , static_stride >
stride_ ;
191 template<
class Storage >
194 template <
typename ordinal_t ,
196 unsigned static_length ,
197 unsigned static_stride ,
206 template <
typename ordinal_t,
typename value_t,
unsigned static_length,
207 unsigned static_stride,
typename device_t>
208 struct StringName< Stokhos::ViewStorage<ordinal_t,
214 std::stringstream ss;
215 ss <<
"Stokhos::ViewStorage<"
216 << StringName<ordinal_t>::eval() <<
","
217 << StringName<value_t>::eval() <<
","
218 << static_length <<
","
219 << static_stride <<
","
220 << StringName<device_t>::eval() <<
">";
KOKKOS_INLINE_FUNCTION ~ViewStorage()
Destructor.
KOKKOS_INLINE_FUNCTION void init(const_pointer v, const ordinal_type &sz=0)
Initialize values to an array of values.
Dynamic storage with view semantics and contiguous access.
const Kokkos::Impl::integral_nonzero_constant< ordinal_t, static_stride > stride_
Stride of array.
KOKKOS_INLINE_FUNCTION void init(const_reference v)
Initialize values to a constant value.
KOKKOS_INLINE_FUNCTION ordinal_type size() const
Return size.
KOKKOS_INLINE_FUNCTION const_pointer coeff() const
Get coefficients.
KOKKOS_INLINE_FUNCTION void resize(ordinal_type s)
Resize function disabled.
const Kokkos::Impl::integral_nonzero_constant< ordinal_t, static_length > size_
Size of array.
KOKKOS_INLINE_FUNCTION pointer coeff()
Get coefficients.
KOKKOS_INLINE_FUNCTION reference operator[](const ordinal_type &i) const
Coefficient access (avoid if possible)
const value_type & const_reference
static const int static_size
KOKKOS_INLINE_FUNCTION ViewStorage & operator=(const ViewStorage &)
Assignment operator.
static std::string eval()
KOKKOS_INLINE_FUNCTION void load(pointer v)
Load values to an array of values.
static const bool is_static
KOKKOS_INLINE_FUNCTION ViewStorage(const error_storage_type_is_not_allocateable &z=error_storage_type_is_not_allocateable(), const value_type &x=value_type(0))
Constructor to satisfy Sacado::MP::Vector, disabled via error type.
KOKKOS_INLINE_FUNCTION void shallowReset(pointer v, const error_storage_type_is_not_resizeable &, const error_storage_type_is_not_resizeable &, const bool owned)
Reset function disabled.
KOKKOS_INLINE_FUNCTION const_reference getCoeff() const
static const bool supports_resize
const pointer coeff_
Coefficient values.
KOKKOS_INLINE_FUNCTION ViewStorage(const ViewStorage &s)
Constructor.
KOKKOS_INLINE_FUNCTION ViewStorage(pointer v, const ordinal_type &arg_size=0, const ordinal_type &arg_stride=0)
Constructor.
KOKKOS_INLINE_FUNCTION ViewStorage(const ViewStorage &s, const ordinal_type &arg_begin, const ordinal_type &arg_end)
const value_type * const_pointer
ViewStorage< ord_t, val_t, static_length, static_stride, dev_t > type
KOKKOS_INLINE_FUNCTION ViewStorage(const ordinal_type &sz, const value_type *x)
Constructor from array.
Turn ViewStorage into a meta-function class usable with mpl::apply.
static const bool supports_reset
KOKKOS_INLINE_FUNCTION ViewStorage(const ordinal_type &sz, pointer v, bool owned)
Constructor for creating a view.
KOKKOS_INLINE_FUNCTION reference getCoeff()
static const bool supports_view