diff options
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/opencl/op_math.cxx | 20 | ||||
-rw-r--r-- | sc/source/core/opencl/op_math.hxx | 8 |
3 files changed, 32 insertions, 0 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 3264cf4c41d0..9c16ab77f13b 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -2591,6 +2591,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( mvSubArguments.push_back(SoPHelper(ts, ft->Children[i], new OpSumIf)); break; + case ocNegSub: + mvSubArguments.push_back(SoPHelper(ts, + ft->Children[i], new OpNegSub)); + break; case ocExternal: if ( !(pChild->GetExternal().compareTo(OUString( "com.sun.star.sheet.addin.Analysis.getEffect")))) diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index 4e1e5f182fa5..7db54626f54f 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -1793,6 +1793,26 @@ void OpInt::GenSlidingWindowFunction(std::stringstream &ss, ss << " return tmp;\n"; ss << "}"; } +void OpNegSub::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{\n"; + ss << " int gid0=get_global_id(0);\n"; + ss << " int singleIndex = gid0;\n"; + GenTmpVariables(ss,vSubArguments); + CheckAllSubArgumentIsNan(ss,vSubArguments); + ss << " return -tmp0;\n"; + ss << "}"; +} + void OpRadians::GenSlidingWindowFunction(std::stringstream &ss, const std::string sSymName, SubArguments &vSubArguments) { diff --git a/sc/source/core/opencl/op_math.hxx b/sc/source/core/opencl/op_math.hxx index 5864161110d2..80b3a8ebbabd 100644 --- a/sc/source/core/opencl/op_math.hxx +++ b/sc/source/core/opencl/op_math.hxx @@ -485,6 +485,14 @@ public: const std::string sSymName, SubArguments &vSubArguments); virtual std::string BinFuncName(void) const { return "Quotient"; } }; +class OpNegSub: public CheckVariables +{ +public: + virtual void GenSlidingWindowFunction(std::stringstream &ss, + const std::string sSymName, SubArguments &vSubArguments); + virtual std::string BinFuncName(void) const { return "NegSub"; } +}; + }} #endif |