// @HEADER // ***************************************************************************** // Stokhos Package // // Copyright 2009 NTESS and the Stokhos contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef STOKHOS_STATIC_ARRAY_TRAITS_HPP #define STOKHOS_STATIC_ARRAY_TRAITS_HPP #include #include "Sacado_Traits.hpp" #include "Kokkos_Macros.hpp" #include "Stokhos_MemoryTraits.hpp" namespace Stokhos { /*! * \brief Static array allocation class */ template ::value> struct StaticArrayTraits {}; /*! * \brief Static array allocation class that works for any type */ template struct StaticArrayTraits { typedef T value_type; typedef D execution_space; //! Copy array from \c src to \c dest of length \c sz static KOKKOS_INLINE_FUNCTION void copy(const volatile T* src, volatile T* dest, std::size_t sz) { for (std::size_t i=0; i struct StaticArrayTraits { typedef T value_type; typedef D execution_space; //! Copy array from \c src to \c dest of length \c sz static KOKKOS_INLINE_FUNCTION void copy(const volatile T* src, volatile T* dest, std::size_t sz) { // if (sz > 0) // std::memcpy(const_cast(dest),const_cast(src),sz*sizeof(T)); #ifdef STOKHOS_HAVE_PRAGMA_IVDEP #pragma ivdep #endif #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED #pragma vector aligned #endif #ifdef STOKHOS_HAVE_PRAGMA_UNROLL #pragma unroll #endif for (std::size_t i=0; i 0) // std::memcpy(dest,const_cast(src),sz*sizeof(T)); #ifdef STOKHOS_HAVE_PRAGMA_IVDEP #pragma ivdep #endif #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED #pragma vector aligned #endif #ifdef STOKHOS_HAVE_PRAGMA_UNROLL #pragma unroll #endif for (std::size_t i=0; i 0) // std::memcpy(const_cast(dest),src,sz*sizeof(T)); #ifdef STOKHOS_HAVE_PRAGMA_IVDEP #pragma ivdep #endif #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED #pragma vector aligned #endif #ifdef STOKHOS_HAVE_PRAGMA_UNROLL #pragma unroll #endif for (std::size_t i=0; i 0) std::memcpy(dest,src,sz*sizeof(T)); #ifdef STOKHOS_HAVE_PRAGMA_IVDEP #pragma ivdep #endif #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED #pragma vector aligned #endif #ifdef STOKHOS_HAVE_PRAGMA_UNROLL #pragma unroll #endif for (std::size_t i=0; i 0) std::memset(dest,0,sz*sizeof(T)); #ifdef STOKHOS_HAVE_PRAGMA_IVDEP #pragma ivdep #endif #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED #pragma vector aligned #endif #ifdef STOKHOS_HAVE_PRAGMA_UNROLL #pragma unroll #endif for (std::size_t i=0; i 0) std::memset(const_cast(dest),0,sz*sizeof(T)); #ifdef STOKHOS_HAVE_PRAGMA_IVDEP #pragma ivdep #endif #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED #pragma vector aligned #endif #ifdef STOKHOS_HAVE_PRAGMA_UNROLL #pragma unroll #endif for (std::size_t i=0; i