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
930d985e
Commit
930d985e
authored
Oct 24, 2019
by
peastman
Browse files
Catch exception when cl::Platform::get() fails.
parent
2fb47a51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
platforms/opencl/src/OpenCLPlatform.cpp
platforms/opencl/src/OpenCLPlatform.cpp
+7
-2
No files found.
platforms/opencl/src/OpenCLPlatform.cpp
View file @
930d985e
...
@@ -144,9 +144,14 @@ bool OpenCLPlatform::isPlatformSupported() {
...
@@ -144,9 +144,14 @@ bool OpenCLPlatform::isPlatformSupported() {
// Make sure at least one OpenCL implementation is installed.
// Make sure at least one OpenCL implementation is installed.
std
::
vector
<
cl
::
Platform
>
platforms
;
std
::
vector
<
cl
::
Platform
>
platforms
;
cl
::
Platform
::
get
(
&
platforms
);
try
{
if
(
platforms
.
size
()
==
0
)
cl
::
Platform
::
get
(
&
platforms
);
if
(
platforms
.
size
()
==
0
)
return
false
;
}
catch
(...)
{
return
false
;
return
false
;
}
return
true
;
return
true
;
}
}
...
...
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