16 #ifndef GEOS_DATAREPOSITORY_BUFFEROPSDEVICE_H_
17 #define GEOS_DATAREPOSITORY_BUFFEROPSDEVICE_H_
20 #include "codingUtilities/Utilities.hpp"
21 #include "codingUtilities/traits.hpp"
22 #include "LvArray/src/limits.hpp"
23 #include "BufferOps.hpp"
25 #include "common/GEOS_RAJA_Interface.hpp"
27 #include <type_traits>
36 template<
bool DO_PACKING,
typename T >
44 template<
typename T >
52 template<
bool DO_PACKING,
typename T,
int NDIM,
int USD >
53 typename std::enable_if< can_memcpy< T >,
localIndex >::type
55 ArrayView< T const, NDIM, USD >
const & var,
56 parallelDeviceEvents & events );
59 template<
bool DO_PACKING,
typename T >
66 GEOS_ERROR( GEOS_FMT(
"Trying to pack data type ({}) on device but type is not packable.",
67 LvArray::system::demangleType< T >() ) );
72 template<
bool DO_PACKING,
typename T,
int NDIM,
int USD,
typename T_INDICES >
73 typename std::enable_if< can_memcpy< T >,
localIndex >::type
75 ArrayView< T const, NDIM, USD >
const & var,
76 T_INDICES
const & indices,
77 parallelDeviceEvents & events );
80 template<
bool DO_PACKING,
typename T,
typename T_INDICES >
87 GEOS_ERROR( GEOS_FMT(
"Trying to pack data type ({}) on device but type is not packable by index.",
88 LvArray::system::demangleType< T >() ) );
93 template<
typename T,
int NDIM,
int USD >
94 typename std::enable_if< can_memcpy< T >,
localIndex >::type
96 ArrayView< T, NDIM, USD >
const & var,
97 parallelDeviceEvents & events );
100 template<
typename T >
106 GEOS_ERROR( GEOS_FMT(
"Trying to unpack data type ({}) on device but type is not packable.",
107 LvArray::system::demangleType< T >() ) );
112 template<
typename T,
int NDIM,
int USD,
typename T_INDICES >
113 typename std::enable_if< can_memcpy< T >,
localIndex >::type
115 ArrayView< T, NDIM, USD >
const & var,
116 T_INDICES
const & indices,
117 parallelDeviceEvents & events,
118 MPI_Op op=MPI_REPLACE );
121 template<
typename T,
typename T_INDICES >
129 GEOS_ERROR( GEOS_FMT(
"Trying to unpack data type ({}) but type is not packable by index.",
130 LvArray::system::demangleType< T >() ) );
136 template<
bool DO_PACKING,
typename T >
142 parallelDeviceEvents & events );
145 template<
typename T >
151 parallelDeviceEvents & events );
154 template<
bool DO_PACKING,
typename T,
int NDIM,
int USD >
155 typename std::enable_if< can_memcpy< T >,
localIndex >::type
157 ArrayView< T const, NDIM, USD >
const & var,
158 parallelDeviceEvents & events );
161 template<
bool DO_PACKING,
typename T >
168 GEOS_ERROR( GEOS_FMT(
"Trying to pack data type ({}) on device but type is not packable.",
169 LvArray::system::demangleType< T >() ) );
174 template<
bool DO_PACKING,
typename T,
int NDIM,
int USD,
typename T_INDICES >
175 typename std::enable_if< can_memcpy< T >,
localIndex >::type
177 ArrayView< T const, NDIM, USD >
const & var,
178 T_INDICES
const & indices,
179 parallelDeviceEvents & events );
182 template<
bool DO_PACKING,
typename T,
typename T_INDICES >
189 GEOS_ERROR( GEOS_FMT(
"Trying to pack data type ({}) on device but type is not packable by index.",
190 LvArray::system::demangleType< T >() ) );
195 template<
typename T,
int NDIM,
int USD >
196 typename std::enable_if< can_memcpy< T >,
localIndex >::type
198 ArrayView< T, NDIM, USD >
const & var,
199 parallelDeviceEvents & events );
202 template<
typename T >
208 GEOS_ERROR( GEOS_FMT(
"Trying to unpack data type ({}) on device but type is not packable.",
209 LvArray::system::demangleType< T >() ) );
214 template<
typename T,
int NDIM,
int USD,
typename T_INDICES >
215 typename std::enable_if< can_memcpy< T >,
localIndex >::type
217 ArrayView< T, NDIM, USD >
const & var,
218 T_INDICES
const & indices,
219 parallelDeviceEvents & events,
220 MPI_Op op=MPI_REPLACE );
223 template<
typename T,
typename T_INDICES >
231 GEOS_ERROR( GEOS_FMT(
"Trying to unpack data type ({}) but type is not packable by index.",
232 LvArray::system::demangleType< T >() ) );
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_RESTRICT
preprocessor variable for the C99 restrict keyword for use with pointers
#define GEOS_UNUSED_PARAM(X)
Mark an unused argument and silence compiler warnings.
#define GEOS_ERROR(...)
Raise a hard error and terminate the program.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
signed char buffer_unit_type
Type stored in communication buffers.