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
ec28e11a
Commit
ec28e11a
authored
Feb 26, 2020
by
peastman
Browse files
Improved error checking when specifying an OpenCL device
parent
bdc250cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
platforms/opencl/src/OpenCLContext.cpp
platforms/opencl/src/OpenCLContext.cpp
+3
-1
No files found.
platforms/opencl/src/OpenCLContext.cpp
View file @
ec28e11a
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2009-20
19
Stanford University and the Authors. *
* Portions copyright (c) 2009-20
20
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -92,6 +92,8 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
cl
::
Platform
::
get
(
&
platforms
);
if
(
platformIndex
<
-
1
||
platformIndex
>=
(
int
)
platforms
.
size
())
throw
OpenMMException
(
"Illegal value for OpenCLPlatformIndex: "
+
intToString
(
platformIndex
));
if
(
platforms
.
size
()
>
1
&&
platformIndex
==
-
1
&&
deviceIndex
!=
-
1
)
throw
OpenMMException
(
"Specified DeviceIndex but not OpenCLPlatformIndex. When multiple platforms are available, a platform index is needed to specify a device."
);
const
int
minThreadBlockSize
=
32
;
int
bestSpeed
=
-
1
;
...
...
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