diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-10-12 11:34:20 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2018-11-14 16:09:16 +0100 |
commit | 12c95935f265b484c0a2fa13470085710729c903 (patch) | |
tree | a05fe2319f5acf42bee46ad9da7d64c573d5fe20 /sc/inc | |
parent | 7fb235b21d43f3afa340dfeb53efffd516ee21fd (diff) |
$SC_FORCE_CALCULATION to force Calc use opencl/threads for everything
So that e.g. unit tests can be easily run with OpenCL forced. This forces
even single cells to be evaluated using the forced method (many correctness
tests are just a single cell which normally would not be used for grouped
calculation).
Change-Id: If5c6e77a6e0d8696d5416d760cf5e47b8acf3d27
Reviewed-on: https://gerrit.libreoffice.org/63188
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/calcconfig.hxx | 11 | ||||
-rw-r--r-- | sc/inc/recursionhelper.hxx | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx index 2f840f9abdcb..ee99b0c10592 100644 --- a/sc/inc/calcconfig.hxx +++ b/sc/inc/calcconfig.hxx @@ -27,6 +27,16 @@ enum ScRecalcOptions RECALC_ASK, }; +// Env.var. SC_FORCE_CALCULATION can be used to force all calculation +// to be done using OpenCL or group threading (even for single cells). +enum ForceCalculationType +{ + ForceCalculationNone, // do not force anything + ForceCalculationCore, // "core", use only non-threaded normal code + ForceCalculationOpenCL, // "opencl", force OpenCL + ForceCalculationThreads // "threads", force threaded code +}; + /** * Configuration options for formula interpreter. */ @@ -47,6 +57,7 @@ struct SC_DLLPUBLIC ScCalcConfig static bool isOpenCLEnabled(); static bool isThreadingEnabled(); + static ForceCalculationType getForceCalculationType(); bool mbOpenCLSubsetOnly:1; bool mbOpenCLAutoSelect:1; diff --git a/sc/inc/recursionhelper.hxx b/sc/inc/recursionhelper.hxx index 23422d7c2a71..d91ee0cfbe58 100644 --- a/sc/inc/recursionhelper.hxx +++ b/sc/inc/recursionhelper.hxx @@ -59,6 +59,7 @@ class ScRecursionHelper bool bDoingRecursion; bool bInIterationReturn; bool bConverging; + std::vector< ScFormulaCell* > aTemporaryGroupCells; void Init(); void ResetIteration(); @@ -107,6 +108,9 @@ public: bool PushFormulaGroup(ScFormulaCell* pCell); void PopFormulaGroup(); bool AnyParentFGInCycle(); + + void AddTemporaryGroupCell(ScFormulaCell* cell); + void CleanTemporaryGroupCells(); }; /** A class to wrap ScRecursionHelper::PushFormulaGroup(), |