summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-11-28 16:33:02 +0100
committerLuboš Luňák <l.lunak@collabora.com>2018-12-03 15:33:18 +0100
commita0b059a37e775a466c6fb0043335aae4d3e93fbf (patch)
tree337a9e040062e386933f6e448e1c11389bc84bfd
parent99014ec9ded70a679220fe59e09ab4073512c249 (diff)
make OpenCL SUM() treat empty cells properly
The data vector may not have all values (if last cells are empty). In that case GetRefRowSize() is larger than GetArrayLength(). Other cases in this function had a similar check, this one was missing it for some reason (with the 'gid0' removed, since it's a fixed position). Change-Id: I01692b51d6ed22ee6db419508cacf556fb9e644d Reviewed-on: https://gerrit.libreoffice.org/64237 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 4db3fb4ebe11..2501dd8d3916 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1073,9 +1073,12 @@ public:
ss << "i = outLoop*" << outLoopSize << "+" << count << ";\n\t";
if (count == 0)
{
+ temp1 << "if(i < " << mpDVR->GetArrayLength();
+ temp1 << "){\n\t\t";
temp1 << "tmp = legalize(";
temp1 << mpCodeGen->Gen2(GenSlidingWindowDeclRef(), "tmp");
temp1 << ", tmp);\n\t\t\t";
+ temp1 << "}\n\t";
}
ss << temp1.str();
}
@@ -1087,9 +1090,12 @@ public:
ss << "i = " << count << ";\n\t";
if (count == nCurWindowSize / outLoopSize * outLoopSize)
{
+ temp2 << "if(i < " << mpDVR->GetArrayLength();
+ temp2 << "){\n\t\t";
temp2 << "tmp = legalize(";
temp2 << mpCodeGen->Gen2(GenSlidingWindowDeclRef(), "tmp");
temp2 << ", tmp);\n\t\t\t";
+ temp2 << "}\n\t";
}
ss << temp2.str();
}