Kaydet (Commit) b76c450e authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Michael Meeks

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>
üst 9a75c724
......@@ -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
{
......
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