Skip to content
Permalink
Browse files

Merge pull request #8991 from elpaso/opencl-runtime-library-check

Check for libOpenCL.so at runtime
  • Loading branch information
elpaso committed Jan 28, 2019
2 parents aef0b65 + 1ae1e72 commit e4be09a3dad45bfa5c7dd9e62e62e8fa5abe84d4
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/core/qgsopenclutils.cpp
@@ -18,6 +18,8 @@
#include "qgsmessagelog.h"
#include "qgslogger.h"

#include <QLibrary>

#include <QTextStream>
#include <QFile>
#include <QDebug>
@@ -70,6 +72,15 @@ void QgsOpenClUtils::init()
static std::once_flag initialized;
std::call_once( initialized, [ = ]( )
{
QLibrary openCLLib{ QStringLiteral( "OpenCL" ) };
openCLLib.setLoadHints( QLibrary::LoadHint::ResolveAllSymbolsHint );
if ( ! openCLLib.load() )
{
QgsMessageLog::logMessage( QObject::tr( "Error loading OpenCL library: %1" )
.arg( openCLLib.errorString() ),
LOGMESSAGE_TAG, Qgis::Critical );
return;
}
try
{
activate( preferredDevice() );

0 comments on commit e4be09a

Please sign in to comment.
You can’t perform that action at this time.