Commit af57bf98 authored by peastman's avatar peastman
Browse files

Minor improvement

parent 9fa21b3a
...@@ -1129,7 +1129,7 @@ bool CudaContext::invalidateMolecules(CudaForceInfo* force) { ...@@ -1129,7 +1129,7 @@ bool CudaContext::invalidateMolecules(CudaForceInfo* force) {
Molecule& m1 = molecules[instances[0]]; Molecule& m1 = molecules[instances[0]];
int offset1 = offsets[0]; int offset1 = offsets[0];
int numThreads = threads.getNumThreads(); int numThreads = threads.getNumThreads();
int start = threadIndex*numMolecules/numThreads; int start = max(1, threadIndex*numMolecules/numThreads);
int end = (threadIndex+1)*numMolecules/numThreads; int end = (threadIndex+1)*numMolecules/numThreads;
for (int j = start; j < end; j++) { for (int j = start; j < end; j++) {
// See if the atoms are identical. // See if the atoms are identical.
......
...@@ -1016,7 +1016,7 @@ bool OpenCLContext::invalidateMolecules(OpenCLForceInfo* force) { ...@@ -1016,7 +1016,7 @@ bool OpenCLContext::invalidateMolecules(OpenCLForceInfo* force) {
Molecule& m1 = molecules[instances[0]]; Molecule& m1 = molecules[instances[0]];
int offset1 = offsets[0]; int offset1 = offsets[0];
int numThreads = threads.getNumThreads(); int numThreads = threads.getNumThreads();
int start = threadIndex*numMolecules/numThreads; int start = max(1, threadIndex*numMolecules/numThreads);
int end = (threadIndex+1)*numMolecules/numThreads; int end = (threadIndex+1)*numMolecules/numThreads;
for (int j = start; j < end; j++) { for (int j = start; j < end; j++) {
// See if the atoms are identical. // See if the atoms are identical.
......
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