"platforms/opencl/tests/TestOpenCLCustomCompoundBondForce.cpp" did not exist on "35aef079c8abb2d2b1566052000b4e3a77593ab1"
Commit 1d4f5411 authored by peastman's avatar peastman
Browse files

Merge pull request #122 from peastman/master

Fixed bug in RPMD when using contractions
parents c010cffc e59e6f93
......@@ -285,6 +285,14 @@ void CudaIntegrateRPMDStepKernel::computeForces(ContextImpl& context) {
void* contractForceArgs[] = {&forces->getDevicePointer(), &contractedForces->getDevicePointer()};
cu.executeKernel(forceContractionKernels[copies], contractForceArgs, numParticles*numCopies, workgroupSize);
}
if (groupsByCopies.size() > 0) {
// Ensure the Context contains the positions from the last copy, since we'll assume that later.
int i = numCopies-1;
void* copyToContextArgs[] = {&velocities->getDevicePointer(), &cu.getVelm().getDevicePointer(), &positions->getDevicePointer(),
&cu.getPosq().getDevicePointer(), &cu.getAtomIndexArray().getDevicePointer(), &i};
cu.executeKernel(copyToContextKernel, copyToContextArgs, cu.getNumAtoms());
}
}
double CudaIntegrateRPMDStepKernel::computeKineticEnergy(ContextImpl& context, const RPMDIntegrator& integrator) {
......
......@@ -301,6 +301,13 @@ void OpenCLIntegrateRPMDStepKernel::computeForces(ContextImpl& context) {
cl.executeKernel(forceContractionKernels[copies], numParticles*numCopies, workgroupSize);
}
}
if (groupsByCopies.size() > 0) {
// Ensure the Context contains the positions from the last copy, since we'll assume that later.
copyToContextKernel.setArg<cl::Buffer>(2, positions->getDeviceBuffer());
copyToContextKernel.setArg<cl_int>(5, numCopies-1);
cl.executeKernel(copyToContextKernel, cl.getNumAtoms());
}
}
double OpenCLIntegrateRPMDStepKernel::computeKineticEnergy(ContextImpl& context, const RPMDIntegrator& integrator) {
......
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