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(
"Trying to pack data type (" << LvArray::system::demangleType< T >() <<
") on device but type is not packable." );
71 template<
bool DO_PACKING,
typename T,
int NDIM,
int USD,
typename T_INDICES >
72 typename std::enable_if< can_memcpy< T >,
localIndex >::type
74 ArrayView< T const, NDIM, USD >
const & var,
75 T_INDICES
const & indices,
76 parallelDeviceEvents & events );
79 template<
bool DO_PACKING,
typename T,
typename T_INDICES >
86 GEOS_ERROR(
"Trying to pack data type (" << LvArray::system::demangleType< T >() <<
") on device but type is not packable by index." );
91 template<
typename T,
int NDIM,
int USD >
92 typename std::enable_if< can_memcpy< T >,
localIndex >::type
94 ArrayView< T, NDIM, USD >
const & var,
95 parallelDeviceEvents & events );
98 template<
typename T >
104 GEOS_ERROR(
"Trying to unpack data type (" << LvArray::system::demangleType< T >() <<
") on device but type is not packable." );
109 template<
typename T,
int NDIM,
int USD,
typename T_INDICES >
110 typename std::enable_if< can_memcpy< T >,
localIndex >::type
112 ArrayView< T, NDIM, USD >
const & var,
113 T_INDICES
const & indices,
114 parallelDeviceEvents & events,
115 MPI_Op op=MPI_REPLACE );
118 template<
typename T,
typename T_INDICES >
126 GEOS_ERROR(
"Trying to unpack data type (" << LvArray::system::demangleType< T >() <<
") but type is not packable by index." );
132 template<
bool DO_PACKING,
typename T >
138 parallelDeviceEvents & events );
141 template<
typename T >
147 parallelDeviceEvents & events );
150 template<
bool DO_PACKING,
typename T,
int NDIM,
int USD >
151 typename std::enable_if< can_memcpy< T >,
localIndex >::type
153 ArrayView< T const, NDIM, USD >
const & var,
154 parallelDeviceEvents & events );
157 template<
bool DO_PACKING,
typename T >
164 GEOS_ERROR(
"Trying to pack data type (" << LvArray::system::demangleType< T >() <<
") on device but type is not packable." );
169 template<
bool DO_PACKING,
typename T,
int NDIM,
int USD,
typename T_INDICES >
170 typename std::enable_if< can_memcpy< T >,
localIndex >::type
172 ArrayView< T const, NDIM, USD >
const & var,
173 T_INDICES
const & indices,
174 parallelDeviceEvents & events );
177 template<
bool DO_PACKING,
typename T,
typename T_INDICES >
184 GEOS_ERROR(
"Trying to pack data type (" << LvArray::system::demangleType< T >() <<
") on device but type is not packable by index." );
189 template<
typename T,
int NDIM,
int USD >
190 typename std::enable_if< can_memcpy< T >,
localIndex >::type
192 ArrayView< T, NDIM, USD >
const & var,
193 parallelDeviceEvents & events );
196 template<
typename T >
202 GEOS_ERROR(
"Trying to unpack data type (" << LvArray::system::demangleType< T >() <<
") on device but type is not packable." );
207 template<
typename T,
int NDIM,
int USD,
typename T_INDICES >
208 typename std::enable_if< can_memcpy< T >,
localIndex >::type
210 ArrayView< T, NDIM, USD >
const & var,
211 T_INDICES
const & indices,
212 parallelDeviceEvents & events,
213 MPI_Op op=MPI_REPLACE );
216 template<
typename T,
typename T_INDICES >
224 GEOS_ERROR(
"Trying to unpack data type (" << LvArray::system::demangleType< T >() <<
") but type is not packable by index." );
#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(msg)
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.