diff options
author | haochen <haochen@multicorewarein.com> | 2014-05-31 14:28:22 +0800 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-06-10 15:58:27 +0200 |
commit | 7cfc80cb1663c1f4b4e813ab90c95fae01d1afc1 (patch) | |
tree | cf52723c86dab063a16835a4a31c6fcf4ade301f | |
parent | c0ea62fcb7f2bd809eea0fd45fb71e31ffba871a (diff) |
GPU Calc:Support default 2nd parameter in ROUND
Change-Id: I003ba9c945dbc3c6417d0502902610c0eaff2bda
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/opencl/op_math.cxx | 14 |
2 files changed, 13 insertions, 5 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 9b45c9124d60..5f6b4ff8784d 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1487,7 +1487,9 @@ public: #ifdef UNROLLING_FACTOR ss << "\tint i;\n\t"; - ss << "int currentCount0, currentCount1;\n\t"; + ss << "int currentCount0;\n"; + for ( unsigned i = 0; i < vSubArguments.size()-1; i++) + ss << "int currentCount"<<i+1<<";\n"; std::stringstream temp3,temp4; int outLoopSize = UNROLLING_FACTOR; if (nCurWindowSize/outLoopSize != 0){ diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index 36c94f62a099..555da5926e9f 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -1707,11 +1707,17 @@ void OpRound::GenSlidingWindowFunction(std::stringstream &ss, ss << " int singleIndex = gid0;\n"; GenTmpVariables(ss,vSubArguments); CheckAllSubArgumentIsNan(ss,vSubArguments); - ss << " for(int i=0;i<tmp1;i++)\n"; - ss << " tmp0 = tmp0 * 10;\n"; + if(vSubArguments.size() ==2) + { + ss << " for(int i=0;i<tmp1;i++)\n"; + ss << " tmp0 = tmp0 * 10;\n"; + } ss << " double tmp=round(tmp0);\n"; - ss << " for(int i=0;i<tmp1;i++)\n"; - ss << " tmp = tmp / 10;\n"; + if(vSubArguments.size() ==2) + { + ss << " for(int i=0;i<tmp1;i++)\n"; + ss << " tmp = tmp / 10;\n"; + } ss << " return tmp;\n"; ss << "}"; } |