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
d28df828
Commit
d28df828
authored
Oct 28, 2010
by
Peter Eastman
Browse files
Fixed test cases that were overly strict
parent
0b96aa2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
platforms/cuda/tests/TestCudaEwald.cpp
platforms/cuda/tests/TestCudaEwald.cpp
+3
-3
platforms/opencl/tests/TestOpenCLEwald.cpp
platforms/opencl/tests/TestOpenCLEwald.cpp
+3
-3
No files found.
platforms/cuda/tests/TestCudaEwald.cpp
View file @
d28df828
...
@@ -118,7 +118,7 @@ void testEwaldPME(bool includeExceptions) {
...
@@ -118,7 +118,7 @@ void testEwaldPME(bool includeExceptions) {
}
}
norm
=
std
::
sqrt
(
norm
);
norm
=
std
::
sqrt
(
norm
);
const
double
delta
=
1
e-3
;
const
double
delta
=
5
e-3
;
double
step
=
delta
/
norm
;
double
step
=
delta
/
norm
;
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
Vec3
p
=
positions
[
i
];
Vec3
p
=
positions
[
i
];
...
@@ -128,7 +128,7 @@ void testEwaldPME(bool includeExceptions) {
...
@@ -128,7 +128,7 @@ void testEwaldPME(bool includeExceptions) {
cudaContext
.
reinitialize
();
cudaContext
.
reinitialize
();
cudaContext
.
setPositions
(
positions
);
cudaContext
.
setPositions
(
positions
);
tol
=
1e-
3
;
tol
=
1e-
2
;
State
cudaState2
=
cudaContext
.
getState
(
State
::
Energy
);
State
cudaState2
=
cudaContext
.
getState
(
State
::
Energy
);
ASSERT_EQUAL_TOL
(
norm
,
(
cudaState2
.
getPotentialEnergy
()
-
cudaState
.
getPotentialEnergy
())
/
delta
,
tol
)
ASSERT_EQUAL_TOL
(
norm
,
(
cudaState2
.
getPotentialEnergy
()
-
cudaState
.
getPotentialEnergy
())
/
delta
,
tol
)
...
@@ -166,7 +166,7 @@ void testEwaldPME(bool includeExceptions) {
...
@@ -166,7 +166,7 @@ void testEwaldPME(bool includeExceptions) {
cudaContext
.
reinitialize
();
cudaContext
.
reinitialize
();
cudaContext
.
setPositions
(
positions
);
cudaContext
.
setPositions
(
positions
);
tol
=
1e-
3
;
tol
=
1e-
2
;
State
cudaState3
=
cudaContext
.
getState
(
State
::
Energy
);
State
cudaState3
=
cudaContext
.
getState
(
State
::
Energy
);
ASSERT_EQUAL_TOL
(
norm
,
(
cudaState3
.
getPotentialEnergy
()
-
cudaState
.
getPotentialEnergy
())
/
delta
,
tol
)
ASSERT_EQUAL_TOL
(
norm
,
(
cudaState3
.
getPotentialEnergy
()
-
cudaState
.
getPotentialEnergy
())
/
delta
,
tol
)
}
}
...
...
platforms/opencl/tests/TestOpenCLEwald.cpp
View file @
d28df828
...
@@ -117,7 +117,7 @@ void testEwaldPME(bool includeExceptions) {
...
@@ -117,7 +117,7 @@ void testEwaldPME(bool includeExceptions) {
}
}
norm
=
std
::
sqrt
(
norm
);
norm
=
std
::
sqrt
(
norm
);
const
double
delta
=
1
e-3
;
const
double
delta
=
5
e-3
;
double
step
=
delta
/
norm
;
double
step
=
delta
/
norm
;
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
Vec3
p
=
positions
[
i
];
Vec3
p
=
positions
[
i
];
...
@@ -127,7 +127,7 @@ void testEwaldPME(bool includeExceptions) {
...
@@ -127,7 +127,7 @@ void testEwaldPME(bool includeExceptions) {
Context
clContext2
(
system
,
integrator
,
cl
);
Context
clContext2
(
system
,
integrator
,
cl
);
clContext2
.
setPositions
(
positions
);
clContext2
.
setPositions
(
positions
);
tol
=
1e-
3
;
tol
=
1e-
2
;
State
clState2
=
clContext2
.
getState
(
State
::
Energy
);
State
clState2
=
clContext2
.
getState
(
State
::
Energy
);
ASSERT_EQUAL_TOL
(
norm
,
(
clState2
.
getPotentialEnergy
()
-
clState
.
getPotentialEnergy
())
/
delta
,
tol
)
ASSERT_EQUAL_TOL
(
norm
,
(
clState2
.
getPotentialEnergy
()
-
clState
.
getPotentialEnergy
())
/
delta
,
tol
)
...
@@ -165,7 +165,7 @@ void testEwaldPME(bool includeExceptions) {
...
@@ -165,7 +165,7 @@ void testEwaldPME(bool includeExceptions) {
Context
clContext3
(
system
,
integrator
,
cl
);
Context
clContext3
(
system
,
integrator
,
cl
);
clContext3
.
setPositions
(
positions
);
clContext3
.
setPositions
(
positions
);
tol
=
1e-
3
;
tol
=
1e-
2
;
State
clState3
=
clContext3
.
getState
(
State
::
Energy
);
State
clState3
=
clContext3
.
getState
(
State
::
Energy
);
ASSERT_EQUAL_TOL
(
norm
,
(
clState3
.
getPotentialEnergy
()
-
clState
.
getPotentialEnergy
())
/
delta
,
tol
)
ASSERT_EQUAL_TOL
(
norm
,
(
clState3
.
getPotentialEnergy
()
-
clState
.
getPotentialEnergy
())
/
delta
,
tol
)
}
}
...
...
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