42 #ifndef TPETRA_DETAILS_PACKTRAITS_HPP
43 #define TPETRA_DETAILS_PACKTRAITS_HPP
51 #include "Tpetra_ConfigDefs.hpp"
52 #include "Kokkos_Core.hpp"
62 template<
class T,
class D>
108 KOKKOS_INLINE_FUNCTION
113 return static_cast<size_t> (1);
140 static Kokkos::View<value_type*, D>
143 const std::string& label =
"")
145 typedef Kokkos::View<value_type*, D> view_type;
146 typedef typename view_type::size_type size_type;
157 if ( std::is_same< typename view_type::traits::specialize, void >::value ) {
158 return view_type (label, static_cast<size_type> (numEnt));
161 return view_type (label, static_cast<size_type> (numEnt), numVals);
179 KOKKOS_INLINE_FUNCTION
180 static Kokkos::pair<int, size_t>
187 typedef Kokkos::pair<int, size_t> pair_type;
190 return pair_type (errorCode, numBytes);
207 memcpy (outBuf, inBuf, numBytes);
208 return pair_type (errorCode, numBytes);
227 KOKKOS_INLINE_FUNCTION
228 static Kokkos::pair<int, size_t>
235 typedef Kokkos::pair<int, size_t> pair_type;
238 return pair_type (errorCode, numBytes);
257 memcpy (outBuf, inBuf, numBytes);
258 return pair_type (errorCode, numBytes);
285 KOKKOS_INLINE_FUNCTION
301 KOKKOS_INLINE_FUNCTION
313 memcpy (outBuf, &inVal, numBytes);
328 KOKKOS_INLINE_FUNCTION
331 const size_t outBufIndex,
338 const size_t offset = outBufIndex * numBytes;
342 memcpy (outBuf + offset, &inVal, numBytes);
358 KOKKOS_INLINE_FUNCTION
369 memcpy (&outVal, inBuf, numBytes);
377 #endif // TPETRA_DETAILS_PACKTRAITS_HPP