30 #ifndef SACADO_STATICARRAYTRAITS_HPP
31 #define SACADO_STATICARRAYTRAITS_HPP
42 template <typename T, bool isScalar = IsScalarType<T>::value>
47 static void copy(
const T* src,
T* dest,
int sz) {
48 for (
int i=0; i<sz; ++i)
54 static void zero(
T* dest,
int sz) {
55 for (
int i=0; i<sz; ++i)
69 static void copy(
const T* src,
T* dest,
int sz) {
72 for (
int i=0; i<sz; ++i)
75 std::memcpy(dest,src,sz*
sizeof(
T));
81 static void zero(
T* dest,
int sz) {
84 for (
int i=0; i<sz; ++i)
87 std::memset(dest,0,sz*
sizeof(
T));
95 #endif // SACAD0_STATICARRAYTRAITS_HPP
static KOKKOS_INLINE_FUNCTION void copy(const T *src, T *dest, int sz)
Copy array from src to dest of length sz.
static KOKKOS_INLINE_FUNCTION void zero(T *dest, int sz)
Zero out array dest of length sz.
static KOKKOS_INLINE_FUNCTION void zero(T *dest, int sz)
Zero out array dest of length sz.
#define KOKKOS_INLINE_FUNCTION
static KOKKOS_INLINE_FUNCTION void copy(const T *src, T *dest, int sz)
Copy array from src to dest of length sz.
Static array allocation class that works for any type.