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

GPU Calc: implemented ACOTH

AMLOEXT-129 FIX

Change-Id: I1f05ddc3a0187db33e4b9a618560ddf5ecc8aae3
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst fd911a92
...@@ -1156,6 +1156,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( ...@@ -1156,6 +1156,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
mvSubArguments.push_back(SoPHelper(ts, mvSubArguments.push_back(SoPHelper(ts,
ft->Children[i], new OpCritBinom)); ft->Children[i], new OpCritBinom));
break; break;
case ocArcCotHyp:
mvSubArguments.push_back(SoPHelper(ts,
ft->Children[i], new OpArcCotHyp));
break;
case ocExternal: case ocExternal:
if ( !(pChild->GetExternal().compareTo(OUString( if ( !(pChild->GetExternal().compareTo(OUString(
"com.sun.star.sheet.addin.Analysis.getEffect")))) "com.sun.star.sheet.addin.Analysis.getEffect"))))
......
...@@ -433,7 +433,33 @@ void OpArcCot::GenSlidingWindowFunction(std::stringstream &ss, ...@@ -433,7 +433,33 @@ void OpArcCot::GenSlidingWindowFunction(std::stringstream &ss,
ss << " return M_PI_2 - atan(tmp);\n"; ss << " return M_PI_2 - atan(tmp);\n";
ss << "}"; ss << "}";
} }
void OpArcCotHyp::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 0.5 * log((tmp + 1.0) / (tmp - 1.0));\n";
ss << "}";
}
}} }}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -111,6 +111,13 @@ public: ...@@ -111,6 +111,13 @@ public:
virtual std::string GetBottom(void) { return "0.0"; } virtual std::string GetBottom(void) { return "0.0"; }
virtual std::string BinFuncName(void) const { return "ScACot"; } virtual std::string BinFuncName(void) const { return "ScACot"; }
}; };
class OpArcCotHyp:public Normal{
public:
virtual void GenSlidingWindowFunction(std::stringstream &ss,
const std::string sSymName, SubArguments &vSubArguments);
virtual std::string GetBottom(void) { return "2.0"; }
virtual std::string BinFuncName(void) const { return "ScACotH"; }
};
}} }}
#endif #endif
......
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