diff options
author | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-25 01:13:44 -0600 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-25 01:19:45 -0600 |
commit | 7e3d93e763770c7759555cfe7441573a97d276c1 (patch) | |
tree | 41f38b52ae3af23cafc72553d04dbb53df803091 | |
parent | 382ceea544b612b20946c8bf8a85e8abed7b4c60 (diff) |
GPU Calc: fixed a SUMPRODUCT problem
ALMOEXT-245
Change-Id: Iedbbdc612232a939b2270e373313c872de831c20
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 340545977b95..bee159bf3adc 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1103,10 +1103,30 @@ public: ss << "for(int outLoop=0; outLoop<" << nCurWindowSize/outLoopSize<< "; outLoop++){\n\t"; for(int count=0; count < outLoopSize; count++){ - ss << "i = outLoop*"<<outLoopSize<<"+"<<count<<";\n\t"; + ss << "i = outLoop*"<<outLoopSize<<"+"<<count<<";\n"; if(count==0){ - temp3 << "currentCount0 = i+gid0+1;\n\t"; - temp3 << "currentCount1 = i+1;\n\t"; + for (unsigned i = 0; i < vSubArguments.size(); i++) + { + tmpCur = vSubArguments[i]->GetFormulaToken(); + if(ocPush==tmpCur->GetOpCode()) + { + pCurDVR= dynamic_cast< + const formula::DoubleVectorRefToken *>(tmpCur); + if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) + { + temp3 << " currentCount"; + temp3 << i; + temp3 <<" =i+gid0+1;\n"; + } + else + { + temp3 << " currentCount"; + temp3 << i; + temp3 << " =i+1;\n"; + } + } + } + temp3 << "tmp = fsum("; for (unsigned i = 0; i < vSubArguments.size(); i++){ if (i) @@ -1149,10 +1169,30 @@ public: for(unsigned int count=nCurWindowSize/outLoopSize*outLoopSize; count < nCurWindowSize; count++) { - ss << "i =" <<count<<";\n\t"; + ss << "i =" <<count<<";\n"; if(count==nCurWindowSize/outLoopSize*outLoopSize){ - temp4 << "currentCount0 = i+gid0+1;\n\t"; - temp4 << "currentCount1 = i+1;\n\t"; + for (unsigned i = 0; i < vSubArguments.size(); i++) + { + tmpCur = vSubArguments[i]->GetFormulaToken(); + if(ocPush==tmpCur->GetOpCode()) + { + pCurDVR= dynamic_cast< + const formula::DoubleVectorRefToken *>(tmpCur); + if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) + { + temp4 << " currentCount"; + temp4 << i; + temp4 <<" =i+gid0+1;\n"; + } + else + { + temp4 << " currentCount"; + temp4 << i; + temp4 << " =i+1;\n"; + } + } + } + temp4 << "tmp = fsum("; for (unsigned i = 0; i < vSubArguments.size(); i++) { |