summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-11-03 14:04:12 +0200
committerTor Lillqvist <tml@collabora.com>2014-11-06 11:49:24 +0200
commit8dd9c5c8b1dc6baa50db3c190762cdc92b609049 (patch)
treedf7165ca090ff7aa41bc2bf2e9c901434d9fae07 /sc
parentcd911ddb3f37fc84fdf3c6463b98dcff2074e08c (diff)
Add also parameters for the opcode subset to enableOpenCL()
In CppunitTest_sc_opencl_test we want to explicitly disable subsetting and use OpenCL maximally, to match how it used to work. Change-Id: Ie900adb5fa58b7cd1111169e44efd70d8cac5256
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/formulagroup.hxx3
-rw-r--r--sc/qa/unit/opencl-test.cxx2
-rw-r--r--sc/source/core/tool/formulagroup.cxx4
3 files changed, 6 insertions, 3 deletions
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx
index 1ee0249d4799..d507cd51af8e 100644
--- a/sc/inc/formulagroup.hxx
+++ b/sc/inc/formulagroup.hxx
@@ -15,6 +15,7 @@
#include "platforminfo.hxx"
#include "stlalgorithm.hxx"
+#include <formula/opcode.hxx>
#include <svl/sharedstringpool.hxx>
#include <vector>
@@ -122,7 +123,7 @@ class SC_DLLPUBLIC FormulaGroupInterpreter
static FormulaGroupInterpreter *getStatic();
static void fillOpenCLInfo(std::vector<OpenCLPlatformInfo>& rPlatforms);
static bool switchOpenCLDevice(const OUString& rDeviceId, bool bAutoSelect, bool bForceEvaluation = false);
- static void enableOpenCL(bool bEnable);
+ static void enableOpenCL(bool bEnable, bool bEnableCompletely = false, const std::set<OpCodeEnum>& rSubsetToEnable = std::set<OpCodeEnum>());
static void getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int32& rPlatformId);
virtual ScMatrixRef inverseMatrix(const ScMatrix& rMat) = 0;
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 9b05518d5c40..f5f8324bdd57 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -553,7 +553,7 @@ bool ScOpenCLTest::detectOpenCLDevice()
void ScOpenCLTest::enableOpenCL()
{
- sc::FormulaGroupInterpreter::enableOpenCL(true);
+ sc::FormulaGroupInterpreter::enableOpenCL(true, true);
}
void ScOpenCLTest::testCompilerHorizontal()
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index b4a8827e913f..a5ad10bbfdfa 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -606,10 +606,12 @@ void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int3
#endif
}
-void FormulaGroupInterpreter::enableOpenCL(bool bEnable)
+void FormulaGroupInterpreter::enableOpenCL(bool bEnable, bool bEnableCompletely, const std::set<OpCodeEnum>& rSubsetToEnable)
{
ScCalcConfig aConfig = ScInterpreter::GetGlobalConfig();
aConfig.mbOpenCLEnabled = bEnable;
+ aConfig.mbOpenCLSubsetOnly = !bEnableCompletely;
+ aConfig.maOpenCLSubsetFunctions = rSubsetToEnable;
ScInterpreter::SetGlobalConfig(aConfig);
}