diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-02-07 15:38:55 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-02-10 20:47:41 +0000 |
commit | 736ee69868d2e98ea62c16e512ace3b080c5dd8f (patch) | |
tree | c0f2e7052dbef02093e9329f351aeb328008332b /sc/inc | |
parent | 6490772ace0f8e30923952c8c01d6c9baa755085 (diff) |
Handle (or not) string arguments better when using OpenCL for math ops
This is a combination of four commits from master.
9429cf24675ae6b3a954db560ca567c9413d0ab6: We need ScCalcConfig also for formula groups
The settings for interpretation of text (string) cells as numbers affect
whether OpenCL can be used or not to get expected results, when operating on
vectors that contain also text cells.
6dd1025ccf2bcbd2035ab141054950263c638747: Add ScCalcConfig field to DynamicKernelArgument
It is needed to be able to adapt OpenCL code generation to the text-to-number
conversion settings.
To get the document-specific ScCalcConfig into the DynamicKernelArgument, we
have to pass it along in lots of places to constructors of various
DynamicKernelArgument subclasses. Originally it comes from the maCalcConfig
field of FormulaGroupInterpreterOpenCL, inherited from
FormulaGroupInterpreter.
dcee6c01206cedf035db175c481cc5fe378bee3f: If a function/operator that takes
numeric arguments but not string arguments is passed string arguments anyway,
handle that with OpenCL only if the (document-specific!) setting for text-to
number conversion is ZERO (treat strings as zero, which is how our OpenCL code
for such functions/operators works). Otherwise let the code fall back to the
traditional interpreter.
867cd1de71c774066e72fd30b4d6cde56c598d36: If a function takes numeric
arguments but there are only string arguments, but the settings say strings
are to be treated as zero anyway, we can go the OpenCL path.
Also add a few informative comments.
Change-Id: I2c5769c4ae157561c0a3b267d8e1c92795963732
Reviewed-on: https://gerrit.libreoffice.org/14405
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/formulagroup.hxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx index 9ac93353bb92..8ce3ef5367d3 100644 --- a/sc/inc/formulagroup.hxx +++ b/sc/inc/formulagroup.hxx @@ -13,6 +13,7 @@ #include <config_features.h> #include "address.hxx" +#include "calcconfig.hxx" #include "types.hxx" #include "stlalgorithm.hxx" @@ -120,11 +121,17 @@ public: class SC_DLLPUBLIC FormulaGroupInterpreter { static FormulaGroupInterpreter *msInstance; - protected: + +protected: + ScCalcConfig maCalcConfig; + FormulaGroupInterpreter() {} virtual ~FormulaGroupInterpreter() {} - public: + /// Merge global and document specific settings. + void MergeCalcConfig(const ScDocument& rDoc); + +public: static FormulaGroupInterpreter *getStatic(); #if HAVE_FEATURE_OPENCL static void fillOpenCLInfo(std::vector<OpenCLPlatformInfo>& rPlatforms); |