"vscode:/vscode.git/clone" did not exist on "c5de7cd88679bc0331185c9cee75e4f68412243d"
Commit 62f7a04c authored by Thomas Trummer's avatar Thomas Trummer
Browse files

Fix invalid call to __host__ function in computeBondedForces

Explicitly cast the second parameter to the type of the first one so the compiler can pick an overload that is supported in device code (fixes error: calling a __host__ function("fmin<float, int, (int)0> ") from a __global__ function("computeBondedForces") is not allowed).
parent bd333a1b
...@@ -61,8 +61,8 @@ angleB = fmod(angleB+2.0f*PI, 2.0f*PI); ...@@ -61,8 +61,8 @@ angleB = fmod(angleB+2.0f*PI, 2.0f*PI);
int2 pos = MAP_POS[MAPS[index]]; int2 pos = MAP_POS[MAPS[index]];
int size = pos.y; int size = pos.y;
real delta = 2*PI/size; real delta = 2*PI/size;
int s = (int) fmin(angleA/delta, size-1); int s = (int) fmin(angleA/delta, (real) (size-1));
int t = (int) fmin(angleB/delta, size-1); int t = (int) fmin(angleB/delta, (real) (size-1));
float4 c[4]; float4 c[4];
int coeffIndex = pos.x+4*(s+size*t); int coeffIndex = pos.x+4*(s+size*t);
c[0] = COEFF[coeffIndex]; c[0] = COEFF[coeffIndex];
......
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