STORMM Source Documentation
Loading...
Searching...
No Matches
coordinate_swap.h
1// -*-c++-*-
2#ifndef STORMM_COORDINATE_SWAP_H
3#define STORMM_COORDINATE_SWAP_H
4
5#include <algorithm>
6#include "copyright.h"
7#include "Accelerator/card_utilities.h"
8#include "Accelerator/gpu_details.h"
9#include "Accelerator/hybrid.h"
10#include "Reporting/error_format.h"
11#include "Synthesis/condensate.h"
12#include "Synthesis/phasespace_synthesis.h"
13#include "Topology/atomgraph_enumerators.h"
14#include "coordinate_series.h"
15#include "coordinate_util.h"
16
17namespace stormm {
18namespace trajectory {
19
20using card::GpuDetails;
21using card::HpcKernelSync;
22using card::Hybrid;
23using card::HybridTargetLevel;
24using synthesis::Condensate;
25using synthesis::CondensateBorders;
26using synthesis::CondensateWriter;
27using synthesis::PhaseSpaceSynthesis;
28using synthesis::PsSynthesisBorders;
29using synthesis::PsSynthesisWriter;
30using topology::UnitCellType;
31
39void swapValidatePrecisionModels(int first_bits, int second_bits, const char* desc);
40
59void swapValidateFrameIndices(int frm_first, int count_first, int frm_second, int count_second);
60
61void swapValidateFrameIndices(const int2* frm_pairs, int pair_count, int count_first,
62 int count_second);
64
72void swapValidateUnitCells(UnitCellType uca, UnitCellType ucb);
73
87void swapCheckSameObject(bool is_same, const int2* frm_pairs, int pair_count,
88 HybridTargetLevel tier_first, HybridTargetLevel tier_second);
89
103void swapValidateAtomCounts(int natom_first, int natom_second);
104
105template <typename T>
106void swapValidateAtomCounts(int frm_first, const T* natom_first, int frm_second,
107 const T* natom_second);
108
109template <typename T>
110void swapValidateAtomCounts(const int2* frm_pairs, int pair_count, const T* natom_first,
111 const T* natom_second);
113
157template <typename T>
158void swapCoordinates(T* first_x, T* first_y, T* first_z, T* second_x, T* second_y, T* second_z,
159 size_t first_ofs, size_t second_ofs, size_t natom, size_t frm_first = 0,
160 size_t frm_second = 0, int* first_xovrf = nullptr, int* first_yovrf = nullptr,
161 int* first_zovrf = nullptr, int* second_xovrf = nullptr,
162 int* second_yovrf = nullptr, int* second_zovrf = nullptr,
163 double* first_umat = nullptr, double* first_invu = nullptr,
164 double* first_bdim = nullptr, double* second_umat = nullptr,
165 double* second_invu = nullptr, double* second_bdim = nullptr);
166
167template <typename T>
168void swapCoordinates(T* first_x, T* first_y, T* first_z, T* second_x, T* second_y, T* second_z,
169 size_t first_ofs, size_t second_ofs, size_t natom, size_t frm_first,
170 size_t frm_second, double* first_umat, double* first_invu, double* first_bdim,
171 double* second_umat, double* second_invu, double* second_bdim);
172
173template <typename T>
174void swapCoordinates(CoordinateSeriesWriter<void> *v_first, size_t frm_first,
175 CoordinateSeriesWriter<void> *v_second, size_t frm_second);
176
177template <typename T>
178void swapCoordinates(CoordinateSeriesWriter<void> *v_first, CoordinateSeriesWriter<void> *v_second,
179 const int2* frm_pairs, int pair_count);
181
207void coordSwap(CoordinateSeriesWriter<void> *first, size_t frm_first,
208 CoordinateSeriesWriter<void> *second, size_t frm_second, size_t ct,
209 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
210 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
211 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
212
214 const int2* frm_pairs, int pair_count, size_t ct,
215 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
216 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
217 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
218
219template <typename T>
220void coordSwap(CoordinateSeries<T> *first, size_t frm_first, CoordinateSeries<T> *second,
221 size_t frm_second, HybridTargetLevel tier_first = HybridTargetLevel::HOST,
222 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
223 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
224
225template <typename T>
226void coordSwap(CoordinateSeries<T> *first, CoordinateSeries<T> *second,
227 const Hybrid<int2> &frm_pairs,
228 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
229 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
230 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
231
232void coordSwap(PsSynthesisWriter *first, int idx_first, PsSynthesisWriter *second,
233 int idx_second, const PsSynthesisBorders &first_bdrs,
234 const PsSynthesisBorders &second_bdrs,
235 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
236 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
237 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
238
239void coordSwap(PsSynthesisWriter *first, PsSynthesisWriter *second, const int2* idx_pairs,
240 int pair_count, const PsSynthesisBorders &first_bdrs,
241 const PsSynthesisBorders &second_bdrs,
242 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
243 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
244 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
245
246void coordSwap(PhaseSpaceSynthesis *first, int idx_first, PhaseSpaceSynthesis *second,
247 int idx_second, HybridTargetLevel tier_first = HybridTargetLevel::HOST,
248 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
249 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
250
251void coordSwap(PhaseSpaceSynthesis *first, PhaseSpaceSynthesis *second,
252 const Hybrid<int2> &idx_pairs,
253 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
254 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
255 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
256
257void coordSwap(CondensateWriter *first, size_t idx_first, CondensateWriter *second,
258 size_t idx_second, const CondensateBorders &first_bdrs,
259 const CondensateBorders &second_bdrs,
260 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
261 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
262 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
263
264void coordSwap(CondensateWriter *first, CondensateWriter *second, const int2* idx_pairs,
265 int pair_count, const CondensateBorders &first_bdrs,
266 const CondensateBorders &second_bdrs,
267 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
268 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
269 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
270
271void coordSwap(Condensate *first, size_t idx_first, Condensate *second, size_t idx_second,
272 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
273 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
274 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
275
276void coordSwap(Condensate *first, Condensate *second, const Hybrid<int2> &idx_pairs,
277 HybridTargetLevel tier_first = HybridTargetLevel::HOST,
278 HybridTargetLevel tier_second = HybridTargetLevel::HOST,
279 const GpuDetails &gpu = null_gpu, HpcKernelSync sync = HpcKernelSync::MEMORY_AUTO);
281
282} // namespace trajetory
283} // namespace stormm
284
285#include "coordinate_swap.tpp"
286
287#endif
Pertinent aspects of one particular GPU. Condensing the data for each GPU in this manner helps to ens...
Definition gpu_details.h:27
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
Condense the data format, and possibly offer a reduced representation of coordinates,...
Definition condensate.h:146
A fixed-precision representation of coordinates, velocities, and forces to manage a set of simulation...
Definition phasespace_synthesis.h:325
Store the coordinates and box information for a series of frames, in one of several levels of precisi...
Definition coordinate_series.h:137
A read-only abstract for the system demarcations in the object. This information is sometimes critica...
Definition condensate.h:43
Writeable abstract for the Condensate class, wherein coordinates (only) can be modified as a conseque...
Definition condensate.h:64
A read-only abstract for the system demarcations in the object. This information is sometimes critica...
Definition phasespace_synthesis.h:61
The writer for a PhaseSpaceSynthesis object, containing all of the data relevant for propagating dyna...
Definition phasespace_synthesis.h:87
Collect C-style pointers and critical constants for a writeable CoordinateSeries object.
Definition coordinate_series.h:66