diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-11-12 21:49:05 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-11-12 21:50:03 +0200 |
commit | 3ecb8eff589d5eaf241d37c5bb89a978a64727f9 (patch) | |
tree | 0672b20c767e03b1c9de511e4dc7199210a4f02b | |
parent | 6f584490d7ec60ea8a6b16aba35898de9edf6921 (diff) |
Check blacklist and whitelist here, too
Change-Id: I0e411dccf445cb8d1e2e5238c1164d7ac18d8636
-rw-r--r-- | sc/source/core/opencl/opencl_device.cxx | 26 |
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) { |