summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-09-09 10:52:42 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-09-10 11:47:44 -0400
commitf4d04f2014cedacdba3eec2177a3ba4acd3d6b6f (patch)
treea5409de18d5dd1b36ec2618fe860090e4d0b2437
parente8c26959deac60eb2b7bec7a36fccacd95914304 (diff)
Instantiate the software fallback outside of opencl code.
Change-Id: I7ec7a951492616abd3c7327b85f09c1e913208ca
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx24
-rw-r--r--sc/source/core/tool/formulagroup.cxx3
2 files changed, 15 insertions, 12 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 0ae58e808472..0f8b46f9988a 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1063,18 +1063,18 @@ bool FormulaGroupInterpreterGroundwater::interpret(ScDocument& rDoc, const ScAdd
}
namespace opencl {
- sc::FormulaGroupInterpreter *createFormulaGroupInterpreter()
- {
- if (getenv("SC_SOFTWARE"))
- {
- fprintf(stderr, "Create S/W interp\n");
- return new sc::FormulaGroupInterpreterSoftware();
- }
- if (getenv("SC_GROUNDWATER"))
- return new sc::FormulaGroupInterpreterGroundwater();
- else
- return new sc::FormulaGroupInterpreterOpenCL();
- }
+
+sc::FormulaGroupInterpreter *createFormulaGroupInterpreter()
+{
+ if (getenv("SC_SOFTWARE"))
+ return NULL;
+
+ if (getenv("SC_GROUNDWATER"))
+ return new sc::FormulaGroupInterpreterGroundwater();
+
+ return new sc::FormulaGroupInterpreterOpenCL();
+}
+
} // namespace opencl
} // namespace sc
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 2ea09c4a54d8..6c930e53d41e 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -216,7 +216,10 @@ FormulaGroupInterpreter *FormulaGroupInterpreter::getStatic()
msInstance = sc::opencl::createFormulaGroupInterpreter();
#endif
if ( !msInstance ) // software fallback
+ {
+ fprintf(stderr, "Create S/W interp\n");
msInstance = new sc::FormulaGroupInterpreterSoftware();
+ }
}
return msInstance;