Kaydet (Commit) 44b2e2f6 authored tarafından yangzhang's avatar yangzhang Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: implemented ATAN

AMLOEXT-144 FIX

Change-Id: Ib94a4fbdcdf928c9a943d5b57449e7335d82b016
Refactoring: fix compile warnning in op_statistical.cxx
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 84901d03
......@@ -1168,6 +1168,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
mvSubArguments.push_back(SoPHelper(ts,
ft->Children[i], new OpArcSinHyp));
break;
case ocArcTan:
mvSubArguments.push_back(SoPHelper(ts,
ft->Children[i], new OpArcTan));
break;
case ocExternal:
if ( !(pChild->GetExternal().compareTo(OUString(
"com.sun.star.sheet.addin.Analysis.getEffect"))))
......
......@@ -514,6 +514,33 @@ void OpArcSinHyp::GenSlidingWindowFunction(std::stringstream &ss,
ss << " return asinh(tmp);\n";
ss << "}";
}
void OpArcTan::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 atan(tmp);\n";
ss << "}";
}
}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -132,6 +132,13 @@ public:
virtual std::string GetBottom(void) { return "0.0"; }
virtual std::string BinFuncName(void) const { return "ScASinH"; }
};
class OpArcTan: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 "ScATan"; }
};
}}
#endif
......
......@@ -939,6 +939,7 @@ void OpCritBinom::BinInlineFun(std::set<std::string>& decls,
std::set<std::string>& funs)
{
decls.insert(MinDecl);
funs.insert("");
}
void OpCritBinom::GenSlidingWindowFunction(std::stringstream& ss,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment