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
9966f134
Commit
9966f134
authored
Jan 14, 2014
by
Peter Eastman
Browse files
Test cases detect if CPU is not supported and exit rather than crashing
parent
bd543402
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
platforms/cpu/tests/TestCpuGBSAOBCForce.cpp
platforms/cpu/tests/TestCpuGBSAOBCForce.cpp
+4
-0
platforms/cpu/tests/TestCpuLangevinIntegrator.cpp
platforms/cpu/tests/TestCpuLangevinIntegrator.cpp
+4
-0
platforms/cpu/tests/TestCpuSettle.cpp
platforms/cpu/tests/TestCpuSettle.cpp
+4
-0
No files found.
platforms/cpu/tests/TestCpuGBSAOBCForce.cpp
View file @
9966f134
...
@@ -223,6 +223,10 @@ void testForce(int numParticles, NonbondedForce::NonbondedMethod method, GBSAOBC
...
@@ -223,6 +223,10 @@ void testForce(int numParticles, NonbondedForce::NonbondedMethod method, GBSAOBC
int
main
()
{
int
main
()
{
try
{
try
{
if
(
!
CpuPlatform
::
isProcessorSupported
())
{
cout
<<
"CPU is not supported. Exiting."
<<
endl
;
return
0
;
}
testSingleParticle
();
testSingleParticle
();
testCutoffAndPeriodic
();
testCutoffAndPeriodic
();
for
(
int
i
=
5
;
i
<
11
;
i
++
)
{
for
(
int
i
=
5
;
i
<
11
;
i
++
)
{
...
...
platforms/cpu/tests/TestCpuLangevinIntegrator.cpp
View file @
9966f134
...
@@ -264,6 +264,10 @@ void testRandomSeed() {
...
@@ -264,6 +264,10 @@ void testRandomSeed() {
int
main
()
{
int
main
()
{
try
{
try
{
if
(
!
CpuPlatform
::
isProcessorSupported
())
{
cout
<<
"CPU is not supported. Exiting."
<<
endl
;
return
0
;
}
testSingleBond
();
testSingleBond
();
testTemperature
();
testTemperature
();
testConstraints
();
testConstraints
();
...
...
platforms/cpu/tests/TestCpuSettle.cpp
View file @
9966f134
...
@@ -105,6 +105,10 @@ void testConstraints() {
...
@@ -105,6 +105,10 @@ void testConstraints() {
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
if
(
!
CpuPlatform
::
isProcessorSupported
())
{
cout
<<
"CPU is not supported. Exiting."
<<
endl
;
return
0
;
}
testConstraints
();
testConstraints
();
}
}
catch
(
const
exception
&
e
)
{
catch
(
const
exception
&
e
)
{
...
...
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