diff options
author | yangzhang <yangzhang@multicorewareinc.com> | 2013-12-20 14:04:34 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-23 16:51:32 -0600 |
commit | 3eb75fa4d7f0c7c87cc0b20a0a246c956ae8816a (patch) | |
tree | 0e9a4c3e19c03900c816258fa45557b9c801a97e /sc/source/core/opencl | |
parent | f48749354f018ef41b135bad0d433d94778accd5 (diff) |
GPU Calc: Optimized ASIN
AMLOEXT-269
Change-Id: I10d33b50f743630ed91daa743017e431754e5659
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/source/core/opencl')
-rw-r--r-- | sc/source/core/opencl/op_math.cxx | 8 | ||||
-rw-r--r-- | sc/source/core/opencl/op_math.hxx | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index 85fdfa1177c5..f0ed0b10de91 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -1325,6 +1325,12 @@ void OpArcCotHyp::GenSlidingWindowFunction(std::stringstream &ss, ss << " return 0.5 * log(1 + 2 * pown(arg0 - 1.0, -1));\n"; ss << "}"; } +void OpArcSin::BinInlineFun(std::set<std::string>& decls, + std::set<std::string>& funs) +{ + decls.insert(atan2Decl); + funs.insert(atan2Content); +} void OpArcSin::GenSlidingWindowFunction(std::stringstream &ss, const std::string sSymName, SubArguments &vSubArguments) { @@ -1349,7 +1355,7 @@ void OpArcSin::GenSlidingWindowFunction(std::stringstream &ss, ss << " else \n "; #endif ss << " tmp = " << vSubArguments[0]->GenSlidingWindowDeclRef() << ";\n"; - ss << " return asin(tmp);\n"; + ss << " return arctan2(tmp, sqrt(1.0 - pow(tmp, 2)));\n"; ss << "}"; } void OpArcSinHyp::GenSlidingWindowFunction(std::stringstream &ss, diff --git a/sc/source/core/opencl/op_math.hxx b/sc/source/core/opencl/op_math.hxx index a174bef0da61..e10dfa127340 100644 --- a/sc/source/core/opencl/op_math.hxx +++ b/sc/source/core/opencl/op_math.hxx @@ -153,6 +153,7 @@ public: const std::string sSymName, SubArguments &vSubArguments); virtual std::string GetBottom(void) { return "0.0"; } virtual std::string BinFuncName(void) const { return "ScASin"; } + virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>&); }; class OpArcSinHyp:public Normal{ public: |