Skip to content
Permalink
Browse files

[opencl] Make device configurable

  • Loading branch information
elpaso committed Aug 8, 2018
1 parent 28169aa commit d846804b1c0f3ca7169545169ec79410b7d9cda5
@@ -1087,25 +1087,16 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
if ( QgsOpenClUtils::available( ) )
{
mGPUEnableCheckBox->setEnabled( true );
mGPUInfoLabel->setText( QStringLiteral( "OpenCL compatible GPU found on your system:<br>"
"Name: <b>%1</b><br>"
"Vendor: <b>%2</b><br>"
"Profile: <b>%3</b><br>"
"Version: <b>%4</b><br>"
"Image support: <b>%5</b><br>"
"Max image2d width: <b>%6</b><br>"
"Max image2d height: <b>%7</b><br>"
"Max mem alloc size: <b>%8</b><br>"
).arg( QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::Name ),
QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::Vendor ),
QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::Profile ),
QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::Version ),
QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::ImageSupport ),
QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::Image2dMaxWidth ),
QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::Image2dMaxHeight ),
QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::MaxMemAllocSize )
)
);

for ( const auto &dev : QgsOpenClUtils::devices( ) )
{
mOpenClDevicesCombo->addItem( QgsOpenClUtils::deviceId( dev ), QgsOpenClUtils::deviceId( dev ) );
}
connect( mOpenClDevicesCombo, qgis::overload< int >::of( &QComboBox::currentIndexChanged ), [ = ]( int )
{
mGPUInfoLabel->setText( QgsOpenClUtils::deviceDescription( mOpenClDevicesCombo->currentData().toString() ) );
} );
mOpenClDevicesCombo->setCurrentIndex( mOpenClDevicesCombo->findData( QgsOpenClUtils::deviceId( QgsOpenClUtils::activeDevice() ) ) );
}
else
{
@@ -1668,7 +1659,8 @@ void QgsOptions::saveOptions()
#ifdef HAVE_OPENCL
// OpenCL settings
QgsOpenClUtils::setEnabled( mGPUEnableCheckBox->isChecked() );

QString preferredDevice( mOpenClDevicesCombo->currentData().toString() );
QgsOpenClUtils::storePreferredDevice( preferredDevice );
#endif

// Gdal skip driver list
@@ -768,8 +768,16 @@ IF (QT_MOBILITY_LOCATION_FOUND OR Qt5Positioning_FOUND)
)
ENDIF (QT_MOBILITY_LOCATION_FOUND OR Qt5Positioning_FOUND)


IF (HAVE_OPENCL)
SET(QGIS_CORE_MOC_HDRS ${QGIS_CORE_MOC_HDRS}
qgsopenclutils.h
)
ENDIF (HAVE_OPENCL)

QT5_WRAP_CPP(QGIS_CORE_MOC_SRCS ${QGIS_CORE_MOC_HDRS})


IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CORE_MOC_SRCS} PROPERTIES COMPILE_FLAGS "/wd4512 /wd4996" )
ELSE(MSVC)

0 comments on commit d846804

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