40 #ifndef TPETRA_DETAILS_PACKTRAITS_HPP
41 #define TPETRA_DETAILS_PACKTRAITS_HPP
49 #include "Tpetra_ConfigDefs.hpp"
50 #include "Kokkos_Core.hpp"
104 KOKKOS_INLINE_FUNCTION
109 return static_cast<size_t> (1);
126 KOKKOS_INLINE_FUNCTION
127 static Kokkos::pair<int, size_t>
134 typedef Kokkos::pair<int, size_t> pair_type;
137 return pair_type (errorCode, numBytes);
154 memcpy (outBuf, inBuf, numBytes);
155 return pair_type (errorCode, numBytes);
174 KOKKOS_INLINE_FUNCTION
175 static Kokkos::pair<int, size_t>
182 typedef Kokkos::pair<int, size_t> pair_type;
185 return pair_type (errorCode, numBytes);
204 memcpy (outBuf, inBuf, numBytes);
205 return pair_type (errorCode, numBytes);
232 KOKKOS_INLINE_FUNCTION
248 KOKKOS_INLINE_FUNCTION
260 memcpy (outBuf, &inVal, numBytes);
275 KOKKOS_INLINE_FUNCTION
278 const size_t outBufIndex,
285 const size_t offset = outBufIndex * numBytes;
289 memcpy (outBuf + offset, &inVal, numBytes);
305 KOKKOS_INLINE_FUNCTION
316 memcpy (&outVal, inBuf, numBytes);
324 #endif // TPETRA_DETAILS_PACKTRAITS_HPP
LO value_type
The type of data to pack or unpack.
Kokkos::View< char *, Kokkos::AnonymousSpace > output_buffer_type
The type of an output buffer of bytes.
static KOKKOS_INLINE_FUNCTION size_t numValuesPerScalar(const value_type &)
Given an instance of value_type allocated with the right size, return the "number of values" that mak...
static KOKKOS_INLINE_FUNCTION size_t unpackValue(T &outVal, const char inBuf[])
Unpack the given value from the given output buffer.
Traits class for packing / unpacking data of type T.
static KOKKOS_INLINE_FUNCTION Kokkos::pair< int, size_t > packArray(char outBuf[], const value_type inBuf[], const size_t numEnt)
Pack the first numEnt entries of the given input buffer of value_type, into the output buffer of byte...
static const bool compileTimeSize
Whether the number of bytes required to pack one instance of value_type is fixed at compile time...
static KOKKOS_INLINE_FUNCTION size_t packValue(char outBuf[], const size_t outBufIndex, const T &inVal)
Pack the given value of type value_type into the given output buffer of bytes (char).
static KOKKOS_INLINE_FUNCTION size_t packValue(char outBuf[], const T &inVal)
Pack the given value of type value_type into the given output buffer of bytes (char).
Kokkos::View< const char *, Kokkos::AnonymousSpace > input_buffer_type
The type of an input buffer of bytes.
Kokkos::View< const value_type *, Kokkos::AnonymousSpace > input_array_type
The type of an input array of value_type.
Kokkos::View< value_type *, Kokkos::AnonymousSpace > output_array_type
The type of an output array of value_type.
static KOKKOS_INLINE_FUNCTION size_t packValueCount(const T &)
Number of bytes required to pack or unpack the given value of type value_type.
static KOKKOS_INLINE_FUNCTION Kokkos::pair< int, size_t > unpackArray(value_type outBuf[], const char inBuf[], const size_t numEnt)
Unpack numEnt value_type entries from the given input buffer of bytes, to the given output buffer of ...