Commit 6f7c46b4 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed error in mixed precision mode

parent abf9bd6b
......@@ -4,8 +4,8 @@
__kernel void applyAndersenThermostat(float collisionFrequency, float kT, __global mixed4* velm, __global const mixed2* restrict stepSize, __global const float4* restrict random,
unsigned int randomIndex, __global const int* restrict atomGroups) {
float collisionProbability = 1.0f-EXP(-collisionFrequency*stepSize[0].y);
float randomRange = erf(collisionProbability/SQRT(2.0f));
float collisionProbability = (float) (1.0f-exp(-collisionFrequency*stepSize[0].y));
float randomRange = (float) erf(collisionProbability/exp(2.0f));
for (int index = get_global_id(0); index < NUM_ATOMS; index += get_global_size(0)) {
mixed4 velocity = velm[index];
float4 selectRand = random[randomIndex+atomGroups[index]];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment