Commit 55ffb75f authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1550 from peastman/cpuerror

Fixed compilation error with OpenCL on CPU
parents 5782cb5c 2f024f11
...@@ -28,6 +28,7 @@ __kernel void computeNonbonded( ...@@ -28,6 +28,7 @@ __kernel void computeNonbonded(
#endif #endif
PARAMETER_ARGUMENTS) { PARAMETER_ARGUMENTS) {
mixed energy = 0; mixed energy = 0;
INIT_DERIVATIVES
__local AtomData localData[TILE_SIZE]; __local AtomData localData[TILE_SIZE];
// First loop: process tiles that contain exclusions. // First loop: process tiles that contain exclusions.
...@@ -87,6 +88,7 @@ __kernel void computeNonbonded( ...@@ -87,6 +88,7 @@ __kernel void computeNonbonded(
bool isExcluded = (atom1 >= NUM_ATOMS || atom2 >= NUM_ATOMS || !(excl & 0x1)); bool isExcluded = (atom1 >= NUM_ATOMS || atom2 >= NUM_ATOMS || !(excl & 0x1));
#endif #endif
real tempEnergy = 0; real tempEnergy = 0;
const real interactionScale = 0.5f;
COMPUTE_INTERACTION COMPUTE_INTERACTION
energy += 0.5f*tempEnergy; energy += 0.5f*tempEnergy;
#ifdef USE_SYMMETRIC #ifdef USE_SYMMETRIC
...@@ -155,6 +157,7 @@ __kernel void computeNonbonded( ...@@ -155,6 +157,7 @@ __kernel void computeNonbonded(
bool isExcluded = (atom1 >= NUM_ATOMS || atom2 >= NUM_ATOMS || !(excl & 0x1)); bool isExcluded = (atom1 >= NUM_ATOMS || atom2 >= NUM_ATOMS || !(excl & 0x1));
#endif #endif
real tempEnergy = 0; real tempEnergy = 0;
const real interactionScale = 1.0f;
COMPUTE_INTERACTION COMPUTE_INTERACTION
energy += tempEnergy; energy += tempEnergy;
#ifdef USE_SYMMETRIC #ifdef USE_SYMMETRIC
...@@ -318,6 +321,7 @@ __kernel void computeNonbonded( ...@@ -318,6 +321,7 @@ __kernel void computeNonbonded(
bool isExcluded = (atom1 >= NUM_ATOMS || atom2 >= NUM_ATOMS); bool isExcluded = (atom1 >= NUM_ATOMS || atom2 >= NUM_ATOMS);
#endif #endif
real tempEnergy = 0; real tempEnergy = 0;
const real interactionScale = 1.0f;
COMPUTE_INTERACTION COMPUTE_INTERACTION
energy += tempEnergy; energy += tempEnergy;
#ifdef USE_SYMMETRIC #ifdef USE_SYMMETRIC
...@@ -382,6 +386,7 @@ __kernel void computeNonbonded( ...@@ -382,6 +386,7 @@ __kernel void computeNonbonded(
bool isExcluded = (atom1 >= NUM_ATOMS || atom2 >= NUM_ATOMS); bool isExcluded = (atom1 >= NUM_ATOMS || atom2 >= NUM_ATOMS);
#endif #endif
real tempEnergy = 0; real tempEnergy = 0;
const real interactionScale = 1.0f;
COMPUTE_INTERACTION COMPUTE_INTERACTION
energy += tempEnergy; energy += tempEnergy;
#ifdef USE_SYMMETRIC #ifdef USE_SYMMETRIC
...@@ -441,4 +446,5 @@ __kernel void computeNonbonded( ...@@ -441,4 +446,5 @@ __kernel void computeNonbonded(
pos++; pos++;
} }
energyBuffer[get_global_id(0)] += energy; energyBuffer[get_global_id(0)] += energy;
SAVE_DERIVATIVES
} }
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