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
eb5a680d
Commit
eb5a680d
authored
Oct 25, 2015
by
Robert McGibbon
Browse files
code review
parent
4930cd8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+4
-4
No files found.
platforms/cuda/src/CudaContext.cpp
View file @
eb5a680d
...
...
@@ -132,8 +132,8 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
this
->
deviceIndex
=
-
1
;
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
devicePrecedence
.
size
());
i
++
)
{
d
eviceIndex
=
devicePrecedence
[
i
];
CHECK_RESULT
(
cuDeviceGet
(
&
device
,
d
eviceIndex
));
int
trialD
eviceIndex
=
devicePrecedence
[
i
];
CHECK_RESULT
(
cuDeviceGet
(
&
device
,
trialD
eviceIndex
));
defaultOptimizationOptions
=
"--use_fast_math"
;
unsigned
int
flags
=
CU_CTX_MAP_HOST
;
if
(
useBlockingSync
)
...
...
@@ -142,12 +142,12 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
flags
+=
CU_CTX_SCHED_SPIN
;
if
(
cuCtxCreate
(
&
context
,
flags
,
device
)
==
CUDA_SUCCESS
)
{
this
->
deviceIndex
=
d
eviceIndex
;
this
->
deviceIndex
=
trialD
eviceIndex
;
break
;
}
}
if
(
this
->
deviceIndex
==
-
1
)
if
(
device
Precedence
.
size
()
=
=
1
)
if
(
device
Index
!
=
-
1
)
throw
OpenMMException
(
"The requested CUDA device could not be loaded"
);
else
throw
OpenMMException
(
"No compatible CUDA device is available"
);
...
...
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