Commit 025ec2f8 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed error in BAOAB on CUDA and OpenCL

parent fd263401
...@@ -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