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
3c8adf0c
"libraries/asmjit/base/assembler.h" did not exist on "4c19a4019b369e33b7b686290de9d3791ec02b4a"
Commit
3c8adf0c
authored
Oct 31, 2012
by
Peter Eastman
Browse files
OpenCL and CUDA tests are run three times, once for each precision model
parent
6f4ec6b6
Changes
80
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
80 additions
and
61 deletions
+80
-61
platforms/opencl/tests/TestOpenCLRBTorsionForce.cpp
platforms/opencl/tests/TestOpenCLRBTorsionForce.cpp
+5
-3
platforms/opencl/tests/TestOpenCLRandom.cpp
platforms/opencl/tests/TestOpenCLRandom.cpp
+6
-3
platforms/opencl/tests/TestOpenCLSettle.cpp
platforms/opencl/tests/TestOpenCLSettle.cpp
+5
-2
platforms/opencl/tests/TestOpenCLSort.cpp
platforms/opencl/tests/TestOpenCLSort.cpp
+6
-2
platforms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
...rms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
+5
-5
platforms/opencl/tests/TestOpenCLVariableVerletIntegrator.cpp
...forms/opencl/tests/TestOpenCLVariableVerletIntegrator.cpp
+5
-6
platforms/opencl/tests/TestOpenCLVerletIntegrator.cpp
platforms/opencl/tests/TestOpenCLVerletIntegrator.cpp
+5
-6
platforms/opencl/tests/TestOpenCLVirtualSites.cpp
platforms/opencl/tests/TestOpenCLVirtualSites.cpp
+5
-7
plugins/amoeba/platforms/cuda/tests/CMakeLists.txt
plugins/amoeba/platforms/cuda/tests/CMakeLists.txt
+5
-1
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaAngleForce.cpp
.../amoeba/platforms/cuda/tests/TestCudaAmoebaAngleForce.cpp
+3
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaBondForce.cpp
...s/amoeba/platforms/cuda/tests/TestCudaAmoebaBondForce.cpp
+3
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
...rms/cuda/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
+3
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaInPlaneAngleForce.cpp
.../platforms/cuda/tests/TestCudaAmoebaInPlaneAngleForce.cpp
+3
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaMultipoleForce.cpp
...eba/platforms/cuda/tests/TestCudaAmoebaMultipoleForce.cpp
+3
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
...latforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
+3
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
...eba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
+3
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
...a/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
+3
-3
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
...latforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
+3
-3
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaVdwForce.cpp
...ns/amoeba/platforms/cuda/tests/TestCudaAmoebaVdwForce.cpp
+3
-3
plugins/amoeba/platforms/cuda/tests/TestCudaWcaDispersionForce.cpp
...moeba/platforms/cuda/tests/TestCudaWcaDispersionForce.cpp
+3
-3
No files found.
platforms/opencl/tests/TestOpenCLRBTorsionForce.cpp
View file @
3c8adf0c
...
@@ -46,10 +46,11 @@
...
@@ -46,10 +46,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
OpenCLPlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testRBTorsions
()
{
void
testRBTorsions
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -112,7 +113,6 @@ void testRBTorsions() {
...
@@ -112,7 +113,6 @@ void testRBTorsions() {
}
}
void
testParallelComputation
()
{
void
testParallelComputation
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
const
int
numParticles
=
200
;
const
int
numParticles
=
200
;
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
...
@@ -140,8 +140,10 @@ void testParallelComputation() {
...
@@ -140,8 +140,10 @@ void testParallelComputation() {
ASSERT_EQUAL_VEC
(
state1
.
getForces
()[
i
],
state2
.
getForces
()[
i
],
1e-5
);
ASSERT_EQUAL_VEC
(
state1
.
getForces
()[
i
],
state2
.
getForces
()[
i
],
1e-5
);
}
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
try
{
try
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"OpenCLPrecision"
,
string
(
argv
[
1
]));
testRBTorsions
();
testRBTorsions
();
testParallelComputation
();
testParallelComputation
();
}
}
...
...
platforms/opencl/tests/TestOpenCLRandom.cpp
View file @
3c8adf0c
...
@@ -47,12 +47,14 @@
...
@@ -47,12 +47,14 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
OpenCLPlatform
platform
;
void
testGaussian
()
{
void
testGaussian
()
{
int
numAtoms
=
5000
;
int
numAtoms
=
5000
;
System
system
;
System
system
;
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
OpenCLPlatform
::
PlatformData
platformData
(
system
,
""
,
""
,
"single"
);
OpenCLPlatform
::
PlatformData
platformData
(
system
,
""
,
""
,
platform
.
getPropertyDefaultValue
(
"OpenCLPrecision"
)
);
OpenCLContext
&
context
=
*
platformData
.
contexts
[
0
];
OpenCLContext
&
context
=
*
platformData
.
contexts
[
0
];
context
.
initialize
();
context
.
initialize
();
context
.
getIntegrationUtilities
().
initRandomNumberGenerator
(
0
);
context
.
getIntegrationUtilities
().
initRandomNumberGenerator
(
0
);
...
@@ -91,7 +93,6 @@ void testRandomVelocities() {
...
@@ -91,7 +93,6 @@ void testRandomVelocities() {
const
int
numParticles
=
10000
;
const
int
numParticles
=
10000
;
const
double
temperture
=
100.0
;
const
double
temperture
=
100.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.01
);
VerletIntegrator
integrator
(
0.01
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
...
@@ -129,8 +130,10 @@ void testRandomVelocities() {
...
@@ -129,8 +130,10 @@ void testRandomVelocities() {
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
4
/
sqrt
(
numParticles
));
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
4
/
sqrt
(
numParticles
));
}
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
try
{
try
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"OpenCLPrecision"
,
string
(
argv
[
1
]));
testGaussian
();
testGaussian
();
testRandomVelocities
();
testRandomVelocities
();
}
}
...
...
platforms/opencl/tests/TestOpenCLSettle.cpp
View file @
3c8adf0c
...
@@ -47,12 +47,13 @@
...
@@ -47,12 +47,13 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
OpenCLPlatform
platform
;
void
testConstraints
()
{
void
testConstraints
()
{
const
int
numMolecules
=
10
;
const
int
numMolecules
=
10
;
const
int
numParticles
=
numMolecules
*
3
;
const
int
numParticles
=
numMolecules
*
3
;
const
int
numConstraints
=
numMolecules
*
3
;
const
int
numConstraints
=
numMolecules
*
3
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
LangevinIntegrator
integrator
(
temp
,
2.0
,
0.001
);
LangevinIntegrator
integrator
(
temp
,
2.0
,
0.001
);
integrator
.
setConstraintTolerance
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
...
@@ -103,8 +104,10 @@ void testConstraints() {
...
@@ -103,8 +104,10 @@ void testConstraints() {
}
}
}
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
try
{
try
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"OpenCLPrecision"
,
string
(
argv
[
1
]));
testConstraints
();
testConstraints
();
}
}
catch
(
const
exception
&
e
)
{
catch
(
const
exception
&
e
)
{
...
...
platforms/opencl/tests/TestOpenCLSort.cpp
View file @
3c8adf0c
...
@@ -46,6 +46,8 @@
...
@@ -46,6 +46,8 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
OpenCLPlatform
platform
;
struct
SortTrait
{
struct
SortTrait
{
typedef
cl_float
DataType
;
typedef
cl_float
DataType
;
typedef
cl_float
KeyType
;
typedef
cl_float
KeyType
;
...
@@ -62,7 +64,7 @@ void verifySorting(vector<float> array) {
...
@@ -62,7 +64,7 @@ void verifySorting(vector<float> array) {
System
system
;
System
system
;
system
.
addParticle
(
0.0
);
system
.
addParticle
(
0.0
);
OpenCLPlatform
::
PlatformData
platformData
(
system
,
""
,
""
,
"single"
);
OpenCLPlatform
::
PlatformData
platformData
(
system
,
""
,
""
,
platform
.
getPropertyDefaultValue
(
"OpenCLPrecision"
)
);
OpenCLContext
&
context
=
*
platformData
.
contexts
[
0
];
OpenCLContext
&
context
=
*
platformData
.
contexts
[
0
];
context
.
initialize
();
context
.
initialize
();
OpenCLArray
data
(
context
,
array
.
size
(),
sizeof
(
float
),
"sortData"
);
OpenCLArray
data
(
context
,
array
.
size
(),
sizeof
(
float
),
"sortData"
);
...
@@ -106,8 +108,10 @@ void testLogValues()
...
@@ -106,8 +108,10 @@ void testLogValues()
verifySorting
(
array
);
verifySorting
(
array
);
}
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
try
{
try
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"OpenCLPrecision"
,
string
(
argv
[
1
]));
testUniformValues
();
testUniformValues
();
testLogValues
();
testLogValues
();
}
}
...
...
platforms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
View file @
3c8adf0c
...
@@ -48,10 +48,11 @@
...
@@ -48,10 +48,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
OpenCLPlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testSingleBond
()
{
void
testSingleBond
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
...
@@ -97,7 +98,6 @@ void testSingleBond() {
...
@@ -97,7 +98,6 @@ void testSingleBond() {
void
testTemperature
()
{
void
testTemperature
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
VariableLangevinIntegrator
integrator
(
temp
,
2.0
,
1e-4
);
VariableLangevinIntegrator
integrator
(
temp
,
2.0
,
1e-4
);
NonbondedForce
*
forceField
=
new
NonbondedForce
();
NonbondedForce
*
forceField
=
new
NonbondedForce
();
...
@@ -132,7 +132,6 @@ void testTemperature() {
...
@@ -132,7 +132,6 @@ void testTemperature() {
void
testConstraints
()
{
void
testConstraints
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
VariableLangevinIntegrator
integrator
(
temp
,
2.0
,
1e-5
);
VariableLangevinIntegrator
integrator
(
temp
,
2.0
,
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
...
@@ -175,7 +174,6 @@ void testConstraints() {
...
@@ -175,7 +174,6 @@ void testConstraints() {
void
testRandomSeed
()
{
void
testRandomSeed
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
VariableLangevinIntegrator
integrator
(
temp
,
2.0
,
1e-5
);
VariableLangevinIntegrator
integrator
(
temp
,
2.0
,
1e-5
);
NonbondedForce
*
forceField
=
new
NonbondedForce
();
NonbondedForce
*
forceField
=
new
NonbondedForce
();
...
@@ -230,8 +228,10 @@ void testRandomSeed() {
...
@@ -230,8 +228,10 @@ void testRandomSeed() {
}
}
}
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
try
{
try
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"OpenCLPrecision"
,
string
(
argv
[
1
]));
testSingleBond
();
testSingleBond
();
testTemperature
();
testTemperature
();
testConstraints
();
testConstraints
();
...
...
platforms/opencl/tests/TestOpenCLVariableVerletIntegrator.cpp
View file @
3c8adf0c
...
@@ -48,10 +48,11 @@
...
@@ -48,10 +48,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
OpenCLPlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testSingleBond
()
{
void
testSingleBond
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
...
@@ -88,8 +89,6 @@ void testSingleBond() {
...
@@ -88,8 +89,6 @@ void testSingleBond() {
void
testConstraints
()
{
void
testConstraints
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
int
numConstraints
=
5
;
const
int
numConstraints
=
5
;
const
double
temp
=
100.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
VariableVerletIntegrator
integrator
(
1e-5
);
VariableVerletIntegrator
integrator
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
...
@@ -150,8 +149,6 @@ void testConstraints() {
...
@@ -150,8 +149,6 @@ void testConstraints() {
void
testConstrainedClusters
()
{
void
testConstrainedClusters
()
{
const
int
numParticles
=
7
;
const
int
numParticles
=
7
;
const
double
temp
=
500.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
VariableVerletIntegrator
integrator
(
1e-5
);
VariableVerletIntegrator
integrator
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
...
@@ -213,8 +210,10 @@ void testConstrainedClusters() {
...
@@ -213,8 +210,10 @@ void testConstrainedClusters() {
ASSERT
(
context
.
getState
(
State
::
Positions
).
getTime
()
>
0.1
);
ASSERT
(
context
.
getState
(
State
::
Positions
).
getTime
()
>
0.1
);
}
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
try
{
try
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"OpenCLPrecision"
,
string
(
argv
[
1
]));
testSingleBond
();
testSingleBond
();
testConstraints
();
testConstraints
();
testConstrainedClusters
();
testConstrainedClusters
();
...
...
platforms/opencl/tests/TestOpenCLVerletIntegrator.cpp
View file @
3c8adf0c
...
@@ -48,10 +48,11 @@
...
@@ -48,10 +48,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
OpenCLPlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testSingleBond
()
{
void
testSingleBond
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
...
@@ -88,8 +89,6 @@ void testSingleBond() {
...
@@ -88,8 +89,6 @@ void testSingleBond() {
void
testConstraints
()
{
void
testConstraints
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
int
numConstraints
=
5
;
const
int
numConstraints
=
5
;
const
double
temp
=
100.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.001
);
VerletIntegrator
integrator
(
0.001
);
integrator
.
setConstraintTolerance
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
...
@@ -142,8 +141,6 @@ void testConstraints() {
...
@@ -142,8 +141,6 @@ void testConstraints() {
void
testConstrainedClusters
()
{
void
testConstrainedClusters
()
{
const
int
numParticles
=
7
;
const
int
numParticles
=
7
;
const
double
temp
=
500.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.001
);
VerletIntegrator
integrator
(
0.001
);
integrator
.
setConstraintTolerance
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
...
@@ -204,8 +201,10 @@ void testConstrainedClusters() {
...
@@ -204,8 +201,10 @@ void testConstrainedClusters() {
}
}
}
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
try
{
try
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"OpenCLPrecision"
,
string
(
argv
[
1
]));
testSingleBond
();
testSingleBond
();
testConstraints
();
testConstraints
();
testConstrainedClusters
();
testConstrainedClusters
();
...
...
platforms/opencl/tests/TestOpenCLVirtualSites.cpp
View file @
3c8adf0c
...
@@ -50,11 +50,12 @@
...
@@ -50,11 +50,12 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
OpenCLPlatform
platform
;
/**
/**
* Check that massless particles are handled correctly.
* Check that massless particles are handled correctly.
*/
*/
void
testMasslessParticle
()
{
void
testMasslessParticle
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
0.0
);
system
.
addParticle
(
0.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -91,7 +92,6 @@ void testMasslessParticle() {
...
@@ -91,7 +92,6 @@ void testMasslessParticle() {
* Test a TwoParticleAverageSite virtual site.
* Test a TwoParticleAverageSite virtual site.
*/
*/
void
testTwoParticleAverage
()
{
void
testTwoParticleAverage
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -128,7 +128,6 @@ void testTwoParticleAverage() {
...
@@ -128,7 +128,6 @@ void testTwoParticleAverage() {
* Test a ThreeParticleAverageSite virtual site.
* Test a ThreeParticleAverageSite virtual site.
*/
*/
void
testThreeParticleAverage
()
{
void
testThreeParticleAverage
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -170,7 +169,6 @@ void testThreeParticleAverage() {
...
@@ -170,7 +169,6 @@ void testThreeParticleAverage() {
* Test an OutOfPlaneSite virtual site.
* Test an OutOfPlaneSite virtual site.
*/
*/
void
testOutOfPlane
()
{
void
testOutOfPlane
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -220,7 +218,6 @@ void testOutOfPlane() {
...
@@ -220,7 +218,6 @@ void testOutOfPlane() {
* when using virtual sites.
* when using virtual sites.
*/
*/
void
testConservationLaws
()
{
void
testConservationLaws
()
{
OpenCLPlatform
platform
;
System
system
;
System
system
;
NonbondedForce
*
forceField
=
new
NonbondedForce
();
NonbondedForce
*
forceField
=
new
NonbondedForce
();
system
.
addForce
(
forceField
);
system
.
addForce
(
forceField
);
...
@@ -329,7 +326,6 @@ void testConservationLaws() {
...
@@ -329,7 +326,6 @@ void testConservationLaws() {
void
testReordering
()
{
void
testReordering
()
{
const
double
cutoff
=
2.0
;
const
double
cutoff
=
2.0
;
const
double
boxSize
=
20.0
;
const
double
boxSize
=
20.0
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
...
@@ -430,8 +426,10 @@ void testReordering() {
...
@@ -430,8 +426,10 @@ void testReordering() {
}
}
}
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[]
)
{
try
{
try
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"OpenCLPrecision"
,
string
(
argv
[
1
]));
testMasslessParticle
();
testMasslessParticle
();
testTwoParticleAverage
();
testTwoParticleAverage
();
testThreeParticleAverage
();
testThreeParticleAverage
();
...
...
plugins/amoeba/platforms/cuda/tests/CMakeLists.txt
View file @
3c8adf0c
...
@@ -14,6 +14,10 @@ FOREACH(TEST_PROG ${TEST_PROGS})
...
@@ -14,6 +14,10 @@ FOREACH(TEST_PROG ${TEST_PROGS})
# Link with shared library
# Link with shared library
ADD_EXECUTABLE
(
${
TEST_ROOT
}
${
TEST_PROG
}
)
ADD_EXECUTABLE
(
${
TEST_ROOT
}
${
TEST_PROG
}
)
TARGET_LINK_LIBRARIES
(
${
TEST_ROOT
}
${
SHARED_AMOEBA_TARGET
}
${
SHARED_TARGET
}
)
TARGET_LINK_LIBRARIES
(
${
TEST_ROOT
}
${
SHARED_AMOEBA_TARGET
}
${
SHARED_TARGET
}
)
ADD_TEST
(
${
TEST_ROOT
}
${
EXECUTABLE_OUTPUT_PATH
}
/
${
TEST_ROOT
}
)
ADD_TEST
(
${
TEST_ROOT
}
Single
${
EXECUTABLE_OUTPUT_PATH
}
/
${
TEST_ROOT
}
single
)
IF
(
OPENMM_BUILD_CUDA_DOUBLE_PRECISION_TESTS
)
ADD_TEST
(
${
TEST_ROOT
}
Mixed
${
EXECUTABLE_OUTPUT_PATH
}
/
${
TEST_ROOT
}
mixed
)
ADD_TEST
(
${
TEST_ROOT
}
Double
${
EXECUTABLE_OUTPUT_PATH
}
/
${
TEST_ROOT
}
double
)
ENDIF
(
OPENMM_BUILD_CUDA_DOUBLE_PRECISION_TESTS
)
ENDFOREACH
(
TEST_PROG
${
TEST_PROGS
}
)
ENDFOREACH
(
TEST_PROG
${
TEST_PROGS
}
)
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaAngleForce.cpp
View file @
3c8adf0c
...
@@ -302,11 +302,12 @@ void testOneAngle( FILE* log ) {
...
@@ -302,11 +302,12 @@ void testOneAngle( FILE* log ) {
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaAngleForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaAngleForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
testOneAngle
(
log
);
testOneAngle
(
log
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaBondForce.cpp
View file @
3c8adf0c
...
@@ -206,11 +206,12 @@ void testTwoBond( FILE* log ) {
...
@@ -206,11 +206,12 @@ void testTwoBond( FILE* log ) {
compareWithExpectedForceAndEnergy
(
context
,
*
amoebaBondForce
,
TOL
,
"testTwoBond"
,
log
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoebaBondForce
,
TOL
,
"testTwoBond"
,
log
);
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaBondForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaBondForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
testTwoBond
(
log
);
testTwoBond
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
View file @
3c8adf0c
...
@@ -8450,11 +8450,12 @@ static void testGeneralizedKirkwoodVillinMutualPolarization( FILE* log ) {
...
@@ -8450,11 +8450,12 @@ static void testGeneralizedKirkwoodVillinMutualPolarization( FILE* log ) {
compareForceNormsEnergy( testName, expectedEnergy, energy, expectedForces, forces, tolerance, log );
compareForceNormsEnergy( testName, expectedEnergy, energy, expectedForces, forces, tolerance, log );
}
}
int main( int numberOfArguments, char* argv[] ) {
int main(int argc, char* argv[]) {
try {
try {
std::cout << "TestCudaAmoebaGeneralizedKirkwoodForce running test..." << std::endl;
std::cout << "TestCudaAmoebaGeneralizedKirkwoodForce running test..." << std::endl;
registerAmoebaCudaKernelFactories();
registerAmoebaCudaKernelFactories();
if (argc > 1)
Platform::getPlatformByName("CUDA").setPropertyDefaultValue("CudaPrecision", std::string(argv[1]));
FILE* log = NULL;
FILE* log = NULL;
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaInPlaneAngleForce.cpp
View file @
3c8adf0c
...
@@ -379,11 +379,12 @@ void testOneAngle( FILE* log ) {
...
@@ -379,11 +379,12 @@ void testOneAngle( FILE* log ) {
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaInPlaneAngleForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaInPlaneAngleForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
testOneAngle
(
NULL
);
testOneAngle
(
NULL
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaMultipoleForce.cpp
View file @
3c8adf0c
...
@@ -2843,11 +2843,12 @@ static void testMultipoleGridPotential( FILE* log ) {
...
@@ -2843,11 +2843,12 @@ static void testMultipoleGridPotential( FILE* log ) {
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaMultipoleForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaMultipoleForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
View file @
3c8adf0c
...
@@ -508,11 +508,12 @@ void testOneOutOfPlaneBend2( FILE* log, int setId ) {
...
@@ -508,11 +508,12 @@ void testOneOutOfPlaneBend2( FILE* log, int setId ) {
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaOutOfPlaneBendForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaOutOfPlaneBendForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
testOneOutOfPlaneBend
(
log
);
testOneOutOfPlaneBend
(
log
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
View file @
3c8adf0c
...
@@ -305,11 +305,12 @@ void testOnePiTorsion( FILE* log ) {
...
@@ -305,11 +305,12 @@ void testOnePiTorsion( FILE* log ) {
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaPiTorsionForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaPiTorsionForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
testOnePiTorsion
(
log
);
testOnePiTorsion
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
View file @
3c8adf0c
...
@@ -290,12 +290,12 @@ void testOneStretchBend( FILE* log ) {
...
@@ -290,12 +290,12 @@ void testOneStretchBend( FILE* log ) {
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaStretchBendForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaStretchBendForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
testOneStretchBend
(
log
);
testOneStretchBend
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
View file @
3c8adf0c
...
@@ -2681,12 +2681,12 @@ void testTorsionTorsion( FILE* log, int systemId ) {
...
@@ -2681,12 +2681,12 @@ void testTorsionTorsion( FILE* log, int systemId ) {
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaTorsionTorsionForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaTorsionTorsionForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
testTorsionTorsion
(
log
,
1
);
testTorsionTorsion
(
log
,
1
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaVdwForce.cpp
View file @
3c8adf0c
...
@@ -1952,12 +1952,12 @@ void testVdwWater( int includeVdwDispersionCorrection, FILE* log ) {
...
@@ -1952,12 +1952,12 @@ void testVdwWater( int includeVdwDispersionCorrection, FILE* log ) {
}
}
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaVdwForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaVdwForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
testVdw
(
log
);
testVdw
(
log
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaWcaDispersionForce.cpp
View file @
3c8adf0c
...
@@ -162,12 +162,12 @@ void testWcaDispersionAmmonia( FILE* log ) {
...
@@ -162,12 +162,12 @@ void testWcaDispersionAmmonia( FILE* log ) {
compareForcesEnergy
(
testName
,
expectedEnergy
,
energy
,
expectedForces
,
forces
,
tolerance
,
log
);
compareForcesEnergy
(
testName
,
expectedEnergy
,
energy
,
expectedForces
,
forces
,
tolerance
,
log
);
}
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
std
::
cout
<<
"TestCudaAmoebaWcaDispersionForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaWcaDispersionForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"CudaPrecision"
,
std
::
string
(
argv
[
1
]));
FILE
*
log
=
NULL
;
FILE
*
log
=
NULL
;
// test Wca dispersion force using two ammonia molecules
// test Wca dispersion force using two ammonia molecules
...
...
Prev
1
2
3
4
Next
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