30#ifndef SACADO_FAD_VIEWSTORAGE_HPP
31#define SACADO_FAD_VIEWSTORAGE_HPP
35#ifdef SACADO_NEW_FAD_DESIGN_IS_DEFAULT
42 template <
typename T,
unsigned static_length,
unsigned static_stride,
44 using ViewStorage = Exp::ViewStorage<T,static_length,static_stride,U>;
59#ifndef SACADO_FAD_DERIV_LOOP
60#if defined(SACADO_VIEW_CUDA_HIERARCHICAL_DFAD) && !defined(SACADO_DISABLE_CUDA_IN_KOKKOS) && defined(__CUDA_ARCH__)
61#define SACADO_FAD_DERIV_LOOP(I,SZ) for (int I=threadIdx.x; I<SZ; I+=blockDim.x)
63#define SACADO_FAD_DERIV_LOOP(I,SZ) for (int I=0; I<SZ; ++I)
72 template <
typename T,
unsigned static_length,
unsigned static_str
ide,
typename U>
#define SACADO_INLINE_FUNCTION
#define SACADO_FAD_DERIV_LOOP(I, SZ)
#define SACADO_ENABLE_VALUE_CTOR_DECL
Fad specializations for Teuchos::BLAS wrappers.
Derivative array storage class that is a view into a contiguous memory allocation....
SACADO_INLINE_FUNCTION int size() const
Returns number of derivative components.
SACADO_INLINE_FUNCTION T & fastAccessDx(int i)
Returns derivative component i without bounds checking.
SACADO_INLINE_FUNCTION T dx(int i) const
Returns derivative component i with bounds checking.
SACADO_INLINE_FUNCTION ViewStorage(T *v, const int arg_size=0, const int arg_stride=0)
Constructor.
SACADO_INLINE_FUNCTION ViewStorage(const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
Default constructor (needed to satisfy interface)
SACADO_INLINE_FUNCTION ViewStorage(const ViewStorage &x)
Copy constructor.
const mpl::integral_nonzero_constant< int, static_length > sz_
Derivative array size.
SACADO_INLINE_FUNCTION ViewStorage(const int sz, const T &x, const DerivInit zero_out=InitDerivArray)
Constructor with size sz (needed to satisfy interface)
SACADO_INLINE_FUNCTION T & val()
Returns value.
SACADO_INLINE_FUNCTION void expand(int sz)
Expand derivative array to size sz.
const mpl::integral_nonzero_constant< int, static_stride > stride_
Derivative array stride.
SACADO_INLINE_FUNCTION void resizeAndZero(int)
Resize the derivative array to sz.
SACADO_INLINE_FUNCTION ViewStorage & operator=(const ViewStorage &x)
Assignment.
SACADO_INLINE_FUNCTION void zero()
Zero out derivative array.
SACADO_INLINE_FUNCTION int length() const
Returns array length.
SACADO_INLINE_FUNCTION const T * dx() const
Returns derivative array.
SACADO_INLINE_FUNCTION void resize(int sz)
Resize the derivative array to sz.
SACADO_INLINE_FUNCTION const T & val() const
Returns value.
SACADO_INLINE_FUNCTION ViewStorage(T *arg_dx, T *arg_val, const int arg_size=0, const int arg_stride=0)
Constructor.
SACADO_INLINE_FUNCTION ~ViewStorage()
Destructor.
SACADO_INLINE_FUNCTION const T & fastAccessDx(int i) const
Returns derivative component i without bounds checking.
DerivInit
Enum use to signal whether the derivative array should be initialized in AD object constructors.
@ InitDerivArray
Initialize the derivative array.
static SACADO_INLINE_FUNCTION void strided_zero(T *dest, int stride, int sz)
Zero out array dest of length sz.