Kaydet (Commit) b9b4e6cb authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Andras Timar

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: 's avatarMichael Meeks <michael.meeks@collabora.com>
(cherry picked from commit b76c450e)
üst 4c4d4c00
...@@ -1734,13 +1734,8 @@ public: ...@@ -1734,13 +1734,8 @@ public:
assert(pCur); assert(pCur);
assert(pCur->GetType() != formula::svDoubleVectorRef); assert(pCur->GetType() != formula::svDoubleVectorRef);
if (pCur->GetType() == formula::svSingleVectorRef) if (pCur->GetType() == formula::svSingleVectorRef ||
{ pCur->GetType() == formula::svDouble)
const formula::SingleVectorRefToken* pSVR =
static_cast<const formula::SingleVectorRefToken*>(pCur);
ss << "if (gid0 < " << pSVR->GetArrayLength() << "){\n";
}
else if (pCur->GetType() == formula::svDouble)
{ {
ss << "{\n"; ss << "{\n";
} }
...@@ -1771,13 +1766,6 @@ public: ...@@ -1771,13 +1766,6 @@ public:
ss << ";\n"; ss << ";\n";
ss << " }\n"; ss << " }\n";
ss << "}\n"; ss << "}\n";
if (vSubArguments[i]->GetFormulaToken()->GetType() ==
formula::svSingleVectorRef && ZeroReturnZero())
{
ss << "else{\n";
ss << " return 0;\n";
ss << " }\n";
}
} }
else else
{ {
......
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