30 #ifndef SACADO_FAD_EXP_VIEWSTORAGE_HPP
31 #define SACADO_FAD_EXP_VIEWSTORAGE_HPP
33 #include <type_traits>
45 template <
typename T,
unsigned sl,
unsigned ss,
typename U>
53 template <
typename T,
unsigned static_length,
unsigned static_str
ide,
typename U>
69 template <
typename TT>
97 ViewStorage(
T* v,
const int arg_size = 0,
const int arg_stride = 0) :
103 const int arg_stride = 0) :
118 if (
this != std::addressof(x)) {
226 #endif // SACADO_FAD_EXP_VIEWSTORAGE_HPP
const mpl::integral_nonzero_constant< int, static_length > sz_
Derivative array size.
Turn ViewStorage into a meta-function class usable with mpl::apply.
KOKKOS_INLINE_FUNCTION constexpr int length() const
Returns array length.
KOKKOS_INLINE_FUNCTION void expand(int sz)
Expand derivative array to size sz.
KOKKOS_INLINE_FUNCTION ViewStorage(T *arg_dx, T *arg_val, const int arg_size=0, const int arg_stride=0)
Constructor.
KOKKOS_INLINE_FUNCTION T dx(int i) const
Returns derivative component i with bounds checking.
KOKKOS_INLINE_FUNCTION const T * dx() const
Returns derivative array.
static constexpr bool is_statically_sized
static KOKKOS_INLINE_FUNCTION void strided_zero(T *dest, int stride, int sz)
Zero out array dest of length sz.
KOKKOS_INLINE_FUNCTION ViewStorage & operator=(const ViewStorage &x)
Assignment.
KOKKOS_INLINE_FUNCTION void resizeAndZero(int sz)
Resize the derivative array to sz.
KOKKOS_INLINE_FUNCTION ViewFadPtr< T, static_length, static_stride, U > operator&() const
Overload of addressof operator.
KOKKOS_INLINE_FUNCTION T & fastAccessDx(int i)
Returns derivative component i without bounds checking.
KOKKOS_INLINE_FUNCTION ViewStorage(T *v, const int arg_size=0, const int arg_stride=0)
Constructor.
std::remove_cv< T >::type value_type
Derivative array storage class that is a view into a contiguous memory allocation. It does not provide proper value semantics and thus should not be used in a general-purpose scalar type.
ViewStorage< TT, static_length, static_stride, U > type
#define KOKKOS_INLINE_FUNCTION
KOKKOS_INLINE_FUNCTION T & val()
Returns value.
KOKKOS_INLINE_FUNCTION ViewStorage(const T &x)
Constructor with value (needed to satisfy interface)
static constexpr int static_size
Replace static derivative length.
static constexpr bool stride_one
KOKKOS_INLINE_FUNCTION const T & fastAccessDx(int i) const
Returns derivative component i without bounds checking.
ViewStorage< T, static_length, static_stride, U > type
DerivInit
Enum use to signal whether the derivative array should be initialized in AD object constructors...
KOKKOS_INLINE_FUNCTION void resize(int sz)
Resize the derivative array to sz.
KOKKOS_INLINE_FUNCTION ViewStorage(const int sz, const T &x, const DerivInit zero_out)
Constructor with size sz (needed to satisfy interface)
KOKKOS_INLINE_FUNCTION ViewStorage()
Default constructor (needed to satisfy interface)
KOKKOS_INLINE_FUNCTION void zero()
Zero out derivative array.
KOKKOS_INLINE_FUNCTION constexpr int size() const
Returns number of derivative components.
KOKKOS_INLINE_FUNCTION ViewStorage(const ViewStorage &x)
Copy constructor.
KOKKOS_INLINE_FUNCTION ~ViewStorage()
Destructor.
KOKKOS_INLINE_FUNCTION const T & val() const
Returns value.
const mpl::integral_nonzero_constant< int, static_stride > stride_
Derivative array stride.