42 #ifndef STOKHOS_VIEW_STORAGE_HPP
43 #define STOKHOS_VIEW_STORAGE_HPP
47 #include "Kokkos_Macros.hpp"
48 #include "impl/Kokkos_Traits.hpp"
50 #include "Sacado_Traits.hpp"
60 template <
typename ordinal_t ,
62 unsigned static_length ,
63 unsigned static_stride ,
87 template <
typename ord_t,
typename val_t = value_t ,
typename dev_t = device_t >
93 KOKKOS_INLINE_FUNCTION
99 KOKKOS_INLINE_FUNCTION
106 KOKKOS_INLINE_FUNCTION
110 KOKKOS_INLINE_FUNCTION
115 KOKKOS_INLINE_FUNCTION
119 KOKKOS_INLINE_FUNCTION
127 KOKKOS_INLINE_FUNCTION
132 KOKKOS_INLINE_FUNCTION
137 KOKKOS_INLINE_FUNCTION
150 KOKKOS_INLINE_FUNCTION
162 KOKKOS_INLINE_FUNCTION
173 KOKKOS_INLINE_FUNCTION
178 KOKKOS_INLINE_FUNCTION
185 KOKKOS_INLINE_FUNCTION
189 KOKKOS_INLINE_FUNCTION
196 KOKKOS_INLINE_FUNCTION
200 KOKKOS_INLINE_FUNCTION
204 KOKKOS_INLINE_FUNCTION
208 KOKKOS_INLINE_FUNCTION
217 const Kokkos::Impl::integral_nonzero_constant< ordinal_t , static_length >
size_ ;
220 const Kokkos::Impl::integral_nonzero_constant< ordinal_t , static_stride >
stride_ ;
223 template<
class Storage >
226 template <
typename ordinal_t ,
228 unsigned static_length ,
229 unsigned static_stride ,
238 template <
typename ordinal_t,
typename value_t,
unsigned static_length,
239 unsigned static_stride,
typename device_t>
240 struct StringName< Stokhos::ViewStorage<ordinal_t,
246 std::stringstream ss;
247 ss <<
"Stokhos::ViewStorage<"
248 << StringName<ordinal_t>::eval() <<
","
249 << StringName<value_t>::eval() <<
","
250 << static_length <<
","
251 << static_stride <<
","
252 << 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