Unverified Commit 10977800 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2524 from peastman/forcesvalid

Fixed error in BAOAB on CUDA and OpenCL
parents fd263401 025ec2f8
...@@ -73,6 +73,7 @@ vector<string> BAOABLangevinIntegrator::getKernelNames() { ...@@ -73,6 +73,7 @@ vector<string> BAOABLangevinIntegrator::getKernelNames() {
} }
double BAOABLangevinIntegrator::computeKineticEnergy() { double BAOABLangevinIntegrator::computeKineticEnergy() {
forcesAreValid = false;
return kernel.getAs<IntegrateBAOABStepKernel>().computeKineticEnergy(*context, *this); return kernel.getAs<IntegrateBAOABStepKernel>().computeKineticEnergy(*context, *this);
} }
...@@ -84,7 +85,8 @@ void BAOABLangevinIntegrator::step(int steps) { ...@@ -84,7 +85,8 @@ void BAOABLangevinIntegrator::step(int steps) {
if (context == NULL) if (context == NULL)
throw OpenMMException("This Integrator is not bound to a context!"); throw OpenMMException("This Integrator is not bound to a context!");
for (int i = 0; i < steps; ++i) { for (int i = 0; i < steps; ++i) {
context->updateContextState(); if (context->updateContextState())
forcesAreValid = false;
kernel.getAs<IntegrateBAOABStepKernel>().execute(*context, *this, forcesAreValid); kernel.getAs<IntegrateBAOABStepKernel>().execute(*context, *this, forcesAreValid);
} }
} }
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