diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-19 16:04:15 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-19 16:04:55 -0500 |
commit | 10d1eb5e933a6e37411e618cd89fa8c0a72b941b (patch) | |
tree | 6f3003bb0f64fddd835c5140c803dce6cecb6c4f | |
parent | afbbbe91854cebf84865623d1a62712285241bde (diff) |
Let's just have one typedef and use it across the board.
Change-Id: Iadfbeb5b97673a8812c90411ff2e49324347ee24
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 36 | ||||
-rw-r--r-- | sc/source/core/opencl/opbase.hxx | 5 |
2 files changed, 20 insertions, 21 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 870522489797..e1abb1dc79e5 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -877,10 +877,9 @@ protected: class SymbolTable { public: - typedef std::map<const formula::FormulaToken*, - boost::shared_ptr<DynamicKernelArgument> > ArgumentMap; + typedef std::map<const formula::FormulaToken*, DynamicKernelArgumentRef> ArgumentMap; // This avoids instability caused by using pointer as the key type - typedef std::list<boost::shared_ptr<DynamicKernelArgument> > ArgumentList; + typedef std::list<DynamicKernelArgumentRef> ArgumentList; SymbolTable() : mCurId(0) { } template<class T> const DynamicKernelArgument* DeclRefArg( FormulaTreeNodeRef, SlidingFunctionBase* pCodeGen, int nResultSize ); @@ -1935,9 +1934,8 @@ struct SumIfsArgs /// Helper functions that have multiple buffers class DynamicKernelSoPArguments : public DynamicKernelArgument { - typedef boost::shared_ptr<DynamicKernelArgument> SubArgument; public: - typedef std::vector<SubArgument> SubArgumentsType; + typedef std::vector<DynamicKernelArgumentRef> SubArgumentsType; DynamicKernelSoPArguments( const std::string& s, const FormulaTreeNodeRef& ft, @@ -2204,11 +2202,11 @@ private: cl_mem mpClmem2; }; -boost::shared_ptr<DynamicKernelArgument> SoPHelper( +DynamicKernelArgumentRef SoPHelper( const std::string& ts, const FormulaTreeNodeRef& ft, SlidingFunctionBase* pCodeGen, int nResultSize ) { - return boost::shared_ptr<DynamicKernelArgument>(new DynamicKernelSoPArguments(ts, ft, pCodeGen, nResultSize)); + return DynamicKernelArgumentRef(new DynamicKernelSoPArguments(ts, ft, pCodeGen, nResultSize)); } template<class Base> @@ -2297,20 +2295,20 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( pCodeGen->takeString()) { mvSubArguments.push_back( - SubArgument( + DynamicKernelArgumentRef( new DynamicKernelMixedSlidingArgument( ts, ft->Children[i], mpCodeGen, j))); } else { mvSubArguments.push_back( - SubArgument(VectorRefFactory<VectorRef>( + DynamicKernelArgumentRef(VectorRefFactory<VectorRef>( ts, ft->Children[i], mpCodeGen, j))); } } else mvSubArguments.push_back( - SubArgument(VectorRefFactory + DynamicKernelArgumentRef(VectorRefFactory <DynamicKernelStringArgument>( ts, ft->Children[i], mpCodeGen, j))); } @@ -2325,21 +2323,21 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( pCodeGen->takeString()) { mvSubArguments.push_back( - SubArgument(new DynamicKernelMixedArgument( + DynamicKernelArgumentRef(new DynamicKernelMixedArgument( ts, ft->Children[i]))); } else if (pSVR->GetArray().mpNumericArray && pCodeGen->takeNumeric()) { mvSubArguments.push_back( - SubArgument(new VectorRef(ts, + DynamicKernelArgumentRef(new VectorRef(ts, ft->Children[i]))); } else if (pSVR->GetArray().mpStringArray && pCodeGen->takeString()) { mvSubArguments.push_back( - SubArgument(new DynamicKernelStringArgument( + DynamicKernelArgumentRef(new DynamicKernelStringArgument( ts, ft->Children[i]))); } else if (pSVR->GetArray().mpStringArray == NULL && @@ -2347,7 +2345,7 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( { // Push as an array of NANs mvSubArguments.push_back( - SubArgument(new VectorRef(ts, + DynamicKernelArgumentRef(new VectorRef(ts, ft->Children[i]))); } else @@ -2357,14 +2355,14 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( else if (pChild->GetType() == formula::svDouble) { mvSubArguments.push_back( - SubArgument(new DynamicKernelConstantArgument(ts, + DynamicKernelArgumentRef(new DynamicKernelConstantArgument(ts, ft->Children[i]))); } else if (pChild->GetType() == formula::svString && pCodeGen->takeString()) { mvSubArguments.push_back( - SubArgument(new ConstStringArgument(ts, + DynamicKernelArgumentRef(new ConstStringArgument(ts, ft->Children[i]))); } else @@ -2845,12 +2843,12 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( break; case ocPi: mvSubArguments.push_back( - SubArgument(new DynamicKernelPiArgument(ts, + DynamicKernelArgumentRef(new DynamicKernelPiArgument(ts, ft->Children[i]))); break; case ocRandom: mvSubArguments.push_back( - SubArgument(new DynamicKernelRandomArgument(ts, + DynamicKernelArgumentRef(new DynamicKernelRandomArgument(ts, ft->Children[i]))); break; case ocProduct: @@ -3576,7 +3574,7 @@ const DynamicKernelArgument* SymbolTable::DeclRefArg( // Allocate new symbols std::stringstream ss; ss << "tmp" << mCurId++; - boost::shared_ptr<DynamicKernelArgument> new_arg(new T(ss.str(), t, pCodeGen, nResultSize)); + DynamicKernelArgumentRef new_arg(new T(ss.str(), t, pCodeGen, nResultSize)); mSymbols[ref] = new_arg; mParams.push_back(new_arg); return new_arg.get(); diff --git a/sc/source/core/opencl/opbase.hxx b/sc/source/core/opencl/opbase.hxx index 7d6cc1dfb04a..2568b14ce447 100644 --- a/sc/source/core/opencl/opbase.hxx +++ b/sc/source/core/opencl/opbase.hxx @@ -129,6 +129,8 @@ protected: FormulaTreeNodeRef mFormulaTree; }; +typedef boost::shared_ptr<DynamicKernelArgument> DynamicKernelArgumentRef; + /// Holds an input (read-only) argument reference to a SingleVectorRef. /// or a DoubleVectorRef for non-sliding-window argument of complex functions /// like SumOfProduct @@ -189,9 +191,8 @@ public: class SlidingFunctionBase : public OpBase { - typedef boost::shared_ptr<DynamicKernelArgument> SubArgument; public: - typedef std::vector<SubArgument> SubArguments; + typedef std::vector<DynamicKernelArgumentRef> SubArguments; virtual void GenSlidingWindowFunction( std::stringstream&, const std::string&, SubArguments& ) = 0; virtual ~SlidingFunctionBase() { } |