summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-11-12 21:45:55 +0200
committerTor Lillqvist <tml@collabora.com>2014-11-12 21:50:03 +0200
commit6f584490d7ec60ea8a6b16aba35898de9edf6921 (patch)
tree0e1419d26bc4ea44ff8b99ef9833c6c7ede1811a
parent8b290c56dfcd6cc43a422601408378c887d84316 (diff)
Make checkForKnownBadCompilers() public
Change-Id: Icddf3c158e5f45d30467d3da82c197901d8bc380
-rw-r--r--sc/source/core/inc/openclwrapper.hxx2
-rw-r--r--sc/source/core/opencl/openclwrapper.cxx42
2 files changed, 23 insertions, 21 deletions
diff --git a/sc/source/core/inc/openclwrapper.hxx b/sc/source/core/inc/openclwrapper.hxx
index 1f11ffcdec7c..3da4afe1d220 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 2759fcd0fe1d..87cc1c56ed5a 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;