ocl: add try-catch for OpenCL device getter

This commit is contained in:
Alexander Alekhin 2014-07-03 12:18:19 +04:00
parent 93f8581b69
commit c5d3c08256

View File

@ -1416,7 +1416,16 @@ bool useOpenCL()
{
CoreTLSData* data = coreTlsData.get();
if( data->useOpenCL < 0 )
data->useOpenCL = (int)haveOpenCL() && Device::getDefault().ptr() != NULL;
{
try
{
data->useOpenCL = (int)haveOpenCL() && Device::getDefault().ptr() != NULL;
}
catch (...)
{
data->useOpenCL = 0;
}
}
return data->useOpenCL > 0;
}