Commit 7dde9d2d authored by Thomas Trummer's avatar Thomas Trummer
Browse files

Add OpenCL platform index for tests that use two devices

parent 945067fe
...@@ -95,9 +95,12 @@ void testCheckpoint() { ...@@ -95,9 +95,12 @@ void testCheckpoint() {
// Create a new Context that uses multiple devices. // Create a new Context that uses multiple devices.
string deviceIndex = platform.getPropertyValue(context, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
VerletIntegrator integrator2(0.001); VerletIntegrator integrator2(0.001);
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
......
...@@ -50,9 +50,13 @@ void testParallelComputation() { ...@@ -50,9 +50,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -50,9 +50,13 @@ void testParallelComputation() { ...@@ -50,9 +50,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -54,9 +54,13 @@ void testParallelComputation() { ...@@ -54,9 +54,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -53,9 +53,13 @@ void testParallelComputation() { ...@@ -53,9 +53,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -58,9 +58,13 @@ void testParallelComputation() { ...@@ -58,9 +58,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -50,9 +50,13 @@ void testParallelComputation() { ...@@ -50,9 +50,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -51,9 +51,13 @@ void testParallelComputation() { ...@@ -51,9 +51,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -50,9 +50,13 @@ void testParallelComputation() { ...@@ -50,9 +50,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -62,9 +62,13 @@ void testParallelComputation(NonbondedForce::NonbondedMethod method) { ...@@ -62,9 +62,13 @@ void testParallelComputation(NonbondedForce::NonbondedMethod method) {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -49,9 +49,13 @@ void testParallelComputation() { ...@@ -49,9 +49,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
...@@ -49,9 +49,13 @@ void testParallelComputation() { ...@@ -49,9 +49,13 @@ void testParallelComputation() {
context1.setPositions(positions); context1.setPositions(positions);
State state1 = context1.getState(State::Forces | State::Energy); State state1 = context1.getState(State::Forces | State::Energy);
VerletIntegrator integrator2(0.01); VerletIntegrator integrator2(0.01);
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
map<string, string> props; map<string, string> props;
string deviceIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLDeviceIndex());
props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex; props[OpenCLPlatform::OpenCLDeviceIndex()] = deviceIndex+","+deviceIndex;
string platformIndex = platform.getPropertyValue(context1, OpenCLPlatform::OpenCLPlatformIndex());
props[OpenCLPlatform::OpenCLPlatformIndex()] = platformIndex;
Context context2(system, integrator2, platform, props); Context context2(system, integrator2, platform, props);
context2.setPositions(positions); context2.setPositions(positions);
State state2 = context2.getState(State::Forces | State::Energy); State state2 = context2.getState(State::Forces | State::Energy);
......
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