[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter-4' - sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Wed Oct 30 00:08:57 CET 2013
sc/source/core/opencl/formulagroupcl.cxx | 15 +++++++++------
sc/source/core/opencl/opbase.cxx | 11 +++++++----
2 files changed, 16 insertions(+), 10 deletions(-)
New commits:
commit bb1a1054fae950f7cc164251b5ca61b63b5817f5
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Tue Oct 29 19:09:46 2013 -0400
More C++11 specific features we aren't supposed to be using...
* No 'auto'.
* No std::unique_ptr.
Change-Id: Iaceab28b9ad0b515bf77db2767018573c8de61de
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 1dd7c89..fb37ed6 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -661,7 +661,8 @@ template<class Op>
class DynamicKernelSoPArguments: public DynamicKernelArgument
{
public:
- typedef std::unique_ptr<DynamicKernelArgument> SubArgument;
+ typedef boost::shared_ptr<DynamicKernelArgument> SubArgument;
+ typedef std::vector<SubArgument> SubArgumentsType;
DynamicKernelSoPArguments(const std::string &s,
boost::shared_ptr<FormulaTreeNode> ft);
@@ -670,8 +671,9 @@ public:
virtual size_t Marshal(cl_kernel k, int argno, int nVectorWidth)
{
unsigned i = 0;
- for(auto it = mvSubArguments.begin(), e= mvSubArguments.end(); it!=e;
- ++it) {
+ for (SubArgumentsType::iterator it = mvSubArguments.begin(), e= mvSubArguments.end(); it!=e;
+ ++it)
+ {
i += (*it)->Marshal(k, argno + i, nVectorWidth);
}
return i;
@@ -716,8 +718,9 @@ public:
/// When declared as input to a sliding window function
virtual void GenSlidingWindowDecl(std::stringstream &ss) const
{
- for(auto it = mvSubArguments.begin(), e= mvSubArguments.end(); it!=e;
- ++it) {
+ for (SubArgumentsType::const_iterator it = mvSubArguments.begin(), e= mvSubArguments.end(); it!=e;
+ ++it)
+ {
if (it != mvSubArguments.begin())
ss << ", ";
(*it)->GenSlidingWindowDecl(ss);
@@ -757,7 +760,7 @@ public:
return t;
}
private:
- std::vector<SubArgument> mvSubArguments;
+ SubArgumentsType mvSubArguments;
Op CodeGen;
};
diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx
index e7eae13..ec59e7a 100644
--- a/sc/source/core/opencl/opbase.cxx
+++ b/sc/source/core/opencl/opbase.cxx
@@ -65,15 +65,18 @@ size_t DynamicKernelArgument::GetWindowSize(void) const
{
FormulaToken *pCur = mFormulaTree->GetFormulaToken();
assert(pCur);
- if (auto *pCurDVR =
- dynamic_cast<const formula::DoubleVectorRefToken *>(pCur))
+ if (const formula::DoubleVectorRefToken* pCurDVR =
+ dynamic_cast<const formula::DoubleVectorRefToken *>(pCur))
{
return pCurDVR->GetRefRowSize();
- } else if (dynamic_cast<const formula::SingleVectorRefToken *>(pCur))
+ }
+ else if (dynamic_cast<const formula::SingleVectorRefToken *>(pCur))
{
// Prepare intermediate results (on CPU for now)
return 1;
- } else {
+ }
+ else
+ {
throw Unhandled();
}
return 0;
More information about the Libreoffice-commits
mailing list