summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-11-12 21:49:05 +0200
committerTor Lillqvist <tml@collabora.com>2014-11-12 21:49:05 +0200
commit3c00552dac97adea3419d6e97e08047d214cbc4c (patch)
treea902107f78a82ee502ca4ce51b27c0c0c92b1c86
parentMake checkForKnownBadCompilers() public (diff)
downloadcore-private/tml/opencl-default-1.tar.gz
core-private/tml/opencl-default-1.zip
Check blacklist and whitelist here, too private/tml/opencl-default-1
Change-Id: I0e411dccf445cb8d1e2e5238c1164d7ac18d8636
-rw-r--r--sc/source/core/opencl/opencl_device.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sc/source/core/opencl/opencl_device.cxx b/sc/source/core/opencl/opencl_device.cxx
index 2703040713bb..958fd1ac97b3 100644
--- a/sc/source/core/opencl/opencl_device.cxx
+++ b/sc/source/core/opencl/opencl_device.cxx
@@ -26,6 +26,8 @@
#include <boost/scoped_ptr.hpp>
#include "opencl_device.hxx"
+#include "openclwrapper.hxx"
+#include "platforminfo.hxx"
#define INPUTSIZE 15360
#define OUTPUTSIZE 15360
@@ -400,6 +402,30 @@ ds_status pickBestDevice(ds_profile* profile, int* bestDeviceIdx)
ds_device device = profile->devices[d];
LibreOfficeDeviceScore *pScore = (LibreOfficeDeviceScore*)device.score;
+ // Check blacklist and whitelist for actual devices
+ if (device.type == DS_DEVICE_OPENCL_DEVICE)
+ {
+ // There is a silly impedance mismatch here. Why do we
+ // need two different ways to describe an OpenCL platform
+ // and an OpenCL device driver?
+
+ OpenCLPlatformInfo aPlatform;
+ OpenCLDeviceInfo aDevice;
+
+ // We know that only the below fields are used by checkForKnownBadCompilers()
+ aPlatform.maVendor = OUString(device.oclPlatformVendor, strlen(device.oclPlatformVendor), RTL_TEXTENCODING_UTF8);
+ aDevice.maName = OUString(device.oclDeviceName, strlen(device.oclDeviceName), RTL_TEXTENCODING_UTF8);
+ aDevice.maDriver = OUString(device.oclDriverVersion, strlen(device.oclDriverVersion), RTL_TEXTENCODING_UTF8);
+
+ // If blacklisted or not whitelisted, ignore it
+ if (opencl::checkForKnownBadCompilers(aPlatform, aDevice))
+ {
+ SAL_INFO("sc.opencl.device", "Device[" << d << "] " << device.oclDeviceName << " is blacklisted or not whitelisted");
+ pScore->fTime = DBL_MAX;
+ pScore->bNoCLErrors = true;
+ }
+ }
+
double fScore = DBL_MAX;
if (pScore)
{