diff options
-rw-r--r-- | sc/inc/formulagroup.hxx | 3 | ||||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/formulagroup.cxx | 16 |
3 files changed, 9 insertions, 14 deletions
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx index ba553c600eaf..aa6699a9f12f 100644 --- a/sc/inc/formulagroup.hxx +++ b/sc/inc/formulagroup.hxx @@ -129,7 +129,8 @@ class SC_DLLPUBLIC FormulaGroupInterpreter #if HAVE_FEATURE_OPENCL static void fillOpenCLInfo(std::vector<OpenCLPlatformInfo>& rPlatforms); static bool switchOpenCLDevice(const OUString& rDeviceId, bool bAutoSelect, bool bForceEvaluation = false); - static void enableOpenCL(bool bEnable, bool bEnableCompletely = false, const std::set<OpCode>& rSubsetToEnable = std::set<OpCode>()); + // This is intended to be called from opencl-test.cxx only + static void enableOpenCL_UnitTestsOnly(); static void getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int32& rPlatformId); #endif virtual ScMatrixRef inverseMatrix(const ScMatrix& rMat) = 0; diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 069e85221168..11ea7d4325e6 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -547,13 +547,13 @@ bool ScOpenCLTest::load(const OUString &rFilter, const OUString &rURL, bool ScOpenCLTest::detectOpenCLDevice() { - sc::FormulaGroupInterpreter::enableOpenCL(true); + sc::FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly(); return sc::FormulaGroupInterpreter::switchOpenCLDevice(OUString(),true); } void ScOpenCLTest::enableOpenCL() { - sc::FormulaGroupInterpreter::enableOpenCL(true, true); + sc::FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly(); } void ScOpenCLTest::testCompilerHorizontal() diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx index 29bc51b311b6..25685e853cff 100644 --- a/sc/source/core/tool/formulagroup.cxx +++ b/sc/source/core/tool/formulagroup.cxx @@ -547,23 +547,17 @@ void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int3 rPlatformId = aPlatformId; } -void FormulaGroupInterpreter::enableOpenCL(bool bEnable, bool bEnableCompletely, const std::set<OpCode>& rSubsetToEnable) +void FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly() { boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::UseOpenCL::set(bEnable, batch); + officecfg::Office::Common::Misc::UseOpenCL::set(true, batch); batch->commit(); ScCalcConfig aConfig = ScInterpreter::GetGlobalConfig(); - if (!bEnable) - aConfig.setOpenCLConfigToDefault(); - else - { - aConfig.mbOpenCLSubsetOnly = !bEnableCompletely; - aConfig.maOpenCLSubsetOpCodes = rSubsetToEnable; - if (bEnableCompletely) - aConfig.mnOpenCLMinimumFormulaGroupSize = 2; - } + aConfig.mbOpenCLSubsetOnly = false; + aConfig.mnOpenCLMinimumFormulaGroupSize = 2; + ScInterpreter::SetGlobalConfig(aConfig); } |