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
"vscode:/vscode.git/clone" did not exist on "3f3bba3f32795df8ce4067f648f55c608e56bb87"
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 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* 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 *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -92,6 +92,8 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
...
@@ -92,6 +92,8 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
cl
::
Platform
::
get
(
&
platforms
);
cl
::
Platform
::
get
(
&
platforms
);
if
(
platformIndex
<
-
1
||
platformIndex
>=
(
int
)
platforms
.
size
())
if
(
platformIndex
<
-
1
||
platformIndex
>=
(
int
)
platforms
.
size
())
throw
OpenMMException
(
"Illegal value for OpenCLPlatformIndex: "
+
intToString
(
platformIndex
));
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
;
const
int
minThreadBlockSize
=
32
;
int
bestSpeed
=
-
1
;
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