diff options
author | tianyao <tianyao@multicorewareinc.com> | 2013-11-09 12:25:38 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 14:09:49 -0600 |
commit | 7ccd1f328b95a42f2b6d9ea43c6b8bf4aaa25233 (patch) | |
tree | 11a9f02107ec0df33ddfd65905b76a4cd907d148 /sc/source/core/opencl/op_math.cxx | |
parent | GPU Calc: unit test cases for CSCH (diff) | |
download | core-7ccd1f328b95a42f2b6d9ea43c6b8bf4aaa25233.tar.gz core-7ccd1f328b95a42f2b6d9ea43c6b8bf4aaa25233.zip |
GPU Calc: implemented EXP
AMLOEXT-165 FIX
Change-Id: I73693ecab752d48f620bc0cd53e29d9a8fe16c93
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/source/core/opencl/op_math.cxx')
-rw-r--r-- | sc/source/core/opencl/op_math.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index 5b6857b240af..9934014bdae2 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -260,6 +260,34 @@ void OpCscH::GenSlidingWindowFunction( ss << "return tmp;\n"; ss << "}"; } +void OpExp::GenSlidingWindowFunction(std::stringstream &ss, + const std::string sSymName, SubArguments &vSubArguments) +{ + FormulaToken *tmpCur = vSubArguments[0]->GetFormulaToken(); + const formula::SingleVectorRefToken*tmpCurDVR= dynamic_cast<const + formula::SingleVectorRefToken *>(tmpCur); + ss << "\ndouble " << sSymName; + ss << "_"<< BinFuncName() <<"("; + for (unsigned i = 0; i < vSubArguments.size(); i++) + { + if (i) + ss << ","; + vSubArguments[i]->GenSlidingWindowDecl(ss); + } + ss << ")\n{\n\t"; + ss <<"int gid0=get_global_id(0);\n\t"; + ss << "double arg0 = " << vSubArguments[0]->GenSlidingWindowDeclRef(); + ss << ";\n\t"; +#ifdef ISNAN + ss<< "if(isNan(arg0)||(gid0>="; + ss<<tmpCurDVR->GetArrayLength(); + ss<<"))\n\t\t"; + ss<<"arg0 = 0;\n\t"; +#endif + ss << "double tmp=exp(arg0);\n\t"; + ss << "return tmp;\n"; + ss << "}"; +} void OpSinh::GenSlidingWindowFunction(std::stringstream &ss, const std::string sSymName, SubArguments &vSubArguments) { |