Commit 65c389ff authored by Peter Eastman's avatar Peter Eastman
Browse files

Flush the queue after each time step on Windows to reduce UI lag.

parent 1107aa83
......@@ -4033,6 +4033,12 @@ void OpenCLIntegrateVerletStepKernel::execute(ContextImpl& context, const Verlet
cl.setTime(cl.getTime()+dt);
cl.setStepCount(cl.getStepCount()+1);
// Reduce UI lag.
#ifdef WIN32
cl.getQueue().flush();
#endif
}
OpenCLIntegrateLangevinStepKernel::~OpenCLIntegrateLangevinStepKernel() {
......@@ -4110,6 +4116,12 @@ void OpenCLIntegrateLangevinStepKernel::execute(ContextImpl& context, const Lang
cl.setTime(cl.getTime()+stepSize);
cl.setStepCount(cl.getStepCount()+1);
// Reduce UI lag.
#ifdef WIN32
cl.getQueue().flush();
#endif
}
OpenCLIntegrateBrownianStepKernel::~OpenCLIntegrateBrownianStepKernel() {
......@@ -4170,6 +4182,12 @@ void OpenCLIntegrateBrownianStepKernel::execute(ContextImpl& context, const Brow
cl.setTime(cl.getTime()+stepSize);
cl.setStepCount(cl.getStepCount()+1);
// Reduce UI lag.
#ifdef WIN32
cl.getQueue().flush();
#endif
}
OpenCLIntegrateVariableVerletStepKernel::~OpenCLIntegrateVariableVerletStepKernel() {
......@@ -4227,6 +4245,12 @@ double OpenCLIntegrateVariableVerletStepKernel::execute(ContextImpl& context, co
cl.executeKernel(kernel2, numAtoms);
integration.computeVirtualSites();
// Reduce UI lag.
#ifdef WIN32
cl.getQueue().flush();
#endif
// Update the time and step count.
mm_float2 stepSize;
......@@ -4307,6 +4331,12 @@ double OpenCLIntegrateVariableLangevinStepKernel::execute(ContextImpl& context,
cl.executeKernel(kernel2, numAtoms);
integration.computeVirtualSites();
// Reduce UI lag.
#ifdef WIN32
cl.getQueue().flush();
#endif
// Update the time and step count.
mm_float2 stepSize;
......@@ -4834,6 +4864,12 @@ void OpenCLIntegrateCustomStepKernel::execute(ContextImpl& context, CustomIntegr
cl.setTime(cl.getTime()+stepSize);
cl.setStepCount(cl.getStepCount()+1);
// Reduce UI lag.
#ifdef WIN32
cl.getQueue().flush();
#endif
}
void OpenCLIntegrateCustomStepKernel::recordChangedParameters(ContextImpl& context) {
......
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