10 #ifndef STOKHOS_STATIC_FIXED_STORAGE_HPP
11 #define STOKHOS_STATIC_FIXED_STORAGE_HPP
18 #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
19 #define KOKKOS_IMPL_PUBLIC_INCLUDE
20 #define KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
22 #include "Kokkos_Core_fwd.hpp"
23 #include "Cuda/Kokkos_Cuda.hpp"
24 #ifdef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
25 #undef KOKKOS_IMPL_PUBLIC_INCLUDE
26 #undef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
29 #include "Sacado_Traits.hpp"
36 template <
typename ordinal_t,
typename value_t,
int Num,
typename device_t>
61 template <
typename ord_t,
typename val_t = value_t ,
typename dev_t = device_t >
72 KOKKOS_DEFAULTED_FUNCTION
76 KOKKOS_INLINE_FUNCTION
83 KOKKOS_INLINE_FUNCTION
89 KOKKOS_INLINE_FUNCTION
93 KOKKOS_DEFAULTED_FUNCTION
97 KOKKOS_INLINE_FUNCTION
103 KOKKOS_DEFAULTED_FUNCTION
107 KOKKOS_DEFAULTED_FUNCTION
111 KOKKOS_INLINE_FUNCTION
118 KOKKOS_INLINE_FUNCTION
126 KOKKOS_INLINE_FUNCTION
134 KOKKOS_INLINE_FUNCTION
140 KOKKOS_INLINE_FUNCTION
146 KOKKOS_INLINE_FUNCTION
155 KOKKOS_INLINE_FUNCTION
164 KOKKOS_INLINE_FUNCTION
170 KOKKOS_INLINE_FUNCTION
176 KOKKOS_INLINE_FUNCTION
180 KOKKOS_INLINE_FUNCTION
184 KOKKOS_INLINE_FUNCTION
189 KOKKOS_INLINE_FUNCTION
194 KOKKOS_INLINE_FUNCTION
198 KOKKOS_INLINE_FUNCTION
204 KOKKOS_INLINE_FUNCTION
210 KOKKOS_INLINE_FUNCTION
214 KOKKOS_INLINE_FUNCTION
219 KOKKOS_INLINE_FUNCTION
223 KOKKOS_INLINE_FUNCTION
227 KOKKOS_INLINE_FUNCTION
231 KOKKOS_INLINE_FUNCTION
235 KOKKOS_INLINE_FUNCTION
239 KOKKOS_INLINE_FUNCTION
243 KOKKOS_INLINE_FUNCTION
247 KOKKOS_INLINE_FUNCTION
253 #if STOKHOS_ALIGN_MEMORY && ( defined(__INTEL_COMPILER) )
261 #if defined(KOKKOS_ENABLE_CUDA)
268 template <
typename ordinal_t,
typename value_t,
int Num>
289 typedef typename execution_space::memory_space
memory_space;
293 template <
typename ord_t,
typename val_t = value_t ,
typename dev_t = execution_space >
300 typedef StaticFixedStorage<ordinal_type,value_type,N,execution_space>
type;
304 KOKKOS_DEFAULTED_FUNCTION
308 KOKKOS_INLINE_FUNCTION
315 KOKKOS_INLINE_FUNCTION
321 KOKKOS_INLINE_FUNCTION
325 KOKKOS_DEFAULTED_FUNCTION
329 KOKKOS_INLINE_FUNCTION
331 ss::copy(s.coeff_,
coeff_, Num);
335 KOKKOS_DEFAULTED_FUNCTION
339 KOKKOS_DEFAULTED_FUNCTION
343 KOKKOS_INLINE_FUNCTION
345 ss::copy(s.coeff_,
coeff_, Num);
350 KOKKOS_INLINE_FUNCTION
353 ss::copy(s.coeff_,
coeff_, Num);
358 KOKKOS_INLINE_FUNCTION
361 ss::copy(s.coeff_,
coeff_, Num);
366 KOKKOS_INLINE_FUNCTION
372 KOKKOS_INLINE_FUNCTION
378 KOKKOS_INLINE_FUNCTION
387 KOKKOS_INLINE_FUNCTION
396 KOKKOS_INLINE_FUNCTION
402 KOKKOS_INLINE_FUNCTION
408 KOKKOS_INLINE_FUNCTION
412 KOKKOS_INLINE_FUNCTION
416 KOKKOS_INLINE_FUNCTION
421 KOKKOS_INLINE_FUNCTION
426 KOKKOS_INLINE_FUNCTION
430 KOKKOS_INLINE_FUNCTION
436 KOKKOS_INLINE_FUNCTION
442 KOKKOS_INLINE_FUNCTION
446 KOKKOS_INLINE_FUNCTION
451 KOKKOS_INLINE_FUNCTION
455 KOKKOS_INLINE_FUNCTION
459 KOKKOS_INLINE_FUNCTION
463 KOKKOS_INLINE_FUNCTION
467 KOKKOS_INLINE_FUNCTION
471 KOKKOS_INLINE_FUNCTION
475 KOKKOS_INLINE_FUNCTION
479 KOKKOS_INLINE_FUNCTION
496 #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 const_reference operator[](const ordinal_type &i) const
Coefficient access (avoid if possible)
KOKKOS_INLINE_FUNCTION void init(const_reference v) volatile
Initialize values to a constant value.
Statically allocated storage class.
KOKKOS_DEFAULTED_FUNCTION StaticFixedStorage()=default
Constructor.
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.
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)
static const int static_size
const volatile value_type * const_volatile_pointer
KOKKOS_INLINE_FUNCTION const_pointer coeff() const
Get coefficients.
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.
KOKKOS_INLINE_FUNCTION const_reference getCoeff() const
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.
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
Traits class encapsulting memory alignment.
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.
device_t::execution_space execution_space
KOKKOS_INLINE_FUNCTION StaticFixedStorage & operator=(const StaticFixedStorage &s) volatile
Assignment operator.
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
static const bool is_static
KOKKOS_INLINE_FUNCTION const_volatile_pointer coeff() const volatile
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_DEFAULTED_FUNCTION StaticFixedStorage & operator=(const StaticFixedStorage &s)=default
Assignment operator.
KOKKOS_INLINE_FUNCTION StaticFixedStorage & operator=(const volatile StaticFixedStorage &s)
Assignment operator.
static const bool supports_reset
KOKKOS_INLINE_FUNCTION StaticFixedStorage(const volatile StaticFixedStorage &s)
Copy constructor.
value_type coeff_[Num]
Coefficient values.
KOKKOS_INLINE_FUNCTION volatile_pointer coeff() volatile
Get coefficients.
#define STOKHOS_STORAGE_HELPER_STRINGNAME_STATIC(__storagename__)
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_DEFAULTED_FUNCTION ~StaticFixedStorage()=default
Destructor.
volatile value_type * volatile_pointer