"plugins/drude/vscode:/vscode.git/clone" did not exist on "a5e42f57289b654368ba91183cb8f4a3649a5f68"
Unverified Commit 8ac16493 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2445 from peastman/clplatform

Catch exception when cl::Platform::get() fails.
parents 2fb47a51 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;
try {
cl::Platform::get(&platforms); cl::Platform::get(&platforms);
if (platforms.size() == 0) if (platforms.size() == 0)
return false; return false;
}
catch (...) {
return false;
}
return true; return true;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment