Kaydet (Commit) 8dd9c5c8 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst cd911ddb
......@@ -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;
......
......@@ -553,7 +553,7 @@ bool ScOpenCLTest::detectOpenCLDevice()
void ScOpenCLTest::enableOpenCL()
{
sc::FormulaGroupInterpreter::enableOpenCL(true);
sc::FormulaGroupInterpreter::enableOpenCL(true, true);
}
void ScOpenCLTest::testCompilerHorizontal()
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment