[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter-4' - sc/source

I-Jui Sung (Ray) ray at multicorewareinc.com
Mon Nov 18 01:11:32 PST 2013


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

New commits:
commit 9a28c1537c8687b72a4e89b80ed18ea46d77757e
Author: I-Jui (Ray) Sung <ray at multicorewareinc.com>
Date:   Mon Nov 18 03:09:24 2013 -0600

    GPU Calc: re-enable parallel sum reduction after fixing regressions
    
    Change-Id: Id274575e731c413e8e9b808ae5e651efe10f7b03

diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 1594075..f6e6baf 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -405,6 +405,7 @@ protected:
 /// Handling a Double Vector that is used as a sliding window input
 /// to either a sliding window average or sum-of-products
 class OpSum; // Forward Declaration
+class OpAverage; // Forward Declaration
 template<class Base>
 class DynamicKernelSlidingArgument: public Base
 {
@@ -423,9 +424,13 @@ public:
     }
     virtual bool NeedParallelReduction(void) const
     {
-        return GetWindowSize()> 100 &&
-            ( (GetStartFixed() && GetEndFixed()) ||
-              (!GetStartFixed() && !GetEndFixed())  ) ;
+        if (dynamic_cast<OpSum*>(mpCodeGen.get())
+            && !dynamic_cast<OpAverage*>(mpCodeGen.get()))
+            return GetWindowSize()> 100 &&
+                ( (GetStartFixed() && GetEndFixed()) ||
+                  (!GetStartFixed() && !GetEndFixed())  ) ;
+        else
+            return false;
     }
     virtual void GenSlidingWindowFunction(std::stringstream &ss) {
         if (dynamic_cast<OpSum*>(mpCodeGen.get()) && NeedParallelReduction())
@@ -496,7 +501,7 @@ public:
             {
                 // set 100 as a temporary threshold for invoking reduction
                 // kernel in NeedParalleLReduction function
-                if (/*NeedParallelReduction()*/false)
+                if (NeedParallelReduction())
                 {
                     std::string temp = Base::GetName() + "[gid0]";
                     ss << "tmp = ";
@@ -511,7 +516,7 @@ public:
             {
                 // set 100 as a temporary threshold for invoking reduction
                 // kernel in NeedParalleLReduction function
-                if (NeedParallelReduction()&&false)
+                if (NeedParallelReduction())
                 {
                     std::string temp = Base::GetName() + "[0]";
                     ss << "tmp = ";
@@ -563,7 +568,7 @@ public:
 
     virtual size_t Marshal(cl_kernel k, int argno, int w, cl_program mpProgram)
     {
-        if (!NeedParallelReduction() || true)
+        if (!NeedParallelReduction())
             return Base::Marshal(k, argno, w, mpProgram);
 
         assert(Base::mpClmem == NULL);


More information about the Libreoffice-commits mailing list