summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-18 03:09:24 -0600
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-18 03:09:39 -0600
commitdc113e8a86e9904df8f37a2980db39cbabcea78f (patch)
tree97db07578bf0f535c06718f8d9f40b38603e0960
parent935f1f61cbe112b1cf1ab95bae9dfcb42b4fdb5e (diff)
GPU Calc: re-enable parallel sum reduction after fixing regressions
Change-Id: Id274575e731c413e8e9b808ae5e651efe10f7b03
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index d2a6d8b22e1f..a863c94c6635 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);