ocl: add try-catch for OpenCL device getter
This commit is contained in:
parent
93f8581b69
commit
c5d3c08256
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user