42 #ifndef STOKHOS_STATIC_FIXED_STORAGE_HPP 43 #define STOKHOS_STATIC_FIXED_STORAGE_HPP 48 #include "Kokkos_Core_fwd.hpp" 50 #include "Sacado_Traits.hpp" 57 template <
typename ordinal_t,
typename value_t,
int Num,
typename device_t>
82 template <
typename ord_t,
typename val_t = value_t ,
typename dev_t = device_t >
93 KOKKOS_INLINE_FUNCTION
97 KOKKOS_INLINE_FUNCTION
104 KOKKOS_INLINE_FUNCTION
110 KOKKOS_INLINE_FUNCTION
114 KOKKOS_INLINE_FUNCTION
118 KOKKOS_INLINE_FUNCTION
124 KOKKOS_INLINE_FUNCTION
128 KOKKOS_INLINE_FUNCTION
132 KOKKOS_INLINE_FUNCTION
139 KOKKOS_INLINE_FUNCTION
147 KOKKOS_INLINE_FUNCTION
155 KOKKOS_INLINE_FUNCTION
161 KOKKOS_INLINE_FUNCTION
167 KOKKOS_INLINE_FUNCTION
176 KOKKOS_INLINE_FUNCTION
185 KOKKOS_INLINE_FUNCTION
191 KOKKOS_INLINE_FUNCTION
197 KOKKOS_INLINE_FUNCTION
201 KOKKOS_INLINE_FUNCTION
205 KOKKOS_INLINE_FUNCTION
210 KOKKOS_INLINE_FUNCTION
215 KOKKOS_INLINE_FUNCTION
219 KOKKOS_INLINE_FUNCTION
225 KOKKOS_INLINE_FUNCTION
231 KOKKOS_INLINE_FUNCTION
235 KOKKOS_INLINE_FUNCTION
240 KOKKOS_INLINE_FUNCTION
244 KOKKOS_INLINE_FUNCTION
248 KOKKOS_INLINE_FUNCTION
252 KOKKOS_INLINE_FUNCTION
256 KOKKOS_INLINE_FUNCTION
260 KOKKOS_INLINE_FUNCTION
264 KOKKOS_INLINE_FUNCTION
268 KOKKOS_INLINE_FUNCTION
274 #if STOKHOS_ALIGN_MEMORY && ( defined(__INTEL_COMPILER) ) 282 #if defined(KOKKOS_HAVE_CUDA) 289 template <
typename ordinal_t,
typename value_t,
int Num>
310 typedef typename execution_space::memory_space
memory_space;
314 template <
typename ord_t,
typename val_t = value_t ,
typename dev_t = execution_space >
321 typedef StaticFixedStorage<ordinal_type,value_type,N,execution_space>
type;
325 KOKKOS_INLINE_FUNCTION
329 KOKKOS_INLINE_FUNCTION
336 KOKKOS_INLINE_FUNCTION
342 KOKKOS_INLINE_FUNCTION
346 KOKKOS_INLINE_FUNCTION
350 KOKKOS_INLINE_FUNCTION
352 ss::copy(s.coeff_,
coeff_, Num);
356 KOKKOS_INLINE_FUNCTION
360 KOKKOS_INLINE_FUNCTION
364 KOKKOS_INLINE_FUNCTION
366 ss::copy(s.coeff_,
coeff_, Num);
371 KOKKOS_INLINE_FUNCTION
374 ss::copy(s.coeff_,
coeff_, Num);
379 KOKKOS_INLINE_FUNCTION
382 ss::copy(s.coeff_,
coeff_, Num);
387 KOKKOS_INLINE_FUNCTION
393 KOKKOS_INLINE_FUNCTION
399 KOKKOS_INLINE_FUNCTION
408 KOKKOS_INLINE_FUNCTION
417 KOKKOS_INLINE_FUNCTION
423 KOKKOS_INLINE_FUNCTION
429 KOKKOS_INLINE_FUNCTION
433 KOKKOS_INLINE_FUNCTION
437 KOKKOS_INLINE_FUNCTION
442 KOKKOS_INLINE_FUNCTION
447 KOKKOS_INLINE_FUNCTION
451 KOKKOS_INLINE_FUNCTION
457 KOKKOS_INLINE_FUNCTION
463 KOKKOS_INLINE_FUNCTION
467 KOKKOS_INLINE_FUNCTION
472 KOKKOS_INLINE_FUNCTION
476 KOKKOS_INLINE_FUNCTION
480 KOKKOS_INLINE_FUNCTION
484 KOKKOS_INLINE_FUNCTION
488 KOKKOS_INLINE_FUNCTION
492 KOKKOS_INLINE_FUNCTION
496 KOKKOS_INLINE_FUNCTION
500 KOKKOS_INLINE_FUNCTION
515 template <
typename ordinal_t,
typename value_t,
int Num,
typename device_t>
516 struct StringName<
Stokhos::StaticFixedStorage<ordinal_t,
521 std::stringstream ss;
522 ss <<
"Stokhos::StaticFixedStorage<" 523 << StringName<ordinal_t>::eval() <<
"," 524 << StringName<value_t>::eval() <<
"," 526 << StringName<device_t>::eval() <<
">";
532 #endif // STOKHOS_STATIC_FIXED_STORAGE_HPP 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 reference getCoeff()
KOKKOS_INLINE_FUNCTION void init(const_reference v) volatile
Initialize values to a constant value.
Statically allocated storage class.
Kokkos::DefaultExecutionSpace execution_space
KOKKOS_INLINE_FUNCTION StaticFixedStorage(const ordinal_type &sz, const value_type &x=value_type(0.0))
Constructor.
Stokhos::StaticArrayTraits< value_type, execution_space > ss
const volatile value_type & const_volatile_reference
Static array allocation class.
KOKKOS_INLINE_FUNCTION void load(pointer v)
Load values to an array of values.
KOKKOS_INLINE_FUNCTION void load(pointer v) volatile
Load values to an array of values.
static const int static_size
const volatile value_type * const_volatile_pointer
Stokhos::MemoryTraits< memory_space > MemTraits
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
KOKKOS_INLINE_FUNCTION void resize(const ordinal_type &sz)
Resize to new size (values are preserved)
Turn StaticFixedStorage into a meta-function class usable with mpl::apply.
const IndexType const IndexType const IndexType const IndexType const ValueType const ValueType * x
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 resize(const ordinal_type &sz) volatile
Resize to new size (values are preserved)
KOKKOS_INLINE_FUNCTION StaticFixedStorage(const ordinal_type &sz, pointer v, bool owned)
Constructor for creating a view (not allowed)
const value_type & const_reference
StaticFixedStorage< ordinal_type, value_type, N, device_t > type
Top-level namespace for Stokhos classes and functions.
Traits class encapsulting memory alignment.
KOKKOS_INLINE_FUNCTION StaticFixedStorage & operator=(const StaticFixedStorage &s)=default
Assignment operator.
KOKKOS_INLINE_FUNCTION StaticFixedStorage & operator=(const volatile StaticFixedStorage &s) volatile
Assignment operator.
KOKKOS_INLINE_FUNCTION StaticFixedStorage(const ordinal_type &sz, const value_type *x)
Constructor from array.
KOKKOS_INLINE_FUNCTION ~StaticFixedStorage()=default
Destructor.
device_t::execution_space execution_space
KOKKOS_INLINE_FUNCTION StaticFixedStorage & operator=(const StaticFixedStorage &s) volatile
Assignment operator.
static std::string eval()
KOKKOS_INLINE_FUNCTION pointer coeff()
Get coefficients.
static const unsigned Alignment
Bytes to which memory allocations are aligned.
volatile value_type & volatile_reference
static KOKKOS_INLINE_FUNCTION ordinal_type size()
Return size.
KOKKOS_INLINE_FUNCTION const_volatile_reference getCoeff() const volatile
device_t::memory_space memory_space
KOKKOS_INLINE_FUNCTION volatile_reference getCoeff() volatile
KOKKOS_INLINE_FUNCTION const_reference getCoeff() const
static const bool is_static
KOKKOS_INLINE_FUNCTION const_volatile_pointer coeff() const volatile
Get coefficients.
KOKKOS_INLINE_FUNCTION const_pointer coeff() const
Get coefficients.
KOKKOS_INLINE_FUNCTION void init(const_reference v)
Initialize values to a constant value.
StaticFixedStorage< ord_t, val_t, Num, dev_t > type
KOKKOS_INLINE_FUNCTION StaticFixedStorage & operator=(const volatile StaticFixedStorage &s)
Assignment operator.
KOKKOS_INLINE_FUNCTION const_reference operator[](const ordinal_type &i) const
Coefficient access (avoid if possible)
static const bool supports_reset
KOKKOS_INLINE_FUNCTION StaticFixedStorage()=default
Constructor.
KOKKOS_INLINE_FUNCTION StaticFixedStorage(const volatile StaticFixedStorage &s)
Copy constructor.
value_type coeff_[Num]
Coefficient 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 volatile_pointer coeff() volatile
Get coefficients.
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.
volatile value_type * volatile_pointer