1 #ifndef MIGRATIONCUDA_H 2 #define MIGRATIONCUDA_H 7 #ifdef NODEGROUP_FORCE_REGISTER 9 class MigrationCUDAKernel {
11 int* d_patchOffset_temp;
12 int* d_patchOffsetNB_temp;
13 int patchDeviceScan_alloc;
14 char* d_patchDeviceScan_scratch;
17 static constexpr
int kSortNumThreads = 512;
18 static constexpr
int kValuesPerThread = 4;
19 static constexpr
int kMaxAtomsPerPatch = kSortNumThreads * kValuesPerThread;
21 static constexpr
int kAtomsPerBuffer = 32;
22 static constexpr
int kNumSoABuffers = 17;
24 MigrationCUDAKernel();
25 ~MigrationCUDAKernel();
26 void allocateScratch(
const int numPatchesHomeAndProxy);
32 const double3* patchMin,
33 const double3* patchMax,
46 const bool langevinOn,
49 const double tempFactor,
63 int* hydrogenGroupSize,
64 int* migrationGroupSize,
66 float* rigidBondLength,
70 float* langScalVelBBK2,
71 float* langScalRandBBK2,
75 void sortSolventAtoms(
84 void computeMigrationGroupIndex(
87 const int* migrationGroupSize,
88 int* migrationGroupIndex,
92 void transformMigratedPositions(
95 const double3* patchCenter,
101 void transformPositions(
102 const int numPatches,
104 const double3* patchCenter,
107 const int* hydrogenGroupSize,
108 const int* migrationGroupSize,
109 const int* migrationGroupIndex,
116 void computeMigrationDestination(
117 const int numPatches,
121 const int* patchToDeviceMap,
122 const int* globalToLocalMap,
123 const double3* patchMin,
124 const double3* patchMax,
125 const int* hydrogenGroupSize,
126 const int* migrationGroupSize,
127 const int* migrationGroupIndex,
131 int4* migrationDestination,
136 const int numPatches,
148 void performLocalMigration(
149 const int numPatches,
153 int4* migrationDestination,
157 void performMigration(
158 const int numPatches,
163 const int* migrationGroupSize,
164 const int* migrationGroupIndex,
165 int4* migrationDestination,
169 void updateMigrationDestination(
170 const int numAtomsHome,
171 int4* migrationDestination,
172 int** d_peer_sortSoluteIndex,
176 void copyDataToProxies(
177 const int deviceIndex,
178 const int numPatchesHome,
179 const int numPatchesHomeAndProxy,
183 int** peer_sortOrder,
184 int** peer_unsortOrder,
186 int** peer_partition,
187 double3** peer_patchCenter,
192 void copyMigrationDestinationToProxies(
193 const int deviceIndex,
194 const int numPatchesHome,
195 const int numPatchesHomeAndProxy,
198 int4** peer_migrationDestination,
202 void updateLocalRecords(
203 const int numPatchesHome,
211 void updateLocalRecordsOffset(
212 const int numPatchesHomeAndProxy,
217 void updatePeerRecords(
218 const int numPatchesHomeAndProxy,
228 #endif // MIGRATIONCUDA_H
static void partition(int *order, const FullAtom *atoms, int begin, int end)