"serialization/tests/TestSerializeCustomCentroidBondForce.cpp" did not exist on "ede48b85dc905d36a0314b7fcaf2c95b6d78635e"
Commit 6f4944e0 authored by Peter Eastman's avatar Peter Eastman
Browse files

Test case was crashing if the neighbor list needed to be resized

parent 3ec0d906
...@@ -464,17 +464,19 @@ void testBlockInteractions(bool periodic) { ...@@ -464,17 +464,19 @@ void testBlockInteractions(bool periodic) {
system.addForce(nonbonded); system.addForce(nonbonded);
Context context(system, integrator, cl); Context context(system, integrator, cl);
context.setPositions(positions); context.setPositions(positions);
State state = context.getState(State::Positions | State::Velocities | State::Forces);
ContextImpl* contextImpl = *reinterpret_cast<ContextImpl**>(&context); ContextImpl* contextImpl = *reinterpret_cast<ContextImpl**>(&context);
OpenCLPlatform::PlatformData& data = *static_cast<OpenCLPlatform::PlatformData*>(contextImpl->getPlatformData()); OpenCLPlatform::PlatformData& data = *static_cast<OpenCLPlatform::PlatformData*>(contextImpl->getPlatformData());
OpenCLContext& clcontext = *data.context; OpenCLContext& clcontext = *data.context;
OpenCLNonbondedUtilities& nb = clcontext.getNonbondedUtilities();
State state = context.getState(State::Positions | State::Velocities | State::Forces);
nb.updateNeighborListSize();
state = context.getState(State::Positions | State::Velocities | State::Forces);
// Verify that the bounds of each block were calculated correctly. // Verify that the bounds of each block were calculated correctly.
clcontext.getPosq().download(); clcontext.getPosq().download();
vector<mm_float4> blockCenters(numBlocks); vector<mm_float4> blockCenters(numBlocks);
vector<mm_float4> blockBoundingBoxes(numBlocks); vector<mm_float4> blockBoundingBoxes(numBlocks);
OpenCLNonbondedUtilities& nb = clcontext.getNonbondedUtilities();
nb.getBlockCenters().download(blockCenters); nb.getBlockCenters().download(blockCenters);
nb.getBlockBoundingBoxes().download(blockBoundingBoxes); nb.getBlockBoundingBoxes().download(blockBoundingBoxes);
for (int i = 0; i < numBlocks; i++) { for (int i = 0; i < numBlocks; i++) {
......
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