|
Sacado Package Browser (Single Doxygen Collection)
Version of the Day
|
Go to the documentation of this file.
30 #ifndef SACADO_FAD_EXP_STATICSTORAGE_HPP
31 #define SACADO_FAD_EXP_STATICSTORAGE_HPP
33 #include <type_traits>
48 template <
typename T,
int Num>
58 template <
typename TT>
86 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
88 throw "StaticStorage::StaticStorage() Error: Supplied derivative dimension exceeds maximum length.";
99 for (
int i=0; i<
sz_; i++)
114 for (
int i=0; i<
sz_; i++)
131 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
133 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
145 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
147 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
161 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
163 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
217 #endif // SACADO_FAD_EXP_STATICSTORAGE_HPP
KOKKOS_INLINE_FUNCTION void zero()
Zero out derivative array.
StaticStorage< T, Num > type
#define KOKKOS_INLINE_FUNCTION
KOKKOS_INLINE_FUNCTION T & val()
Returns value.
KOKKOS_INLINE_FUNCTION StaticStorage(const int sz, const T &x, const DerivInit zero_out)
Constructor with size sz.
const KOKKOS_INLINE_FUNCTION T * dx() const
Returns derivative array.
KOKKOS_INLINE_FUNCTION void resizeAndZero(int sz)
Resize the derivative array to sz.
KOKKOS_INLINE_FUNCTION void resize(int sz)
Resize the derivative array to sz.
Derivative array storage class using static memory allocation.
static constexpr bool is_statically_sized
KOKKOS_INLINE_FUNCTION StaticStorage()
Default constructor.
Replace static derivative length (interpreted as a fixed length)
StaticStorage< TT, Num > type
KOKKOS_INLINE_FUNCTION T & fastAccessDx(int i)
Returns derivative component i without bounds checking.
KOKKOS_INLINE_FUNCTION void expand(int sz)
Expand derivative array to size sz.
Turn StaticStorage into a meta-function class usable with mpl::apply.
KOKKOS_INLINE_FUNCTION ~StaticStorage()
Destructor.
std::remove_cv< T >::type value_type
KOKKOS_INLINE_FUNCTION StaticStorage & operator=(const StaticStorage &x)
Assignment.
KOKKOS_INLINE_FUNCTION StaticStorage(const StaticStorage &x)
Copy constructor.
const KOKKOS_INLINE_FUNCTION T & fastAccessDx(int i) const
Returns derivative component i without bounds checking.
KOKKOS_INLINE_FUNCTION int size() const
Returns number of derivative components.
KOKKOS_INLINE_FUNCTION StaticStorage(const T &x)
Constructor with value.
KOKKOS_INLINE_FUNCTION int length() const
Returns array length.
KOKKOS_INLINE_FUNCTION T dx(int i) const
Returns derivative component i with bounds checking.
int sz_
Size of derivative array.
const KOKKOS_INLINE_FUNCTION T & val() const
Returns value.
static constexpr int static_size
static KOKKOS_INLINE_FUNCTION void zero(T *dest, int sz)
Zero out array dest of length sz.
DerivInit
Enum use to signal whether the derivative array should be initialized in AD object constructors.
Initialize the derivative array.
T dx_[Num]
Derivative array.