Commit 7b65830a authored by peastman's avatar peastman
Browse files

Merge pull request #650 from peastman/opt

Optimizations to AMOEBA
parents 61a8b779 87dd3823
......@@ -87,17 +87,13 @@ __device__ void computeOneInteraction(AtomData& atom1, AtomData& atom2, real3 de
real scale3 = 1;
real scale5 = 1;
real damp = atom1.damp*atom2.damp;
if (damp != 0) {
real ratio = (r/damp);
ratio = ratio*ratio*ratio;
float pgamma = atom1.thole < atom2.thole ? atom1.thole : atom2.thole;
damp = -pgamma*ratio;
if (damp > -50) {
damp = damp == 0 ? 0 : -pgamma*ratio;
real expdamp = EXP(damp);
scale3 = 1 - expdamp;
scale5 = 1 - expdamp*(1-damp);
}
}
real dsc3 = scale3;
real dsc5 = scale5;
real r3 = (r*r2);
......
......@@ -211,7 +211,6 @@ computeOneInteractionF2NoScale(
real pgamma = atom1.thole < atom2.thole ? atom1.thole : atom2.thole;
real ratio = RECIP(rr1*damp);
damp = -pgamma*ratio*ratio*ratio;
damp = damp < -50 ? 0 : damp;
}
real scale5 = (damp == 0) ? 1 : (1 - (1-damp)*EXP(damp));
......@@ -358,8 +357,7 @@ computeOneInteractionF2NoScale(
ftm22 += gfi1*yr;
ftm23 += gfi1*zr;
if (damp != 0) {
{
real expdamp = EXP(damp);
real temp3 = -1.5f*damp*expdamp*rr1*rr1;
real temp5 = -damp;
......@@ -556,8 +554,7 @@ computeOneInteractionF2NoScale(
ftm22 += gfi1*yr;
ftm23 += gfi1*zr;
if (damp != 0) {
{
real expdamp = EXP(damp);
real temp3 = -1.5f*damp*expdamp*rr1*rr1;
real temp5 = -damp;
......
......@@ -129,7 +129,6 @@ computeOneInteractionF2NoScale(
real pgamma = atom1.thole < atom2.thole ? atom1.thole : atom2.thole;
real ratio = RECIP(rr1*damp);
damp = -pgamma*ratio*ratio*ratio;
damp = damp < -50 ? 0 : damp;
}
real scale5 = (damp == 0) ? 1 : (1 - (1-damp)*EXP(damp));
......@@ -232,8 +231,7 @@ computeOneInteractionF2NoScale(
ftm22 += gfi1*yr;
ftm23 += gfi1*zr;
if (damp != 0) {
{
real expdamp = EXP(damp);
real temp3 = -1.5f*damp*expdamp*rr1*rr1;
real temp5 = -damp;
......@@ -376,8 +374,7 @@ computeOneInteractionF2NoScale(
ftm22 += gfi1*yr;
ftm23 += gfi1*zr;
if (damp != 0) {
{
real expdamp = EXP(damp);
real temp3 = -1.5f*damp*expdamp*rr1*rr1;
real temp5 = -damp;
......
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