30 #ifndef SACADO_FAD_STATICSTORAGE_HPP
31 #define SACADO_FAD_STATICSTORAGE_HPP
35 #ifdef SACADO_NEW_FAD_DESIGN_IS_DEFAULT
42 template <
typename T,
int N>
43 using StaticStorage = Exp::StaticStorage<T,N>;
62 template <
typename T,
int Num>
82 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
84 throw "StaticStorage::StaticStorage() Error: Supplied derivative dimension exceeds maximum length.";
95 for (
int i=0; i<
sz_; i++)
110 for (
int i=0; i<
sz_; i++)
127 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
129 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
141 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
143 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
157 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
159 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
212 #endif // SACADO_NEW_FAD_DESIGN_IS_DEFAULT
214 #endif // SACADO_FAD_STATICSTORAGE_HPP
Derivative array storage class using static memory allocation.
#define SACADO_ENABLE_VALUE_CTOR_DECL
KOKKOS_INLINE_FUNCTION ~StaticStorage()
Destructor.
KOKKOS_INLINE_FUNCTION void zero()
Zero out derivative array.
KOKKOS_INLINE_FUNCTION StaticStorage(const StaticStorage &x)
Copy constructor.
KOKKOS_INLINE_FUNCTION int length() const
Returns array length.
static KOKKOS_INLINE_FUNCTION void zero(T *dest, int sz)
Zero out array dest of length sz.
KOKKOS_INLINE_FUNCTION StaticStorage & operator=(const StaticStorage &x)
Assignment.
KOKKOS_INLINE_FUNCTION StaticStorage(const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
Default constructor.
#define KOKKOS_INLINE_FUNCTION
KOKKOS_INLINE_FUNCTION void resize(int sz)
Resize the derivative array to sz.
T dx_[Num]
Derivative array.
KOKKOS_INLINE_FUNCTION T dx(int i) const
Returns derivative component i with bounds checking.
DerivInit
Enum use to signal whether the derivative array should be initialized in AD object constructors...
int sz_
Size of derivative array.
KOKKOS_INLINE_FUNCTION int size() const
Returns number of derivative components.
KOKKOS_INLINE_FUNCTION T & fastAccessDx(int i)
Returns derivative component i without bounds checking.
KOKKOS_INLINE_FUNCTION const T & fastAccessDx(int i) const
Returns derivative component i without bounds checking.
Initialize the derivative array.
KOKKOS_INLINE_FUNCTION StaticStorage(const int sz, const T &x, const DerivInit zero_out=InitDerivArray)
Constructor with size sz.
KOKKOS_INLINE_FUNCTION T & val()
Returns value.
KOKKOS_INLINE_FUNCTION const T * dx() const
Returns derivative array.
KOKKOS_INLINE_FUNCTION const T & val() const
Returns value.
KOKKOS_INLINE_FUNCTION void expand(int sz)
Expand derivative array to size sz.
KOKKOS_INLINE_FUNCTION void resizeAndZero(int sz)
Resize the derivative array to sz.