diff options
author | yangzhang <yangzhang@multicorewareinc.com> | 2013-11-07 12:29:20 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-13 17:44:10 -0600 |
commit | 8a8c128a9ee711f701c7caa750f491324e64fe54 (patch) | |
tree | f9d295327cee52e1bf6d6e43b8843b0b39f7e50b /sc | |
parent | a07929c479200f9c600845d7078183581a5d23d7 (diff) |
GPU Calc: implemented ASINH
AMLOEXT-143 FIX
Change-Id: Ib6d408a18881252271718715de4fdbb9e6068c06
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/opencl/op_math.cxx | 27 | ||||
-rw-r--r-- | sc/source/core/opencl/op_math.hxx | 7 |
3 files changed, 38 insertions, 0 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index a2f49063995e..595b73308f23 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1164,6 +1164,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( mvSubArguments.push_back(SoPHelper(ts, ft->Children[i], new OpArcSin)); break; + case ocArcSinHyp: + mvSubArguments.push_back(SoPHelper(ts, + ft->Children[i], new OpArcSinHyp)); + break; case ocExternal: if ( !(pChild->GetExternal().compareTo(OUString( "com.sun.star.sheet.addin.Analysis.getEffect")))) diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index a532284eb670..43c659171fe6 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -487,6 +487,33 @@ void OpArcSin::GenSlidingWindowFunction(std::stringstream &ss, ss << " return asin(tmp);\n"; ss << "}"; } +void OpArcSinHyp::GenSlidingWindowFunction(std::stringstream &ss, + const std::string sSymName, SubArguments &vSubArguments) +{ + ss << "\ndouble " << sSymName; + ss << "_"<< BinFuncName() <<"("; + for (unsigned i = 0; i < vSubArguments.size(); i++) + { + if (i) ss << ","; + vSubArguments[i]->GenSlidingWindowDecl(ss); + } + ss << ") {\n"; + ss << " int gid0 = get_global_id(0);\n"; + ss << " double tmp = " << GetBottom() << ";\n"; +#ifdef ISNAN + FormulaToken *tmpCur0 = vSubArguments[0]->GetFormulaToken(); + const formula::SingleVectorRefToken*tmpCurDVR0= + dynamic_cast<const formula::SingleVectorRefToken *>(tmpCur0); + ss << " int buffer_len = " << tmpCurDVR0->GetArrayLength() << ";\n"; + ss << " if((gid0)>=buffer_len || isNan("; + ss << vSubArguments[0]->GenSlidingWindowDeclRef() << "))\n"; + ss << " tmp = " << GetBottom() << ";\n"; + ss << " else \n "; +#endif + ss << " tmp = " << vSubArguments[0]->GenSlidingWindowDeclRef() << ";\n"; + ss << " return asinh(tmp);\n"; + ss << "}"; +} }} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/opencl/op_math.hxx b/sc/source/core/opencl/op_math.hxx index 6bf1539f5d1a..9178415160e5 100644 --- a/sc/source/core/opencl/op_math.hxx +++ b/sc/source/core/opencl/op_math.hxx @@ -125,6 +125,13 @@ public: virtual std::string GetBottom(void) { return "0.0"; } virtual std::string BinFuncName(void) const { return "ScASin"; } }; +class OpArcSinHyp:public Normal{ +public: + virtual void GenSlidingWindowFunction(std::stringstream &ss, + const std::string sSymName, SubArguments &vSubArguments); + virtual std::string GetBottom(void) { return "0.0"; } + virtual std::string BinFuncName(void) const { return "ScASinH"; } +}; }} #endif |