15 #if defined(NAMD_CUDA) || defined(NAMD_HIP) 20 #include <hip/hip_runtime.h> 62 return (this->ig == other.
ig);
67 template <
bool doFixed>
80 __forceinline__ __device__
85 for(
int i = 0; i <hgs; i++){
96 __host__ __device__ __forceinline__
104 return (elem.
icnt == 0);
109 __forceinline__ __host__ __device__
121 const double * vel_x,
122 const double * vel_y,
123 const double * vel_z,
124 const double * pos_x,
125 const double * pos_y,
126 const double * pos_z,
138 const int * hydrogenGroupSize,
139 const float * rigidBondLength,
140 const int * atomFixed,
144 cudaStream_t stream);
146 __global__
void Settle_fp32(
int numAtoms,
float dt,
float invdt,
int nSettles,
147 const double * __restrict vel_x,
const double * __restrict vel_y,
148 const double * __restrict vel_z,
149 const double * __restrict pos_x,
const double * __restrict pos_y,
150 const double * __restrict pos_z,
151 double * __restrict velNew_x,
double * __restrict velNew_y,
152 double * __restrict velNew_z,
153 double * __restrict posNew_x,
double * __restrict posNew_y,
154 double * __restrict posNew_z,
155 const int * __restrict hydrogenGroupSize,
const float * __restrict rigidBondLength,
156 const int * __restrict atomFixed,
157 int * __restrict settleList,
161 const double * __restrict vel_x,
162 const double * __restrict vel_y,
163 const double * __restrict vel_z,
164 const double * __restrict pos_x,
165 const double * __restrict pos_y,
166 const double * __restrict pos_z,
167 double * __restrict velNew_x,
168 double * __restrict velNew_y,
169 double * __restrict velNew_z,
170 double * __restrict posNew_x,
171 double * __restrict posNew_y,
172 double * __restrict posNew_z,
173 const int * __restrict hydrogenGroupSize,
174 const float * __restrict rigidBondLength,
175 const int * __restrict atomFixed,
186 const int *hydrogenGroupSize,
187 const int *atomFixed,
194 const double *ref_velx,
195 const double *ref_vely,
196 const double *ref_velz,
210 cudaStream_t stream);
221 const double * pos_x,
222 const double * pos_y,
223 const double * pos_z,
228 const int * hydrogenGroupSize,
229 const float * rigidBondLength,
230 const int * atomFixed,
238 const int nSettleBlocks,
239 const int nShakeBlocks,
__device__ bool operator()(CudaRattleElem elem)
__forceinline__ __device__ bool operator()(const int x)
__forceinline__ __host__ __device__ bool operator()(const int i)
__global__ void rattlePair(int nRattlePairs, const double *__restrict vel_x, const double *__restrict vel_y, const double *__restrict vel_z, const double *__restrict pos_x, const double *__restrict pos_y, const double *__restrict pos_z, double *__restrict velNew_x, double *__restrict velNew_y, double *__restrict velNew_z, double *__restrict posNew_x, double *__restrict posNew_y, double *__restrict posNew_z, const int *__restrict hydrogenGroupSize, const float *__restrict rigidBondLength, const int *__restrict atomFixed, int *consFailure)
isWater(const float *rigidBondLength, const int *hydrogenGroupSize, const int *atomFixed)
void Settle(const bool doEnergy, int numAtoms, const double dt, const double invdt, const int nSettles, const double *vel_x, const double *vel_y, const double *vel_z, const double *pos_x, const double *pos_y, const double *pos_z, double *velNew_x, double *velNew_y, double *velNew_z, double *posNew_x, double *posNew_y, double *posNew_z, double *f_normal_x, double *f_normal_y, double *f_normal_z, cudaTensor *virial, const float *mass, const int *hydrogenGroupSize, const float *rigidBondLength, const int *atomFixed, int *settleList, const SettleParameters *sp, const WaterModel water_model, cudaStream_t stream)
CudaRattleParam params[4]
__host__ __device__ __forceinline__ bool operator()(const int &i) const
void MSHAKE_CUDA(const bool doEnergy, const bool doFixed, const CudaRattleElem *rattleList, const int size, const int *hydrogenGroupSize, const int *atomFixed, const double *refx, const double *refy, const double *refz, double *posx, double *posy, double *posz, const double *ref_velx, const double *ref_vely, const double *ref_velz, double *velx, double *vely, double *velz, double *f_normal_x, double *f_normal_y, double *f_normal_z, cudaTensor *rigidVirial, const float *mass, const double invdt, const BigReal tol2, const int maxiter, int *consFailure_d, int *consFailure, cudaStream_t stream)
void CallRattle1Kernel(int numAtoms, const double dt, const double invdt, const int nSettles, double *vel_x, double *vel_y, double *vel_z, const double *pos_x, const double *pos_y, const double *pos_z, double *f_normal_x, double *f_normal_y, double *f_normal_z, const float *mass, const int *hydrogenGroupSize, const float *rigidBondLength, const int *atomFixed, int *settleList, const SettleParameters *sp, const CudaRattleElem *rattleList, const int nShakes, const BigReal tol2_d, const int maxiter_d, int *consFailure, const int nSettleBlocks, const int nShakeBlocks, const WaterModel water_model, cudaStream_t stream)
__global__ void Settle_fp32(int numAtoms, float dt, float invdt, int nSettles, const double *__restrict vel_x, const double *__restrict vel_y, const double *__restrict vel_z, const double *__restrict pos_x, const double *__restrict pos_y, const double *__restrict pos_z, double *__restrict velNew_x, double *__restrict velNew_y, double *__restrict velNew_z, double *__restrict posNew_x, double *__restrict posNew_y, double *__restrict posNew_z, const int *__restrict hydrogenGroupSize, const float *__restrict rigidBondLength, const int *__restrict atomFixed, int *__restrict settleList, const SettleParameters *__restrict sp)
__device__ bool operator==(const CudaRattleElem &other) const
__global__ void CheckConstraints(int *consFailure, int size)
const int * hydrogenGroupSize
const float * rigidBondLength