|
Sacado Package Browser (Single Doxygen Collection)
Version of the Day
|
Go to the documentation of this file.
30 #ifndef SACADO_FAD_EXP_DYNAMICSTORAGE_HPP
31 #define SACADO_FAD_EXP_DYNAMICSTORAGE_HPP
33 #include <type_traits>
44 template <
typename T,
typename U = T>
54 template <
typename TT,
typename UU = TT>
203 #if defined(SACADO_VIEW_CUDA_HIERARCHICAL_DFAD_STRIDED) && !defined(SACADO_DISABLE_CUDA_IN_KOKKOS) && defined(__CUDA_ARCH__)
207 U
dx(
int i)
const {
return sz_ ?
dx_[i*blockDim.x] : U(0.); }
254 #endif // SACADO_FAD_EXP_DYNAMICSTORAGE_HPP
KOKKOS_INLINE_FUNCTION int length() const
Returns array length.
#define KOKKOS_INLINE_FUNCTION
std::remove_cv< T >::type value_type
KOKKOS_INLINE_FUNCTION DynamicStorage & operator=(const DynamicStorage &x)
Assignment.
int sz_
Derivative array size.
KOKKOS_INLINE_FUNCTION int size() const
Returns number of derivative components.
static constexpr int static_size
Derivative array storage class using dynamic memory allocation.
KOKKOS_INLINE_FUNCTION DynamicStorage(const int sz, const T &x, const DerivInit zero_out)
Constructor with size sz.
KOKKOS_INLINE_FUNCTION T & val()
Returns value.
static KOKKOS_INLINE_FUNCTION void copy(const T *src, T *dest, int sz)
Copy array from src to dest of length sz.
Turn DynamicStorage into a meta-function class usable with mpl::apply.
static constexpr bool is_statically_sized
KOKKOS_INLINE_FUNCTION DynamicStorage(const DynamicStorage &x)
Copy constructor.
static KOKKOS_INLINE_FUNCTION T * get(int sz)
Get memory for new array of length sz.
int len_
Derivative array length.
KOKKOS_INLINE_FUNCTION void resizeAndZero(int sz)
Resize the derivative array to sz.
static KOKKOS_INLINE_FUNCTION void destroy_and_release(T *m, int sz)
Destroy array elements and release memory.
KOKKOS_INLINE_FUNCTION ~DynamicStorage()
Destructor.
DynamicStorage< T, U > type
KOKKOS_INLINE_FUNCTION void zero()
Zero out derivative array.
Replace static derivative length.
const KOKKOS_INLINE_FUNCTION U & fastAccessDx(int i) const
Returns derivative component i without bounds checking.
KOKKOS_INLINE_FUNCTION U & fastAccessDx(int i)
Returns derivative component i without bounds checking.
KOKKOS_INLINE_FUNCTION void resize(int sz)
Resize the derivative array to sz.
static KOKKOS_INLINE_FUNCTION T * get_and_fill(int sz)
Get memory for new array of length sz and fill with zeros.
static KOKKOS_INLINE_FUNCTION void zero(T *dest, int sz)
Zero out array dest of length sz.
KOKKOS_INLINE_FUNCTION void expand(int sz)
Expand derivative array to size sz.
KOKKOS_INLINE_FUNCTION DynamicStorage()
Default constructor.
DynamicStorage< TT, UU > type
const KOKKOS_INLINE_FUNCTION T & val() const
Returns value.
KOKKOS_INLINE_FUNCTION U 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.
KOKKOS_INLINE_FUNCTION DynamicStorage(const T &x)
Constructor with value.
const KOKKOS_INLINE_FUNCTION U * dx() const
Returns derivative array.
Initialize the derivative array.