Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
7dde9d2d
Commit
7dde9d2d
authored
Jun 02, 2020
by
Thomas Trummer
Browse files
Add OpenCL platform index for tests that use two devices
parent
945067fe
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
59 additions
and
12 deletions
+59
-12
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
+4
-1
platforms/opencl/tests/TestOpenCLCustomAngleForce.cpp
platforms/opencl/tests/TestOpenCLCustomAngleForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLCustomBondForce.cpp
platforms/opencl/tests/TestOpenCLCustomBondForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLCustomCompoundBondForce.cpp
platforms/opencl/tests/TestOpenCLCustomCompoundBondForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLCustomExternalForce.cpp
platforms/opencl/tests/TestOpenCLCustomExternalForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLCustomNonbondedForce.cpp
platforms/opencl/tests/TestOpenCLCustomNonbondedForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLCustomTorsionForce.cpp
platforms/opencl/tests/TestOpenCLCustomTorsionForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLHarmonicAngleForce.cpp
platforms/opencl/tests/TestOpenCLHarmonicAngleForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLHarmonicBondForce.cpp
platforms/opencl/tests/TestOpenCLHarmonicBondForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLPeriodicTorsionForce.cpp
platforms/opencl/tests/TestOpenCLPeriodicTorsionForce.cpp
+5
-1
platforms/opencl/tests/TestOpenCLRBTorsionForce.cpp
platforms/opencl/tests/TestOpenCLRBTorsionForce.cpp
+5
-1
No files found.
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
View file @
7dde9d2d
...
...
@@ -95,9 +95,12 @@ void testCheckpoint() {
// Create a new Context that uses multiple devices.
string
deviceIndex
=
platform
.
getPropertyValue
(
context
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
VerletIntegrator
integrator2
(
0.001
);
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
...
...
platforms/opencl/tests/TestOpenCLCustomAngleForce.cpp
View file @
7dde9d2d
...
...
@@ -50,9 +50,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLCustomBondForce.cpp
View file @
7dde9d2d
...
...
@@ -50,9 +50,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLCustomCompoundBondForce.cpp
View file @
7dde9d2d
...
...
@@ -54,9 +54,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLCustomExternalForce.cpp
View file @
7dde9d2d
...
...
@@ -53,9 +53,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLCustomNonbondedForce.cpp
View file @
7dde9d2d
...
...
@@ -58,9 +58,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLCustomTorsionForce.cpp
View file @
7dde9d2d
...
...
@@ -50,9 +50,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLHarmonicAngleForce.cpp
View file @
7dde9d2d
...
...
@@ -51,9 +51,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLHarmonicBondForce.cpp
View file @
7dde9d2d
...
...
@@ -50,9 +50,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
View file @
7dde9d2d
...
...
@@ -62,9 +62,13 @@ void testParallelComputation(NonbondedForce::NonbondedMethod method) {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLPeriodicTorsionForce.cpp
View file @
7dde9d2d
...
...
@@ -49,9 +49,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
platforms/opencl/tests/TestOpenCLRBTorsionForce.cpp
View file @
7dde9d2d
...
...
@@ -49,9 +49,13 @@ void testParallelComputation() {
context1
.
setPositions
(
positions
);
State
state1
=
context1
.
getState
(
State
::
Forces
|
State
::
Energy
);
VerletIntegrator
integrator2
(
0.01
);
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
map
<
string
,
string
>
props
;
string
deviceIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLDeviceIndex
());
props
[
OpenCLPlatform
::
OpenCLDeviceIndex
()]
=
deviceIndex
+
","
+
deviceIndex
;
string
platformIndex
=
platform
.
getPropertyValue
(
context1
,
OpenCLPlatform
::
OpenCLPlatformIndex
());
props
[
OpenCLPlatform
::
OpenCLPlatformIndex
()]
=
platformIndex
;
Context
context2
(
system
,
integrator2
,
platform
,
props
);
context2
.
setPositions
(
positions
);
State
state2
=
context2
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment