[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 3 14:36:23 UTC 2018


 sc/source/core/opencl/formulagroupcl.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 27f27e107730cc2242df578fd3e6dbb1a7117066
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Thu Nov 29 13:19:36 2018 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Dec 3 15:36:00 2018 +0100

    restore incorrectly removed code
    
    149a4d7566 removed NeedParallelReduction() even though the code should
    be there. I'm not sure about GenSlidingWindowFunction(), since the base
    class is a template, but better revert that one too.
    Also revert that part of 73e6a7975b that removed the subsequently
    no longer used functions.
    
    Change-Id: I932ffd58f9528ec840c4575078f8356640eb5420
    Reviewed-on: https://gerrit.libreoffice.org/64249
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 2501dd8d3916..247422e1b80a 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -967,6 +967,17 @@ public:
         bIsEndFixed = mpDVR->IsEndFixed();
     }
 
+    // Should only be called by SumIfs. Yikes!
+    virtual bool NeedParallelReduction() const
+    {
+        assert(dynamic_cast<OpSumIfs*>(mpCodeGen.get()));
+        return GetWindowSize() > 100 &&
+               ((GetStartFixed() && GetEndFixed()) ||
+            (!GetStartFixed() && !GetEndFixed()));
+    }
+
+    virtual void GenSlidingWindowFunction( std::stringstream& ) { }
+
     std::string GenSlidingWindowDeclRef( bool nested = false ) const
     {
         size_t nArrayLength = mpDVR->GetArrayLength();
@@ -1108,6 +1119,12 @@ public:
 
     size_t GetArrayLength() const { return mpDVR->GetArrayLength(); }
 
+    size_t GetWindowSize() const { return mpDVR->GetRefRowSize(); }
+
+    size_t GetStartFixed() const { return bIsStartFixed; }
+
+    size_t GetEndFixed() const { return bIsEndFixed; }
+
 protected:
     bool bIsStartFixed, bIsEndFixed;
     const formula::DoubleVectorRefToken* mpDVR;


More information about the Libreoffice-commits mailing list