Kaydet (Commit) 6dd1025c authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Add ScCalcConfig field to DynamicKernelArgument

It will be needed to be able to adapt OpenCL code generation to the
text-to-number conversion settings.

To get the document-specific ScCalcConfig into the DynamicKernelArgument, we
have to pass it along in lots of places to constructors of various
DynamicKernelArgument subclasses. Originally it comes from the maCalcConfig
field of FormulaGroupInterpreterOpenCL, inherited from
FormulaGroupInterpreter.

Change-Id: Iac6a83e8081ab973e8b7e8161de79e411d2ed2dd
üst f7c6089c
......@@ -32,9 +32,9 @@ OpenCLError::OpenCLError( const std::string function, cl_int error, const std::s
Unhandled::Unhandled( const std::string& fn, int ln ) :
mFile(fn), mLineNumber(ln) {}
DynamicKernelArgument::DynamicKernelArgument( const std::string& s,
DynamicKernelArgument::DynamicKernelArgument( const ScCalcConfig& config, const std::string& s,
FormulaTreeNodeRef ft ) :
mSymName(s), mFormulaTree(ft) { }
mCalcConfig(config), mSymName(s), mFormulaTree(ft) { }
std::string DynamicKernelArgument::GenDoubleSlidingWindowDeclRef( bool ) const
{
......@@ -92,8 +92,8 @@ bool DynamicKernelArgument::NeedParallelReduction() const
return false;
}
VectorRef::VectorRef( const std::string& s, FormulaTreeNodeRef ft, int idx ) :
DynamicKernelArgument(s, ft), mpClmem(NULL), mnIndex(idx)
VectorRef::VectorRef( const ScCalcConfig& config, const std::string& s, FormulaTreeNodeRef ft, int idx ) :
DynamicKernelArgument(config, s, ft), mpClmem(NULL), mnIndex(idx)
{
if (mnIndex)
{
......
......@@ -20,6 +20,8 @@
#include <boost/noncopyable.hpp>
#include <set>
#include "calcconfig.hxx"
namespace sc { namespace opencl {
class FormulaTreeNode;
......@@ -83,7 +85,7 @@ private:
class DynamicKernelArgument : boost::noncopyable
{
public:
DynamicKernelArgument( const std::string& s, FormulaTreeNodeRef ft );
DynamicKernelArgument( const ScCalcConfig& config, const std::string& s, FormulaTreeNodeRef ft );
virtual ~DynamicKernelArgument() {}
/// Generate declaration
......@@ -122,6 +124,7 @@ public:
virtual bool NeedParallelReduction() const;
protected:
const ScCalcConfig& mCalcConfig;
std::string mSymName;
FormulaTreeNodeRef mFormulaTree;
};
......@@ -136,7 +139,7 @@ typedef boost::shared_ptr<DynamicKernelArgument> DynamicKernelArgumentRef;
class VectorRef : public DynamicKernelArgument
{
public:
VectorRef( const std::string& s, FormulaTreeNodeRef ft, int index = 0 );
VectorRef( const ScCalcConfig& config, const std::string& s, FormulaTreeNodeRef ft, int index = 0 );
virtual ~VectorRef();
/// Generate declaration
......
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