[Libreoffice-commits] core.git: 17 commits - officecfg/registry sc/inc sc/source sc/uiconfig
Tor Lillqvist
tml at collabora.com
Wed Nov 12 12:19:13 PST 2014
officecfg/registry/schema/org/openoffice/Office/Calc.xcs | 4
sc/inc/calcconfig.hxx | 44 +-
sc/inc/platforminfo.hxx | 4
sc/source/core/inc/openclwrapper.hxx | 3
sc/source/core/opencl/opencl_device.cxx | 26 +
sc/source/core/opencl/opencl_device_selection.h | 7
sc/source/core/opencl/openclwrapper.cxx | 227 +++++----------
sc/source/core/tool/calcconfig.cxx | 13
sc/source/core/tool/formulaopt.cxx | 26 -
sc/source/core/tool/platforminfo.cxx | 19 +
sc/source/ui/optdlg/calcoptionsdlg.cxx | 40 +-
sc/source/ui/optdlg/calcoptionsdlg.hxx | 7
sc/uiconfig/scalc/ui/formulacalculationoptions.ui | 40 +-
13 files changed, 247 insertions(+), 213 deletions(-)
New commits:
commit 3ecb8eff589d5eaf241d37c5bb89a978a64727f9
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 21:49:05 2014 +0200
Check blacklist and whitelist here, too
Change-Id: I0e411dccf445cb8d1e2e5238c1164d7ac18d8636
diff --git a/sc/source/core/opencl/opencl_device.cxx b/sc/source/core/opencl/opencl_device.cxx
index 2703040..958fd1a 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)
{
commit 6f584490d7ec60ea8a6b16aba35898de9edf6921
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 21:45:55 2014 +0200
Make checkForKnownBadCompilers() public
Change-Id: Icddf3c158e5f45d30467d3da82c197901d8bc380
diff --git a/sc/source/core/inc/openclwrapper.hxx b/sc/source/core/inc/openclwrapper.hxx
index 1f11ffc..3da4afe 100644
--- a/sc/source/core/inc/openclwrapper.hxx
+++ b/sc/source/core/inc/openclwrapper.hxx
@@ -102,6 +102,8 @@ bool switchOpenCLDevice(const OUString* pDeviceId, bool bAutoSelect,
void getOpenCLDeviceInfo(size_t& rDeviceId, size_t& rPlatformId);
+bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice);
+
}}
#endif
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 2759fcd..87cc1c5 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -564,27 +564,6 @@ bool match(const ScCalcConfig::OpenCLImplMatcherSet& rList, const OpenCLPlatform
}
// based on crashes and hanging during kernel compilation
-bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
-{
- // Check blacklist of known bad OpenCL implementations
- if (match(ScInterpreter::GetGlobalConfig().maOpenCLBlackList, rPlatform, rDevice, "blacklist"))
- {
- SAL_INFO("sc.opencl", "Rejecting");
- return true;
- }
-
- // Check for whitelist of known good OpenCL implementations
- if (match(ScInterpreter::GetGlobalConfig().maOpenCLWhiteList, rPlatform, rDevice, "whitelist"))
- {
- SAL_INFO("sc.opencl", "Approving");
- return false;
- }
-
- // Fallback: reject
- SAL_INFO("sc.opencl", "Fallback: rejecting platform=" << rPlatform << ", device=" << rDevice);
- return true;
-}
-
void createDeviceInfo(cl_device_id aDeviceId, OpenCLPlatformInfo& rPlatformInfo)
{
OpenCLDeviceInfo aDeviceInfo;
@@ -685,6 +664,27 @@ bool createPlatformInfo(cl_platform_id nPlatformId, OpenCLPlatformInfo& rPlatfor
}
+bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
+{
+ // Check blacklist of known bad OpenCL implementations
+ if (match(ScInterpreter::GetGlobalConfig().maOpenCLBlackList, rPlatform, rDevice, "blacklist"))
+ {
+ SAL_INFO("sc.opencl", "Rejecting");
+ return true;
+ }
+
+ // Check for whitelist of known good OpenCL implementations
+ if (match(ScInterpreter::GetGlobalConfig().maOpenCLWhiteList, rPlatform, rDevice, "whitelist"))
+ {
+ SAL_INFO("sc.opencl", "Approving");
+ return false;
+ }
+
+ // Fallback: reject
+ SAL_INFO("sc.opencl", "Fallback: rejecting platform=" << rPlatform << ", device=" << rDevice);
+ return true;
+}
+
const std::vector<OpenCLPlatformInfo>& fillOpenCLInfo()
{
static std::vector<OpenCLPlatformInfo> aPlatforms;
commit 8b290c56dfcd6cc43a422601408378c887d84316
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 20:57:15 2014 +0200
Specify platform vendor, not platform name
Change-Id: I4dc457a08d3baa48d461c27d325638735689f5fe
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 3e99b86..42b28bc 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1394,7 +1394,7 @@
<info>
<desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be good. Has higher priority than OpenCLBlackList. Each entry is a string consisting of five parts separated by slashes. In case a slash occurs inside a part, it is prefixed by a backslash. And in case a backslash occurs inside a part, it is also prefixed by another backslash. Any part might contain a single asterisk as a wildcard, matching any value, but there is no more generic regexp support.</desc>
</info>
- <value oor:separator=";">Linux/*/AMD Accelerated Parallel Processing/*/1445.5 (sse2,avx)/</value>
+ <value oor:separator=";">Linux/*/Advanced Micro Devices, Inc./*/1445.5 (sse2,avx)/</value>
</prop>
<prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
<!-- UIHints: Tools - Options Spreadsheet Formula -->
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 1a2e69a..0d9b769 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -45,7 +45,7 @@ void ScCalcConfig::setOpenCLConfigToDefault()
maOpenCLSubsetOpCodes.insert(ocAverage);
maOpenCLSubsetOpCodes.insert(ocSumIfs);
- maOpenCLWhiteList.insert(OpenCLImplMatcher("Linux", "*", "AMD Accelerated Parallel Processing", "*", "1445.5 (sse2,avx)", ""));
+ maOpenCLWhiteList.insert(OpenCLImplMatcher("Linux", "*", "Advanced Micro Devices, Inc.", "*", "1445.5 (sse2,avx)", ""));
maOpenCLBlackList.insert(OpenCLImplMatcher("Windows", "*", "Intel(R) Corporation", "*", "9.17.10.2884", ""));
maOpenCLBlackList.insert(OpenCLImplMatcher("SuperOS", "*", "Big Corp, Inc.", "Whizz\\Grafix", "4.2/beta;3", "4.4"));
commit c51fc2df9223d4c57e6749da553e29ae4d351782
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 20:56:11 2014 +0200
We want the platform vendor here, not the platform name
We already have the platform name in maName.
Change-Id: Iec94ce72cbaba0adf1c82a90892ab98851f5c8ca
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 1db26ec..2759fcd 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -661,7 +661,7 @@ bool createPlatformInfo(cl_platform_id nPlatformId, OpenCLPlatformInfo& rPlatfor
if(nState != CL_SUCCESS)
return false;
- rPlatformInfo.maVendor = OUString::createFromAscii(pName);
+ rPlatformInfo.maVendor = OUString::createFromAscii(pVendor);
cl_uint nDevices;
nState = clGetDeviceIDs(nPlatformId, CL_DEVICE_TYPE_ALL, 0, NULL, &nDevices);
commit d12efada389643ab0e13a280246d14caed273029
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 20:45:07 2014 +0200
Refactor and fix checkForKnownBadCompilers()
Change-Id: Ib2ee1a726fd54c34728234bc1a6b25a05b4e98b5
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index f91e062..1db26ec 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -517,81 +517,66 @@ bool OpenCLDevice::initOpenCLRunEnv( GPUEnv *gpuInfo )
namespace {
-// based on crashes and hanging during kernel compilation
-bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
+bool match(const ScCalcConfig::OpenCLImplMatcher& rListEntry, const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
{
- // Check blacklist of known bad OpenCL implementations
-
- for (auto i = ScInterpreter::GetGlobalConfig().maOpenCLBlackList.cbegin();
- i != ScInterpreter::GetGlobalConfig().maOpenCLBlackList.end();
- ++i)
- {
- SAL_INFO("sc.opencl", "Looking for match for platform=" << rPlatform << ", device=" << rDevice << " in blacklist entry=" << *i);
-
#if defined WNT
- if (i->maOS != "*" && i->maOS != "Windows")
- continue;
+ if (rListEntry.maOS != "*" && rListEntry.maOS != "Windows")
+ return false;
#elif defined LINUX
- if (i->maOS != "*" && i->maOS != "Linux")
- continue;
+ if (rListEntry.maOS != "*" && rListEntry.maOS != "Linux")
+ return false;
#elif defined MACOSX
- if (i->maOS != "*" && i->maOS != "OS X")
- continue;
+ if (rListEntry.maOS != "*" && rListEntry.maOS != "OS X")
+ return false;
#endif
- // OS version check not yet implemented
-
- if (i->maPlatformVendor != "*" && i->maPlatformVendor != rDevice.maVendor)
- continue;
+ // OS version check not yet implemented
- if (i->maDevice != "*" && i->maDevice != rDevice.maName)
- continue;
+ if (rListEntry.maPlatformVendor != "*" && rListEntry.maPlatformVendor != rPlatform.maVendor)
+ return false;
- if (i->maDriverVersionMin != "*" &&
- (comphelper::string::compareVersionStrings(i->maDriverVersionMin, rDevice.maDriver) > 0 ||
- (i->maDriverVersionMax != "" && comphelper::string::compareVersionStrings(i->maDriverVersionMax, rDevice.maDriver) < 0) ||
- (i->maDriverVersionMax == "" && comphelper::string::compareVersionStrings(i->maDriverVersionMin, rDevice.maDriver) < 0)))
- continue;
+ if (rListEntry.maDevice != "*" && rListEntry.maDevice != rDevice.maName)
+ return false;
- // It matches; reject it
- SAL_INFO("sc.opencl", "Match! Rejecting");
- return true;
- }
+ if (rListEntry.maDriverVersionMin != "*" &&
+ (comphelper::string::compareVersionStrings(rListEntry.maDriverVersionMin, rDevice.maDriver) > 0 ||
+ (rListEntry.maDriverVersionMax != "" && comphelper::string::compareVersionStrings(rListEntry.maDriverVersionMax, rDevice.maDriver) < 0) ||
+ (rListEntry.maDriverVersionMax == "" && comphelper::string::compareVersionStrings(rListEntry.maDriverVersionMin, rDevice.maDriver) < 0)))
+ return false;
- // Check for whitelist of known good OpenCL implementations
+ return true;
+}
- for (auto i = ScInterpreter::GetGlobalConfig().maOpenCLWhiteList.cbegin();
- i != ScInterpreter::GetGlobalConfig().maOpenCLWhiteList.end();
- ++i)
+bool match(const ScCalcConfig::OpenCLImplMatcherSet& rList, const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice, const char* sKindOfList)
+{
+ for (auto i = rList.cbegin(); i != rList.end(); ++i)
{
- SAL_INFO("sc.opencl", "Looking for match for platform=" << rPlatform << ", device=" << rDevice << " in whitelist entry=" << *i);
+ SAL_INFO("sc.opencl", "Looking for match for platform=" << rPlatform << ", device=" << rDevice <<
+ " in " << sKindOfList << " entry=" << *i);
-#if defined WNT
- if (i->maOS != "*" && i->maOS != "Windows")
- continue;
-#elif defined LINUX
- if (i->maOS != "*" && i->maOS != "Linux")
- continue;
-#elif defined MACOSX
- if (i->maOS != "*" && i->maOS != "OS X")
- continue;
-#endif
-
- // OS version check not yet implemented
-
- if (i->maPlatformVendor != "*" && i->maPlatformVendor != rPlatform.maVendor)
- continue;
-
- if (i->maDevice != "*" && i->maDevice != rDevice.maName)
- continue;
+ if (match(*i, rPlatform, rDevice))
+ {
+ SAL_INFO("sc.opencl", "Match!");
+ return true;
+ }
+ }
+ return false;
+}
- if (i->maDriverVersionMin != "*" &&
- (comphelper::string::compareVersionStrings(i->maDriverVersionMin, rDevice.maDriver) > 0 ||
- comphelper::string::compareVersionStrings(i->maDriverVersionMax, rDevice.maDriver) < 0))
- continue;
+// based on crashes and hanging during kernel compilation
+bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
+{
+ // Check blacklist of known bad OpenCL implementations
+ if (match(ScInterpreter::GetGlobalConfig().maOpenCLBlackList, rPlatform, rDevice, "blacklist"))
+ {
+ SAL_INFO("sc.opencl", "Rejecting");
+ return true;
+ }
- // It matches; approve it
- SAL_INFO("sc.opencl", "Match! Approving");
+ // Check for whitelist of known good OpenCL implementations
+ if (match(ScInterpreter::GetGlobalConfig().maOpenCLWhiteList, rPlatform, rDevice, "whitelist"))
+ {
+ SAL_INFO("sc.opencl", "Approving");
return false;
}
commit af8a6797918fa9f6450dae856f519257da00be3c
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 20:17:48 2014 +0200
A bit more informative SAL_INFO logging
Change-Id: I60c38129a532e3843db4a422755ae50e4689b91f
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index c307371..f91e062 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -526,6 +526,8 @@ bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCL
i != ScInterpreter::GetGlobalConfig().maOpenCLBlackList.end();
++i)
{
+ SAL_INFO("sc.opencl", "Looking for match for platform=" << rPlatform << ", device=" << rDevice << " in blacklist entry=" << *i);
+
#if defined WNT
if (i->maOS != "*" && i->maOS != "Windows")
continue;
@@ -552,7 +554,7 @@ bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCL
continue;
// It matches; reject it
- SAL_INFO("sc.opencl", "Match for platform=" << rPlatform << ", device=" << rDevice << " in blacklist=" << *i);
+ SAL_INFO("sc.opencl", "Match! Rejecting");
return true;
}
@@ -562,6 +564,8 @@ bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCL
i != ScInterpreter::GetGlobalConfig().maOpenCLWhiteList.end();
++i)
{
+ SAL_INFO("sc.opencl", "Looking for match for platform=" << rPlatform << ", device=" << rDevice << " in whitelist entry=" << *i);
+
#if defined WNT
if (i->maOS != "*" && i->maOS != "Windows")
continue;
@@ -587,7 +591,7 @@ bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCL
continue;
// It matches; approve it
- SAL_INFO("sc.opencl", "Match for platform=" << rPlatform << ", device=" << rDevice << " in whitelist=" << *i);
+ SAL_INFO("sc.opencl", "Match! Approving");
return false;
}
commit 607a306ab74f4b84f277605762eea81142a820dc
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 19:12:56 2014 +0200
Make it match ScCalcConfig::setOpenCLConfigToDefault()
Change-Id: I6555028d098e9dd9bde466441c1c9a9f58782ca2
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 918eba0..3e99b86 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1394,7 +1394,7 @@
<info>
<desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be good. Has higher priority than OpenCLBlackList. Each entry is a string consisting of five parts separated by slashes. In case a slash occurs inside a part, it is prefixed by a backslash. And in case a backslash occurs inside a part, it is also prefixed by another backslash. Any part might contain a single asterisk as a wildcard, matching any value, but there is no more generic regexp support.</desc>
</info>
- <value oor:separator=";">*/*/AMD Accelerated Parallel Processing/*/1445.5 (sse2,avx)/</value>
+ <value oor:separator=";">Linux/*/AMD Accelerated Parallel Processing/*/1445.5 (sse2,avx)/</value>
</prop>
<prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
<!-- UIHints: Tools - Options Spreadsheet Formula -->
commit 2057d6c19c1c874f00eadef663d612a0f09fd09f
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 19:03:32 2014 +0200
Add first whitelist and blacklist check attempt to checkForKnownBadCompilers()
Not sure if that is the right place for it.
Change-Id: I246bb6191513f5c1557b9f211915becce0908d24
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index e6a0f7d..c307371 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -11,6 +11,7 @@
#include "openclwrapper.hxx"
+#include <comphelper/string.hxx>
#include <rtl/ustring.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/digest.h>
@@ -19,6 +20,8 @@
#include <sal/config.h>
#include <osl/file.hxx>
+#include "calcconfig.hxx"
+#include "interpre.hxx"
#include "opencl_device.hxx"
#include <stdio.h>
@@ -515,23 +518,82 @@ bool OpenCLDevice::initOpenCLRunEnv( GPUEnv *gpuInfo )
namespace {
// based on crashes and hanging during kernel compilation
-bool checkForKnownBadCompilers(const OpenCLDeviceInfo& rInfo)
+bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
{
+ // Check blacklist of known bad OpenCL implementations
- struct {
- const char* pVendorName; const char* pDriverVersion;
- } aBadOpenCLCompilers[] = {
- { "Intel(R) Corporation", "9.17.10.2884" }
- };
+ for (auto i = ScInterpreter::GetGlobalConfig().maOpenCLBlackList.cbegin();
+ i != ScInterpreter::GetGlobalConfig().maOpenCLBlackList.end();
+ ++i)
+ {
+#if defined WNT
+ if (i->maOS != "*" && i->maOS != "Windows")
+ continue;
+#elif defined LINUX
+ if (i->maOS != "*" && i->maOS != "Linux")
+ continue;
+#elif defined MACOSX
+ if (i->maOS != "*" && i->maOS != "OS X")
+ continue;
+#endif
+
+ // OS version check not yet implemented
+
+ if (i->maPlatformVendor != "*" && i->maPlatformVendor != rDevice.maVendor)
+ continue;
+
+ if (i->maDevice != "*" && i->maDevice != rDevice.maName)
+ continue;
+
+ if (i->maDriverVersionMin != "*" &&
+ (comphelper::string::compareVersionStrings(i->maDriverVersionMin, rDevice.maDriver) > 0 ||
+ (i->maDriverVersionMax != "" && comphelper::string::compareVersionStrings(i->maDriverVersionMax, rDevice.maDriver) < 0) ||
+ (i->maDriverVersionMax == "" && comphelper::string::compareVersionStrings(i->maDriverVersionMin, rDevice.maDriver) < 0)))
+ continue;
+
+ // It matches; reject it
+ SAL_INFO("sc.opencl", "Match for platform=" << rPlatform << ", device=" << rDevice << " in blacklist=" << *i);
+ return true;
+ }
+
+ // Check for whitelist of known good OpenCL implementations
- for(size_t i = 0; i < SAL_N_ELEMENTS(aBadOpenCLCompilers); ++i)
+ for (auto i = ScInterpreter::GetGlobalConfig().maOpenCLWhiteList.cbegin();
+ i != ScInterpreter::GetGlobalConfig().maOpenCLWhiteList.end();
+ ++i)
{
- if(rInfo.maVendor == OUString::createFromAscii(aBadOpenCLCompilers[i].pVendorName) &&
- rInfo.maDriver == OUString::createFromAscii(aBadOpenCLCompilers[i].pDriverVersion))
- return true;
+#if defined WNT
+ if (i->maOS != "*" && i->maOS != "Windows")
+ continue;
+#elif defined LINUX
+ if (i->maOS != "*" && i->maOS != "Linux")
+ continue;
+#elif defined MACOSX
+ if (i->maOS != "*" && i->maOS != "OS X")
+ continue;
+#endif
+
+ // OS version check not yet implemented
+
+ if (i->maPlatformVendor != "*" && i->maPlatformVendor != rPlatform.maVendor)
+ continue;
+
+ if (i->maDevice != "*" && i->maDevice != rDevice.maName)
+ continue;
+
+ if (i->maDriverVersionMin != "*" &&
+ (comphelper::string::compareVersionStrings(i->maDriverVersionMin, rDevice.maDriver) > 0 ||
+ comphelper::string::compareVersionStrings(i->maDriverVersionMax, rDevice.maDriver) < 0))
+ continue;
+
+ // It matches; approve it
+ SAL_INFO("sc.opencl", "Match for platform=" << rPlatform << ", device=" << rDevice << " in whitelist=" << *i);
+ return false;
}
- return false;
+ // Fallback: reject
+ SAL_INFO("sc.opencl", "Fallback: rejecting platform=" << rPlatform << ", device=" << rDevice);
+ return true;
}
void createDeviceInfo(cl_device_id aDeviceId, OpenCLPlatformInfo& rPlatformInfo)
@@ -590,7 +652,7 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenCLPlatformInfo& rPlatformInfo)
aDeviceInfo.mnComputeUnits = nComputeUnits;
- if(!checkForKnownBadCompilers(aDeviceInfo))
+ if(!checkForKnownBadCompilers(rPlatformInfo, aDeviceInfo))
rPlatformInfo.maDevices.push_back(aDeviceInfo);
}
commit 6e77fd94bbe764a6e52ce5af7d9c4a8d16fef61a
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 19:01:56 2014 +0200
Add a whitelist entry, too (for what I happen to be running at the moment)
I am starting to suspect that we will need regexps for the driver versions,
not just match-anything wildcard "*" and version number comparison a'la
strverscmp.
Change-Id: I6945f8be2cf478a8f0c76c5d9f82b2d60a981f37
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index e4a7e2d..918eba0 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1394,7 +1394,7 @@
<info>
<desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be good. Has higher priority than OpenCLBlackList. Each entry is a string consisting of five parts separated by slashes. In case a slash occurs inside a part, it is prefixed by a backslash. And in case a backslash occurs inside a part, it is also prefixed by another backslash. Any part might contain a single asterisk as a wildcard, matching any value, but there is no more generic regexp support.</desc>
</info>
- <value/>
+ <value oor:separator=";">*/*/AMD Accelerated Parallel Processing/*/1445.5 (sse2,avx)/</value>
</prop>
<prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
<!-- UIHints: Tools - Options Spreadsheet Formula -->
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 36d1fa5..1a2e69a 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -44,6 +44,9 @@ void ScCalcConfig::setOpenCLConfigToDefault()
maOpenCLSubsetOpCodes.insert(ocSum);
maOpenCLSubsetOpCodes.insert(ocAverage);
maOpenCLSubsetOpCodes.insert(ocSumIfs);
+
+ maOpenCLWhiteList.insert(OpenCLImplMatcher("Linux", "*", "AMD Accelerated Parallel Processing", "*", "1445.5 (sse2,avx)", ""));
+
maOpenCLBlackList.insert(OpenCLImplMatcher("Windows", "*", "Intel(R) Corporation", "*", "9.17.10.2884", ""));
maOpenCLBlackList.insert(OpenCLImplMatcher("SuperOS", "*", "Big Corp, Inc.", "Whizz\\Grafix", "4.2/beta;3", "4.4"));
}
commit 44643be33e25d3949d019000412f5ecea1fbb5cf
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 19:00:36 2014 +0200
Add output operators for SAL_INFO convenience
Change-Id: Iee3be5f4847f12f3463438435b1713c5ad74d3d0
diff --git a/sc/inc/platforminfo.hxx b/sc/inc/platforminfo.hxx
index c7bb377..8fd0ee2 100644
--- a/sc/inc/platforminfo.hxx
+++ b/sc/inc/platforminfo.hxx
@@ -10,6 +10,7 @@
#ifndef INCLUDED_SC_INC_PLATFORMINFO_HXX
#define INCLUDED_SC_INC_PLATFORMINFO_HXX
+#include <ostream>
#include <vector>
#include <rtl/ustring.hxx>
@@ -43,4 +44,7 @@ struct SC_DLLPUBLIC OpenCLPlatformInfo
}
+SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLPlatformInfo& rPlatform);
+SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLDeviceInfo& rDevice);
+
#endif
diff --git a/sc/source/core/tool/platforminfo.cxx b/sc/source/core/tool/platforminfo.cxx
index c983f48..6258844 100644
--- a/sc/source/core/tool/platforminfo.cxx
+++ b/sc/source/core/tool/platforminfo.cxx
@@ -26,4 +26,23 @@ OpenCLPlatformInfo::OpenCLPlatformInfo()
}
+std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLPlatformInfo& rPlatform)
+{
+ rStream << "{"
+ "Vendor=" << rPlatform.maVendor << ","
+ "Name=" << rPlatform.maName <<
+ "}";
+ return rStream;
+}
+
+std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLDeviceInfo& rDevice)
+{
+ rStream << "{"
+ "Name=" << rDevice.maName << ","
+ "Vendor=" << rDevice.maVendor << ","
+ "Driver=" << rDevice.maDriver <<
+ "}";
+ return rStream;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 95bb07b1be264660174b25d316f7fb91fec35a7a
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 15:20:44 2014 +0200
Bin effectively dead code
initOpenCLAttr() sets mnIsUserCreated to 1, thus it can never be 0 in
initOpenCLRunEnv().
Change-Id: If42b4fac082284bd0924292d234911b3c319f9ab
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 4516af5..e6a0f7d 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -501,122 +501,6 @@ void checkDeviceForDoubleSupport(cl_device_id deviceId, bool& bKhrFp64, bool& bA
bool OpenCLDevice::initOpenCLRunEnv( GPUEnv *gpuInfo )
{
- size_t length;
- cl_int clStatus;
- cl_uint numPlatforms, numDevices;
- cl_platform_id *platforms;
-
- // Have a look at the available platforms.
-
- if ( !gpuInfo->mnIsUserCreated )
- {
- clStatus = clGetPlatformIDs( 0, NULL, &numPlatforms );
- CHECK_OPENCL(clStatus, "clGetPlatformIDs");
- gpuInfo->mpPlatformID = NULL;
-
- if ( 0 < numPlatforms )
- {
- char platformName[256];
- platforms = (cl_platform_id*) malloc( numPlatforms * sizeof( cl_platform_id ) );
- if (!platforms)
- {
- return true;
- }
- clStatus = clGetPlatformIDs( numPlatforms, platforms, NULL );
- CHECK_OPENCL(clStatus, "clGetPlatformIDs");
-
- for ( unsigned int i = 0; i < numPlatforms; i++ )
- {
- clStatus = clGetPlatformInfo( platforms[i], CL_PLATFORM_VENDOR,
- sizeof( platformName ), platformName, NULL );
-
- if ( clStatus != CL_SUCCESS )
- {
- break;
- }
- gpuInfo->mpPlatformID = platforms[i];
-
- //if (!strcmp(platformName, "Intel(R) Coporation"))
- //if( !strcmp( platformName, "Advanced Micro Devices, Inc." ))
- {
- gpuInfo->mpPlatformID = platforms[i];
- if ( getenv("SC_OPENCLCPU") )
- {
- clStatus = clGetDeviceIDs(gpuInfo->mpPlatformID, // platform
- CL_DEVICE_TYPE_CPU, // device_type for CPU device
- 0, // num_entries
- NULL, // devices
- &numDevices);
- }
- else
- {
- clStatus = clGetDeviceIDs(gpuInfo->mpPlatformID, // platform
- CL_DEVICE_TYPE_GPU, // device_type for GPU device
- 0, // num_entries
- NULL, // devices
- &numDevices);
- }
- if ( clStatus != CL_SUCCESS )
- continue;
-
- if ( numDevices )
- break;
- }
- }
- free( platforms );
- if ( clStatus != CL_SUCCESS )
- return true;
- }
- if ( NULL == gpuInfo->mpPlatformID )
- return true;
-
- // Use available platform.
- cl_context_properties cps[3];
- cps[0] = CL_CONTEXT_PLATFORM;
- cps[1] = reinterpret_cast<cl_context_properties>(gpuInfo->mpPlatformID);
- cps[2] = 0;
- // Set device type for OpenCL
- if ( getenv("SC_OPENCLCPU") )
- {
- gpuInfo->mDevType = CL_DEVICE_TYPE_CPU;
- }
- else
- {
- gpuInfo->mDevType = CL_DEVICE_TYPE_GPU;
- }
- gpuInfo->mpContext = clCreateContextFromType( cps, gpuInfo->mDevType, NULL, NULL, &clStatus );
-
- if ( ( gpuInfo->mpContext == (cl_context) NULL) || ( clStatus != CL_SUCCESS ) )
- {
- gpuInfo->mDevType = CL_DEVICE_TYPE_CPU;
- gpuInfo->mpContext = clCreateContextFromType( cps, gpuInfo->mDevType, NULL, NULL, &clStatus );
- }
- if ( ( gpuInfo->mpContext == (cl_context) NULL) || ( clStatus != CL_SUCCESS ) )
- {
- gpuInfo->mDevType = CL_DEVICE_TYPE_DEFAULT;
- gpuInfo->mpContext = clCreateContextFromType( cps, gpuInfo->mDevType, NULL, NULL, &clStatus );
- }
- if ( ( gpuInfo->mpContext == (cl_context) NULL) || ( clStatus != CL_SUCCESS ) )
- return true;
- // Detect OpenCL devices.
- // First, get the size of device list data
- clStatus = clGetContextInfo( gpuInfo->mpContext, CL_CONTEXT_DEVICES, 0, NULL, &length );
- if ( ( clStatus != CL_SUCCESS ) || ( length == 0 ) )
- return true;
- // Now allocate memory for device list based on the size we got earlier
- gpuInfo->mpArryDevsID = (cl_device_id*) malloc( length );
- if ( gpuInfo->mpArryDevsID == (cl_device_id*) NULL )
- return true;
- // Now, get the device list data
- clStatus = clGetContextInfo( gpuInfo->mpContext, CL_CONTEXT_DEVICES, length,
- gpuInfo->mpArryDevsID, NULL );
- CHECK_OPENCL(clStatus, "clGetContextInfo");
-
- // Create OpenCL command queue.
- gpuInfo->mpCmdQueue = clCreateCommandQueue( gpuInfo->mpContext, gpuInfo->mpArryDevsID[0], 0, &clStatus );
-
- CHECK_OPENCL(clStatus, "clCreateCommandQueue");
- }
bool bKhrFp64 = false;
bool bAmdFp64 = false;
@@ -912,10 +796,7 @@ bool switchOpenCLDevice(const OUString* pDevice, bool bAutoSelect, bool bForceEv
// (Assuming the above question refers to the mpArryDevsID
// initialisation below.) Because otherwise the code crashes in
- // initOpenCLRunEnv(). Note that the initOpenCLAttr() call above
- // sets mnIsUserCreated to 1, thus the code in initOpenCLRunEnv()
- // that would initialise mpArryDevsID is not executed. Confused?
- // You should be.
+ // initOpenCLRunEnv(). Confused? You should be.
OpenCLDevice::gpuEnv.mpArryDevsID = (cl_device_id*) malloc( sizeof(cl_device_id) );
OpenCLDevice::gpuEnv.mpArryDevsID[0] = pDeviceId;
commit 5c8f76ff6c9cd74325572e9078021e318fd72afe
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 15:02:37 2014 +0200
Add comment that replies to the question in comment above
Change-Id: Iad8896df4491b2b4363fb2d16134e92dd9545c35
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 3812bd7..4516af5 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -909,8 +909,17 @@ bool switchOpenCLDevice(const OUString* pDevice, bool bAutoSelect, bool bForceEv
OpenCLDevice::initOpenCLAttr(&env);
// why do we need this at all?
+
+ // (Assuming the above question refers to the mpArryDevsID
+ // initialisation below.) Because otherwise the code crashes in
+ // initOpenCLRunEnv(). Note that the initOpenCLAttr() call above
+ // sets mnIsUserCreated to 1, thus the code in initOpenCLRunEnv()
+ // that would initialise mpArryDevsID is not executed. Confused?
+ // You should be.
+
OpenCLDevice::gpuEnv.mpArryDevsID = (cl_device_id*) malloc( sizeof(cl_device_id) );
OpenCLDevice::gpuEnv.mpArryDevsID[0] = pDeviceId;
+
return !OpenCLDevice::initOpenCLRunEnv(0);
}
commit de99aa16c0fbbd2801c5f90788adbea7013be11f
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 14:14:32 2014 +0200
Don't use misleading 'm' prefix for non-member variables
Change-Id: I5b3042e4b5cc11445a8f704df686cebe56874b12
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 0c01274..3812bd7 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -136,16 +136,16 @@ std::vector<boost::shared_ptr<osl::File> > OpenCLDevice::binaryGenerated( const
return aGeneratedFiles;
// grab the handles to all of the devices in the context.
- boost::scoped_array<cl_device_id> mpArryDevsID(new cl_device_id[numDevices]);
+ boost::scoped_array<cl_device_id> pArryDevsID(new cl_device_id[numDevices]);
clStatus = clGetContextInfo( context, CL_CONTEXT_DEVICES,
- sizeof( cl_device_id ) * numDevices, mpArryDevsID.get(), NULL );
+ sizeof( cl_device_id ) * numDevices, pArryDevsID.get(), NULL );
if(clStatus != CL_SUCCESS)
return aGeneratedFiles;
for ( size_t i = 0; i < numDevices; i++ )
{
- if ( mpArryDevsID[i] != 0 )
+ if ( pArryDevsID[i] != 0 )
{
OString fileName = createFileName(gpuEnv.mpArryDevsID[i], clFileName);
osl::File* pNewFile = new osl::File(rtl::OStringToOUString(fileName, RTL_TEXTENCODING_UTF8));
@@ -191,10 +191,10 @@ bool OpenCLDevice::generatBinFromKernelSource( cl_program program, const char *
sizeof(numDevices), &numDevices, NULL );
CHECK_OPENCL( clStatus, "clGetProgramInfo" );
- std::vector<cl_device_id> mpArryDevsID(numDevices);
+ std::vector<cl_device_id> pArryDevsID(numDevices);
/* grab the handles to all of the devices in the program. */
clStatus = clGetProgramInfo( program, CL_PROGRAM_DEVICES,
- sizeof(cl_device_id) * numDevices, &mpArryDevsID[0], NULL );
+ sizeof(cl_device_id) * numDevices, &pArryDevsID[0], NULL );
CHECK_OPENCL( clStatus, "clGetProgramInfo" );
/* figure out the sizes of each of the binaries. */
@@ -229,7 +229,7 @@ bool OpenCLDevice::generatBinFromKernelSource( cl_program program, const char *
if ( binarySizes[i] != 0 )
{
- OString fileName = createFileName(mpArryDevsID[i], clFileName);
+ OString fileName = createFileName(pArryDevsID[i], clFileName);
if ( !writeBinaryToFile( fileName,
binaries[i], binarySizes[i] ) )
SAL_INFO("sc.opencl.file", "Writing binary file '" << fileName << "': FAIL");
@@ -388,9 +388,9 @@ bool OpenCLDevice::buildProgramFromBinary(const char* buildOption, GPUEnv* gpuIn
}
// grab the handles to all of the devices in the context.
- boost::scoped_array<cl_device_id> mpArryDevsID(new cl_device_id[numDevices]);
+ boost::scoped_array<cl_device_id> pArryDevsID(new cl_device_id[numDevices]);
clStatus = clGetContextInfo( gpuInfo->mpContext, CL_CONTEXT_DEVICES,
- sizeof( cl_device_id ) * numDevices, mpArryDevsID.get(), NULL );
+ sizeof( cl_device_id ) * numDevices, pArryDevsID.get(), NULL );
if(clStatus != CL_SUCCESS)
{
@@ -404,7 +404,7 @@ bool OpenCLDevice::buildProgramFromBinary(const char* buildOption, GPUEnv* gpuIn
cl_int binary_status;
gpuInfo->mpArryPrograms[idx] = clCreateProgramWithBinary( gpuInfo->mpContext,numDevices,
- mpArryDevsID.get(), length.get(), (const unsigned char**) pBinary.get(),
+ pArryDevsID.get(), length.get(), (const unsigned char**) pBinary.get(),
&binary_status, &clStatus );
if(clStatus != CL_SUCCESS)
{
commit ed1070949b81814ab6bdb7efcb18b747832247f5
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 13:39:31 2014 +0200
Expand tiny misleadingly named 'registerOpenCLKernel' at its only call site
The function did not register any OpenCL kernel;)
Change-Id: Iebba89bc39d3035ff0d39d9cfa8ec72d4ebf217a
diff --git a/sc/source/core/inc/openclwrapper.hxx b/sc/source/core/inc/openclwrapper.hxx
index bc3957f..1f11ffc 100644
--- a/sc/source/core/inc/openclwrapper.hxx
+++ b/sc/source/core/inc/openclwrapper.hxx
@@ -75,7 +75,6 @@ public:
static bool bIsInited;
static OString maCacheFolder;
- static void registerOpenCLKernel();
static bool initOpenCLRunEnv( GPUEnv *gpu );
static void releaseOpenCLEnv( GPUEnv *gpuInfo );
static bool initOpenCLRunEnv( int argc );
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 23db69e..0c01274 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -81,12 +81,6 @@ OString getCacheFolder()
OString OpenCLDevice::maCacheFolder = getCacheFolder();
-void OpenCLDevice::registerOpenCLKernel()
-{
- if ( !gpuEnv.mnIsUserCreated )
- memset( &gpuEnv, 0, sizeof(gpuEnv) );
-}
-
void OpenCLDevice::setKernelEnv( KernelEnv *envInfo )
{
envInfo->mpkContext = gpuEnv.mpContext;
@@ -437,7 +431,9 @@ bool OpenCLDevice::initOpenCLRunEnv( int argc )
if ( !bIsInited )
{
- registerOpenCLKernel();
+ if ( !gpuEnv.mnIsUserCreated )
+ memset( &gpuEnv, 0, sizeof(gpuEnv) );
+
//initialize devices, context, command_queue
bool status = initOpenCLRunEnv( &gpuEnv );
if ( status )
commit 559478530b41e60528f2026c2f81872b0096dc94
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 12 13:29:37 2014 +0200
Keep also the platform vendor in ds_device
Change-Id: Id195cf9d079b24108b1fb9abeb1f0bf1529d2f72
diff --git a/sc/source/core/opencl/opencl_device_selection.h b/sc/source/core/opencl/opencl_device_selection.h
index fcfa41a..43e0f4c 100644
--- a/sc/source/core/opencl/opencl_device_selection.h
+++ b/sc/source/core/opencl/opencl_device_selection.h
@@ -49,6 +49,7 @@ struct ds_device
{
ds_device_type type;
cl_device_id oclDeviceID;
+ char* oclPlatformVendor;
char* oclDeviceName;
char* oclDriverVersion;
void* score; // a pointer to the score data, the content/format is application defined
@@ -73,6 +74,7 @@ inline ds_status releaseDSProfile(ds_profile* profile, ds_score_release sr)
unsigned int i;
for (i = 0; i < profile->numDevices; i++)
{
+ free(profile->devices[i].oclPlatformVendor);
free(profile->devices[i].oclDeviceName);
free(profile->devices[i].oclDriverVersion);
status = sr(profile->devices[i].score);
@@ -148,6 +150,9 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
{
cl_uint num;
unsigned j;
+ char vendor[256];
+ if (clGetPlatformInfo(platforms[i], CL_PLATFORM_VENDOR, sizeof(vendor), vendor, NULL) != CL_SUCCESS)
+ vendor[0] = '\0';
clGetDeviceIDs(platforms[i], CL_DEVICE_TYPE_ALL, numDevices, devices, &num);
for (j = 0; j < num; j++, next++)
{
@@ -157,6 +162,8 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
profile->devices[next].type = DS_DEVICE_OPENCL_DEVICE;
profile->devices[next].oclDeviceID = devices[j];
+ profile->devices[next].oclPlatformVendor = strdup(vendor);
+
clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DEVICE_NAME
, DS_DEVICE_NAME_LENGTH, &buffer, NULL);
length = strlen(buffer);
commit 372bef8902a16d48b53e284b6777ddfa10aa0bdb
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Nov 11 18:52:55 2014 +0200
Split driver version specification into a range
Change-Id: I1f26b47054e70e54ce81d3ec4cbc5ff58c1aeea3
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 597b87f..e4a7e2d 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1401,7 +1401,7 @@
<info>
<desc>Like OpenCLWhiteList, but for combinations known to be bad.</desc>
</info>
- <value oor:separator=";">Windows/*/Intel(R) Corporation/*/9.17.10.2884;SuperOS/*/Big Corp, Inc./Whizz\Grafix/4.2%2Fbeta%3B3</value>
+ <value oor:separator=";">Windows/*/Intel(R) Corporation/*/9.17.10.2884/;SuperOS/*/Big Corp, Inc./Whizz\Grafix/4.2%2Fbeta%3B3/4.4</value>
</prop>
</group>
<group oor:name="Syntax">
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 9768af8..d46fa84 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -47,7 +47,8 @@ struct SC_DLLPUBLIC ScCalcConfig
OUString maOSVersion;
OUString maPlatformVendor;
OUString maDevice;
- OUString maDriverVersion;
+ OUString maDriverVersionMin;
+ OUString maDriverVersionMax;
OpenCLImplMatcher()
{
@@ -57,12 +58,14 @@ struct SC_DLLPUBLIC ScCalcConfig
const OUString& rOSVersion,
const OUString& rPlatformVendor,
const OUString& rDevice,
- const OUString& rDriverVersion)
+ const OUString& rDriverVersionMin,
+ const OUString& rDriverVersionMax)
: maOS(rOS),
maOSVersion(rOSVersion),
maPlatformVendor(rPlatformVendor),
maDevice(rDevice),
- maDriverVersion(rDriverVersion)
+ maDriverVersionMin(rDriverVersionMin),
+ maDriverVersionMax(rDriverVersionMax)
{
}
@@ -72,7 +75,8 @@ struct SC_DLLPUBLIC ScCalcConfig
maOSVersion == r.maOSVersion &&
maPlatformVendor == r.maPlatformVendor &&
maDevice == r.maDevice &&
- maDriverVersion == r.maDriverVersion;
+ maDriverVersionMin == r.maDriverVersionMin &&
+ maDriverVersionMax == r.maDriverVersionMax;
}
bool operator!=(const OpenCLImplMatcher& r) const
{
@@ -88,7 +92,9 @@ struct SC_DLLPUBLIC ScCalcConfig
(maPlatformVendor == r.maPlatformVendor &&
(maDevice < r.maDevice ||
(maDevice == r.maDevice &&
- (maDriverVersion < r.maDriverVersion)))))))));
+ (maDriverVersionMin < r.maDriverVersionMin ||
+ (maDriverVersionMin == r.maDriverVersionMin &&
+ maDriverVersionMax < r.maDriverVersionMax))))))))));
}
};
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index a3197a8..36d1fa5 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -44,8 +44,8 @@ void ScCalcConfig::setOpenCLConfigToDefault()
maOpenCLSubsetOpCodes.insert(ocSum);
maOpenCLSubsetOpCodes.insert(ocAverage);
maOpenCLSubsetOpCodes.insert(ocSumIfs);
- maOpenCLBlackList.insert(OpenCLImplMatcher("Windows", "*", "Intel(R) Corporation", "*", "9.17.10.2884"));
- maOpenCLBlackList.insert(OpenCLImplMatcher("SuperOS", "*", "Big Corp, Inc.", "Whizz\\Grafix", "4.2/beta;3"));
+ maOpenCLBlackList.insert(OpenCLImplMatcher("Windows", "*", "Intel(R) Corporation", "*", "9.17.10.2884", ""));
+ maOpenCLBlackList.insert(OpenCLImplMatcher("SuperOS", "*", "Big Corp, Inc.", "Whizz\\Grafix", "4.2/beta;3", "4.4"));
}
void ScCalcConfig::reset()
@@ -89,7 +89,7 @@ std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMa
"OSVersion=" << rImpl.maOSVersion << ","
"PlatformVendor=" << rImpl.maPlatformVendor << ","
"Device=" << rImpl.maDevice << ","
- "DriverVersion=" << rImpl.maDriverVersion <<
+ "DriverVersion=[" << rImpl.maDriverVersionMin << "," << rImpl.maDriverVersionMax << "]"
"}";
return rStream;
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index f2cd325e..ae79e75 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -292,7 +292,8 @@ css::uno::Sequence<OUString> SetOfOpenCLImplMatcherToStringSequence(std::set<ScC
(*i).maOSVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
(*i).maPlatformVendor.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
(*i).maDevice.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
- (*i).maDriverVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B");
+ (*i).maDriverVersionMin.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
+ (*i).maDriverVersionMax.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B");
}
return result;
@@ -335,7 +336,8 @@ std::set<ScCalcConfig::OpenCLImplMatcher> StringSequenceToSetOfOpenCLImplMatcher
m.maOSVersion = getToken(*i, index);
m.maPlatformVendor = getToken(*i, index);
m.maDevice = getToken(*i, index);
- m.maDriverVersion = getToken(*i, index);
+ m.maDriverVersionMin = getToken(*i, index);
+ m.maDriverVersionMax = getToken(*i, index);
result.insert(m);
}
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 338f565..7925158 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -149,7 +149,8 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
get(mpOSVersion, "osversion");
get(mpPlatformVendor, "platformvendor");
get(mpDevice, "opencldevice");
- get(mpDriverVersion, "opencldriverversion");
+ get(mpDriverVersionMin, "opencldriverversionmin");
+ get(mpDriverVersionMax, "opencldriverversionmax");
get(mpListEditButton, "listbox-edit");
get(mpListNewButton, "listbox-new");
get(mpListDeleteButton, "listbox-delete");
@@ -166,7 +167,8 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
mpOSVersion->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
mpPlatformVendor->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
mpDevice->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
- mpDriverVersion->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
+ mpDriverVersionMin->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
+ mpDriverVersionMax->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
mpOpenCLWhiteAndBlackListBox->set_height_request(4* mpOpenCLWhiteAndBlackListBox->GetTextHeight());
mpOpenCLWhiteAndBlackListBox->SetStyle(mpOpenCLWhiteAndBlackListBox->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
@@ -314,7 +316,10 @@ OUString format(const ScCalcConfig::OpenCLImplMatcher& rImpl)
rImpl.maOSVersion + " " +
rImpl.maPlatformVendor + " " +
rImpl.maDevice + " " +
- rImpl.maDriverVersion);
+ (rImpl.maDriverVersionMax != "" ?
+ OUString("[") + rImpl.maDriverVersionMin + "," + rImpl.maDriverVersionMax + "]" :
+ rImpl.maDriverVersionMin)
+ );
}
void fillListBox(ListBox* pListBox, const ScCalcConfig::OpenCLImplMatcherSet& rSet)
@@ -794,9 +799,13 @@ void ScCalcOptionsDialog::EditFieldValueChanged(Control *pCtrl)
{
newImpl.maDevice = sVal;
}
- else if (pEdit == mpDriverVersion)
+ else if (pEdit == mpDriverVersionMin)
{
- newImpl.maDriverVersion = sVal;
+ newImpl.maDriverVersionMin = sVal;
+ }
+ else if (pEdit == mpDriverVersionMax)
+ {
+ newImpl.maDriverVersionMax = sVal;
}
else
assert(false && "pEdit does not match any of the Edit fields");
@@ -905,7 +914,8 @@ IMPL_LINK(ScCalcOptionsDialog, OpenCLWhiteAndBlackListSelHdl, Control*, )
mpOSVersion->SetText(impl.maOSVersion);
mpPlatformVendor->SetText(impl.maPlatformVendor);
mpDevice->SetText(impl.maDevice);
- mpDriverVersion->SetText(impl.maDriverVersion);
+ mpDriverVersionMin->SetText(impl.maDriverVersionMin);
+ mpDriverVersionMax->SetText(impl.maDriverVersionMax);
return 0;
}
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index 290d470..2942f68 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -80,7 +80,8 @@ private:
Edit* mpOSVersion;
Edit* mpPlatformVendor;
Edit* mpDevice;
- Edit* mpDriverVersion;
+ Edit* mpDriverVersionMin;
+ Edit* mpDriverVersionMax;
PushButton* mpListEditButton;
PushButton* mpListNewButton;
PushButton* mpListDeleteButton;
diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
index 513106c..312f3be 100644
--- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
+++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
@@ -214,8 +214,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">_OS</property>
- <property name="use_underline">True</property>
+ <property name="label" translatable="yes">OS</property>
<property name="mnemonic_widget">os:border</property>
</object>
<packing>
@@ -238,8 +237,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">OS _Version</property>
- <property name="use_underline">True</property>
+ <property name="label" translatable="yes">OS Version</property>
<property name="mnemonic_widget">osversion:border</property>
</object>
<packing>
@@ -263,7 +261,6 @@
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">OpenCL Platform Vendor</property>
- <property name="use_underline">True</property>
<property name="mnemonic_widget">openclvendor:border</property>
</object>
<packing>
@@ -287,7 +284,6 @@
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">OpenCL Device</property>
- <property name="use_underline">True</property>
<property name="mnemonic_widget">opencldevice:border</property>
</object>
<packing>
@@ -306,13 +302,12 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="opencldriverversionlabel">
+ <object class="GtkLabel" id="opencldriverversionminlabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">OpenCL Driver Version</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">opencldriverversion:border</property>
+ <property name="label" translatable="yes">OpenCL Driver Version Lower Bound</property>
+ <property name="mnemonic_widget">opencldriverversionmin:border</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -320,7 +315,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="opencldriverversion:border">
+ <object class="GtkEntry" id="opencldriverversionmin:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
@@ -329,6 +324,29 @@
<property name="top_attach">9</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="opencldriverversionmaxlabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">OpenCL Driver Version Upper Bound</property>
+ <property name="mnemonic_widget">opencldriverversionmax:border</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="opencldriverversionmax:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
commit 4554e71e46c2ba68d1559e5e90bd648916bd67a3
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Nov 11 11:23:45 2014 +0200
Rename OpenCLImpl to OpenCLImplMatcher to better match its purpose
Change-Id: If9b7052385a49df1403a5f652c67ca7c103a8be2
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 4b72dc8..9768af8 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -41,7 +41,7 @@ struct SC_DLLPUBLIC ScCalcConfig
STRING_CONVERSION_LOCALE_DEPENDENT ///< =1+"1.000" may be 2 or 1001 ... =1+"x" gives #VALUE!
};
- struct OpenCLImpl
+ struct OpenCLImplMatcher
{
OUString maOS;
OUString maOSVersion;
@@ -49,15 +49,15 @@ struct SC_DLLPUBLIC ScCalcConfig
OUString maDevice;
OUString maDriverVersion;
- OpenCLImpl()
+ OpenCLImplMatcher()
{
}
- OpenCLImpl(const OUString& rOS,
- const OUString& rOSVersion,
- const OUString& rPlatformVendor,
- const OUString& rDevice,
- const OUString& rDriverVersion)
+ OpenCLImplMatcher(const OUString& rOS,
+ const OUString& rOSVersion,
+ const OUString& rPlatformVendor,
+ const OUString& rDevice,
+ const OUString& rDriverVersion)
: maOS(rOS),
maOSVersion(rOSVersion),
maPlatformVendor(rPlatformVendor),
@@ -66,7 +66,7 @@ struct SC_DLLPUBLIC ScCalcConfig
{
}
- bool operator==(const OpenCLImpl& r) const
+ bool operator==(const OpenCLImplMatcher& r) const
{
return maOS == r.maOS &&
maOSVersion == r.maOSVersion &&
@@ -74,11 +74,11 @@ struct SC_DLLPUBLIC ScCalcConfig
maDevice == r.maDevice &&
maDriverVersion == r.maDriverVersion;
}
- bool operator!=(const OpenCLImpl& r) const
+ bool operator!=(const OpenCLImplMatcher& r) const
{
return !operator==(r);
}
- bool operator<(const OpenCLImpl& r) const
+ bool operator<(const OpenCLImplMatcher& r) const
{
return (maOS < r.maOS ||
(maOS == r.maOS &&
@@ -106,10 +106,10 @@ struct SC_DLLPUBLIC ScCalcConfig
OpCodeSet maOpenCLSubsetOpCodes;
- typedef std::set<OpenCLImpl> OpenCLImplSet;
+ typedef std::set<OpenCLImplMatcher> OpenCLImplMatcherSet;
- OpenCLImplSet maOpenCLWhiteList;
- OpenCLImplSet maOpenCLBlackList;
+ OpenCLImplMatcherSet maOpenCLWhiteList;
+ OpenCLImplMatcherSet maOpenCLBlackList;
ScCalcConfig();
@@ -122,8 +122,8 @@ struct SC_DLLPUBLIC ScCalcConfig
bool operator!= (const ScCalcConfig& r) const;
};
-SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImpl& rImpl);
-SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplSet& rSet);
+SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMatcher& rImpl);
+SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMatcherSet& rSet);
SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig& rConfig);
SC_DLLPUBLIC OUString ScOpCodeSetToNumberString(const ScCalcConfig::OpCodeSet& rOpCodes);
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 583c2a3..a3197a8 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -44,8 +44,8 @@ void ScCalcConfig::setOpenCLConfigToDefault()
maOpenCLSubsetOpCodes.insert(ocSum);
maOpenCLSubsetOpCodes.insert(ocAverage);
maOpenCLSubsetOpCodes.insert(ocSumIfs);
- maOpenCLBlackList.insert(OpenCLImpl("Windows", "*", "Intel(R) Corporation", "*", "9.17.10.2884"));
- maOpenCLBlackList.insert(OpenCLImpl("SuperOS", "*", "Big Corp, Inc.", "Whizz\\Grafix", "4.2/beta;3"));
+ maOpenCLBlackList.insert(OpenCLImplMatcher("Windows", "*", "Intel(R) Corporation", "*", "9.17.10.2884"));
+ maOpenCLBlackList.insert(OpenCLImplMatcher("SuperOS", "*", "Big Corp, Inc.", "Whizz\\Grafix", "4.2/beta;3"));
}
void ScCalcConfig::reset()
@@ -82,7 +82,7 @@ bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
return !operator==(r);
}
-std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImpl& rImpl)
+std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMatcher& rImpl)
{
rStream << "{"
"OS=" << rImpl.maOS << ","
@@ -95,7 +95,7 @@ std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImpl&
return rStream;
}
-std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplSet& rSet)
+std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMatcherSet& rSet)
{
rStream << "{";
for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index bcf7282..f2cd325e 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -280,7 +280,7 @@ ScFormulaCfg::ScFormulaCfg() :
namespace {
-css::uno::Sequence<OUString> SetOfOpenCLImplToStringSequence(std::set<ScCalcConfig::OpenCLImpl>& rSet)
+css::uno::Sequence<OUString> SetOfOpenCLImplMatcherToStringSequence(std::set<ScCalcConfig::OpenCLImplMatcher>& rSet)
{
css::uno::Sequence<OUString> result(rSet.size());
@@ -323,13 +323,13 @@ OUString getToken(const OUString& string, sal_Int32& index)
return result;
}
-std::set<ScCalcConfig::OpenCLImpl> StringSequenceToSetOfOpenCLImpl(css::uno::Sequence<OUString>& rSequence)
+std::set<ScCalcConfig::OpenCLImplMatcher> StringSequenceToSetOfOpenCLImplMatcher(css::uno::Sequence<OUString>& rSequence)
{
- std::set<ScCalcConfig::OpenCLImpl> result;
+ std::set<ScCalcConfig::OpenCLImplMatcher> result;
for (auto i = rSequence.begin(); i != rSequence.end(); ++i)
{
- ScCalcConfig::OpenCLImpl m;
+ ScCalcConfig::OpenCLImplMatcher m;
sal_Int32 index(0);
m.maOS = getToken(*i, index);
m.maOSVersion = getToken(*i, index);
@@ -589,16 +589,16 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
break;
case SCFORMULAOPT_OPENCL_WHITELIST:
{
- css::uno::Sequence<OUString> sVal = SetOfOpenCLImplToStringSequence(GetCalcConfig().maOpenCLWhiteList);
+ css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLWhiteList);
pValues[nProp] >>= sVal;
- GetCalcConfig().maOpenCLWhiteList = StringSequenceToSetOfOpenCLImpl(sVal);
+ GetCalcConfig().maOpenCLWhiteList = StringSequenceToSetOfOpenCLImplMatcher(sVal);
}
break;
case SCFORMULAOPT_OPENCL_BLACKLIST:
{
- css::uno::Sequence<OUString> sVal = SetOfOpenCLImplToStringSequence(GetCalcConfig().maOpenCLBlackList);
+ css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList);
pValues[nProp] >>= sVal;
- GetCalcConfig().maOpenCLBlackList = StringSequenceToSetOfOpenCLImpl(sVal);
+ GetCalcConfig().maOpenCLBlackList = StringSequenceToSetOfOpenCLImplMatcher(sVal);
}
break;
}
@@ -756,13 +756,13 @@ void ScFormulaCfg::Commit()
break;
case SCFORMULAOPT_OPENCL_WHITELIST:
{
- css::uno::Sequence<OUString> sVal = SetOfOpenCLImplToStringSequence(GetCalcConfig().maOpenCLWhiteList);
+ css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLWhiteList);
pValues[nProp] <<= sVal;
}
break;
case SCFORMULAOPT_OPENCL_BLACKLIST:
{
- css::uno::Sequence<OUString> sVal = SetOfOpenCLImplToStringSequence(GetCalcConfig().maOpenCLBlackList);
+ css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList);
pValues[nProp] <<= sVal;
}
break;
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 1510411..338f565 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -308,7 +308,7 @@ void ScCalcOptionsDialog::fillOpenCLList()
namespace {
-OUString format(const ScCalcConfig::OpenCLImpl& rImpl)
+OUString format(const ScCalcConfig::OpenCLImplMatcher& rImpl)
{
return (rImpl.maOS + " " +
rImpl.maOSVersion + " " +
@@ -317,7 +317,7 @@ OUString format(const ScCalcConfig::OpenCLImpl& rImpl)
rImpl.maDriverVersion);
}
-void fillListBox(ListBox* pListBox, const ScCalcConfig::OpenCLImplSet& rSet)
+void fillListBox(ListBox* pListBox, const ScCalcConfig::OpenCLImplMatcherSet& rSet)
{
pListBox->SetUpdateMode(false);
pListBox->Clear();
@@ -736,14 +736,14 @@ void ScCalcOptionsDialog::SpinButtonValueChanged()
maConfig.mnOpenCLMinimumFormulaGroupSize = nVal;
}
-ScCalcConfig::OpenCLImplSet& ScCalcOptionsDialog::CurrentWhiteOrBlackList()
+ScCalcConfig::OpenCLImplMatcherSet& ScCalcOptionsDialog::CurrentWhiteOrBlackList()
{
return (mpLbSettings->GetSelectEntryPos() == CALC_OPTION_OPENCL_WHITELIST ? maConfig.maOpenCLWhiteList : maConfig.maOpenCLBlackList);
}
-const ScCalcConfig::OpenCLImpl& ScCalcOptionsDialog::CurrentWhiteOrBlackListEntry()
+const ScCalcConfig::OpenCLImplMatcher& ScCalcOptionsDialog::CurrentWhiteOrBlackListEntry()
{
- ScCalcConfig::OpenCLImplSet& rSet(CurrentWhiteOrBlackList());
+ ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList());
auto i = rSet.begin();
int n(mpOpenCLWhiteAndBlackListBox->GetSelectEntryPos());
@@ -775,8 +775,8 @@ void ScCalcOptionsDialog::EditFieldValueChanged(Control *pCtrl)
// We know that this handler is otherwise currently used only
// for the OpenCL white/blacklists
- const ScCalcConfig::OpenCLImpl& impl(CurrentWhiteOrBlackListEntry());
- ScCalcConfig::OpenCLImpl newImpl(impl);
+ const ScCalcConfig::OpenCLImplMatcher& impl(CurrentWhiteOrBlackListEntry());
+ ScCalcConfig::OpenCLImplMatcher newImpl(impl);
if (pEdit == mpOS)
{
@@ -801,7 +801,7 @@ void ScCalcOptionsDialog::EditFieldValueChanged(Control *pCtrl)
else
assert(false && "pEdit does not match any of the Edit fields");
- ScCalcConfig::OpenCLImplSet& rSet(CurrentWhiteOrBlackList());
+ ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList());
rSet.erase(impl);
rSet.insert(newImpl);
@@ -899,7 +899,7 @@ IMPL_LINK(ScCalcOptionsDialog, OpenCLWhiteAndBlackListSelHdl, Control*, )
{
// We know this handler is used for the mpOpenCLWhiteAndBlackListBox
- const ScCalcConfig::OpenCLImpl& impl(CurrentWhiteOrBlackListEntry());
+ const ScCalcConfig::OpenCLImplMatcher& impl(CurrentWhiteOrBlackListEntry());
mpOS->SetText(impl.maOS);
mpOSVersion->SetText(impl.maOSVersion);
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index bc52291..290d470 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -63,8 +63,8 @@ private:
OUString toString(sal_Int32 nVal) const;
SvTreeListEntry *createItem(const OUString &rCaption, const OUString& sValue) const;
void setValueAt(size_t nPos, const OUString &rString);
- std::set<ScCalcConfig::OpenCLImpl>& CurrentWhiteOrBlackList();
- const ScCalcConfig::OpenCLImpl& CurrentWhiteOrBlackListEntry();
+ std::set<ScCalcConfig::OpenCLImplMatcher>& CurrentWhiteOrBlackList();
+ const ScCalcConfig::OpenCLImplMatcher& CurrentWhiteOrBlackListEntry();
private:
SvxCheckListBox* mpLbSettings;
More information about the Libreoffice-commits
mailing list