diff options
author | yangzhang <yangzhang@multicorewareinc.com> | 2013-12-20 14:07:56 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-23 16:51:32 -0600 |
commit | 99b93d898f2aff3198146c1e8aa44b9dfae177b9 (patch) | |
tree | 300927b0496e607f91057cbff09fa45b45d2c1e1 /sc | |
parent | 3eb75fa4d7f0c7c87cc0b20a0a246c956ae8816a (diff) |
GPU Calc: Optimized ACOS
AMLOEXT-270
Change-Id: I460354ede9a9666a7b5dcd7c5d125b605e3b3b2d
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')
-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 f0ed0b10de91..3f742f8f603a 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -1032,6 +1032,12 @@ void OpAbs::GenSlidingWindowFunction(std::stringstream &ss, ss << " return fabs(tmp);\n"; ss << "}"; } +void OpArcCos::BinInlineFun(std::set<std::string>& decls, + std::set<std::string>& funs) +{ + decls.insert(atan2Decl); + funs.insert(atan2Content); +} void OpArcCos::GenSlidingWindowFunction(std::stringstream &ss, const std::string sSymName, SubArguments &vSubArguments) { @@ -1057,7 +1063,7 @@ void OpArcCos::GenSlidingWindowFunction(std::stringstream &ss, #endif ss << " tmp = "; ss << vSubArguments[0]->GenSlidingWindowDeclRef()<< ";\n"; - ss << " return acos(tmp);\n"; + ss << " return arctan2(sqrt(1.0 - pow(tmp, 2)), tmp);\n"; ss << "}"; } void OpArcCosHyp::GenSlidingWindowFunction(std::stringstream &ss, diff --git a/sc/source/core/opencl/op_math.hxx b/sc/source/core/opencl/op_math.hxx index e10dfa127340..5864161110d2 100644 --- a/sc/source/core/opencl/op_math.hxx +++ b/sc/source/core/opencl/op_math.hxx @@ -101,6 +101,7 @@ public: const std::string sSymName, SubArguments &vSubArguments); virtual std::string GetBottom(void) { return "0.0"; } virtual std::string BinFuncName(void) const { return "ScACos"; } + virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>&); }; class OpArcCosHyp:public Normal{ public: |