diff options
author | haochen <haochen@multicorewarein.com> | 2014-05-31 14:28:22 +0800 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-06-17 08:12:00 +0200 |
commit | 848c76d5e3e9b477dbce735d8a0bd734cd5e389c (patch) | |
tree | 0b166c5ca0032467e9ebc9488fb91f05b42573a7 /sc | |
parent | 47a10f026622849ae22d1f559329520ba9fc197d (diff) |
GPU Calc:Support default 2nd parameter in ROUND
Change-Id: I003ba9c945dbc3c6417d0502902610c0eaff2bda
Diffstat (limited to 'sc')
-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 << "}"; } |