summaryrefslogtreecommitdiff
path: root/sc/source/core/opencl/formulagroupcl.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-02-08 01:25:23 +0200
committerTor Lillqvist <tml@collabora.com>2015-02-08 09:58:17 +0200
commit867cd1de71c774066e72fd30b4d6cde56c598d36 (patch)
treed9ce1d8dcfd4c3f983f56d7e331cbfa8cb7ddeaa /sc/source/core/opencl/formulagroupcl.cxx
parentdcee6c01206cedf035db175c481cc5fe378bee3f (diff)
Add one more case for string argument handling when attempting to use OpenCL
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: I40b64cf040c986cfc2b26a2a778711f3cd397186
Diffstat (limited to 'sc/source/core/opencl/formulagroupcl.cxx')
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx23
1 files changed, 21 insertions, 2 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 6bbe62e207bf..dad78eb25093 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -2573,14 +2573,29 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
pSVR->GetArray().mpStringArray &&
pCodeGen->takeString())
{
+ // Function takes numbers or strings, there are both
mvSubArguments.push_back(
DynamicKernelArgumentRef(new DynamicKernelMixedArgument(mCalcConfig,
ts, ft->Children[i])));
}
else if (pSVR->GetArray().mpNumericArray &&
pCodeGen->takeNumeric() &&
- (!pSVR->GetArray().mpStringArray || mCalcConfig.meStringConversion == ScCalcConfig::StringConversion::ZERO))
+ (pSVR->GetArray().mpStringArray == NULL || mCalcConfig.meStringConversion == ScCalcConfig::StringConversion::ZERO))
{
+ // Function takes numbers, and either there
+ // are no strings, or there are strings but
+ // they are to be treated as zero
+ mvSubArguments.push_back(
+ DynamicKernelArgumentRef(new VectorRef(mCalcConfig, ts,
+ ft->Children[i])));
+ }
+ else if (pSVR->GetArray().mpNumericArray == NULL &&
+ pCodeGen->takeNumeric() &&
+ pSVR->GetArray().mpStringArray &&
+ mCalcConfig.meStringConversion == ScCalcConfig::StringConversion::ZERO)
+ {
+ // Function takes numbers, and there are only
+ // strings, but they are to be treated as zero
mvSubArguments.push_back(
DynamicKernelArgumentRef(new VectorRef(mCalcConfig, ts,
ft->Children[i])));
@@ -2588,6 +2603,9 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
else if (pSVR->GetArray().mpStringArray &&
pCodeGen->takeString())
{
+ // There are strings, and the function takes
+ // strings.
+
mvSubArguments.push_back(
DynamicKernelArgumentRef(new DynamicKernelStringArgument(mCalcConfig,
ts, ft->Children[i])));
@@ -2595,7 +2613,8 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
else if (pSVR->GetArray().mpStringArray == NULL &&
pSVR->GetArray().mpNumericArray == NULL)
{
- // Push as an array of NANs
+ // There are only empty cells. Push as an
+ // array of NANs
mvSubArguments.push_back(
DynamicKernelArgumentRef(new VectorRef(mCalcConfig, ts,
ft->Children[i])));