10 #ifndef SACADO_STATICARRAYTRAITS_HPP
11 #define SACADO_STATICARRAYTRAITS_HPP
27 static void copy(
const T* src,
T* dest,
int sz) {
28 for (
int i=0;
i<sz; ++
i)
34 static void zero(
T* dest,
int sz) {
35 for (
int i=0;
i<sz; ++
i)
49 static void copy(
const T* src,
T* dest,
int sz) {
51 #if defined( __CUDACC__) || defined(__HIPCC__ )
52 for (
int i=0;
i<sz; ++
i)
55 std::memcpy(dest,src,sz*
sizeof(
T));
61 static void zero(
T* dest,
int sz) {
63 #if defined(__CUDACC__ ) || defined(__HIPCC__ )
64 for (
int i=0;
i<sz; ++
i)
67 std::memset(dest,0,sz*
sizeof(
T));
75 #endif // SACAD0_STATICARRAYTRAITS_HPP
static SACADO_INLINE_FUNCTION void copy(const T *src, T *dest, int sz)
Copy array from src to dest of length sz.
static SACADO_INLINE_FUNCTION void copy(const T *src, T *dest, int sz)
Copy array from src to dest of length sz.
static SACADO_INLINE_FUNCTION void zero(T *dest, int sz)
Zero out array dest of length sz.
static SACADO_INLINE_FUNCTION void zero(T *dest, int sz)
Zero out array dest of length sz.
#define SACADO_INLINE_FUNCTION
Static array allocation class that works for any type.