summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-10-14 21:14:04 +0300
committerMichael Meeks <michael.meeks@collabora.com>2015-10-16 11:31:55 +0100
commitb76c450eb7f6517fae24a0d7ea6431663959adf3 (patch)
tree75cbf0ca44bda11209bb33dec4bed23bb7bdd7d1
parent9a75c72495ed6014d6c84fdead14bef68ea32858 (diff)
tdf#94924: Fix handling of empty cells in OpenCL subtraction
We get correct result by simplifying the code;) No need to have the outer "if (gid0 < X)" test around the calculation code generated by Reduction::GenSlidingWindowFunction(). The lhs and rhs check the gid0 range themselves and that leads to the desired result for subtraction. While fixing this I noticed that the handling of empty cells in division is also wrong. Will fix in another commit. Change-Id: Ia45bd81e692a17b0453cc79cd4673a00e119562a Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx16
1 files changed, 2 insertions, 14 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index e5324cd07e14..255a546483ac 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1734,13 +1734,8 @@ public:
assert(pCur);
assert(pCur->GetType() != formula::svDoubleVectorRef);
- if (pCur->GetType() == formula::svSingleVectorRef)
- {
- const formula::SingleVectorRefToken* pSVR =
- static_cast<const formula::SingleVectorRefToken*>(pCur);
- ss << "if (gid0 < " << pSVR->GetArrayLength() << "){\n";
- }
- else if (pCur->GetType() == formula::svDouble)
+ if (pCur->GetType() == formula::svSingleVectorRef ||
+ pCur->GetType() == formula::svDouble)
{
ss << "{\n";
}
@@ -1771,13 +1766,6 @@ public:
ss << ";\n";
ss << " }\n";
ss << "}\n";
- if (vSubArguments[i]->GetFormulaToken()->GetType() ==
- formula::svSingleVectorRef && ZeroReturnZero())
- {
- ss << "else{\n";
- ss << " return 0;\n";
- ss << " }\n";
- }
}
else
{