[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/inc sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Thu Mar 20 07:43:52 PDT 2014
sc/inc/formulacell.hxx | 4 ++++
sc/source/core/data/formulacell.cxx | 10 ++++++++--
sc/source/core/opencl/formulagroupcl.cxx | 5 +++++
3 files changed, 17 insertions(+), 2 deletions(-)
New commits:
commit bb75460ad23edcf23cded63e554c611bded2dd04
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Mar 20 09:54:35 2014 -0400
Disable kernel pre-compilation for now.
Change-Id: I8ba765a4d89618f301572c5fd9931f86d87af10d
(cherry picked from commit 5d4f525da7f560f85c2ce18f1ca1570d3cc53a50)
(cherry picked from commit e0d936ef7b7fd6b57cdd5ccadddcbd84bd4bb359)
Reviewed-on: https://gerrit.libreoffice.org/8680
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 8548867..2d696c3 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -34,6 +34,8 @@
#include "formularesult.hxx"
+#define ENABLE_THREADED_OPENCL_KERNEL_COMPILATION 0
+
namespace sc {
class CLBuildKernelThread;
@@ -78,8 +80,10 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable
ScDocument& rDoc, const ScAddress& rPos, formula::FormulaGrammar::Grammar eGram );
void compileOpenCLKernel();
+#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
static int snCount;
static rtl::Reference<sc::CLBuildKernelThread> sxCompilationThread;
+#endif
};
inline void intrusive_ptr_add_ref(const ScFormulaCellGroup *p)
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 395adfd..eb40441 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -55,8 +55,6 @@
#include <boost/scoped_ptr.hpp>
-#define ENABLE_THREADED_OPENCL_KERNEL_COMPILATION 1
-
using namespace formula;
#ifdef USE_MEMPOOL
@@ -388,6 +386,7 @@ void adjustDBRange(ScToken* pToken, ScDocument& rNewDoc, const ScDocument* pOldD
}
+#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
// The mutex to synchronize access to the OpenCL compilation thread.
static osl::Mutex& getOpenCLCompilationThreadMutex()
{
@@ -407,6 +406,7 @@ static osl::Mutex& getOpenCLCompilationThreadMutex()
int ScFormulaCellGroup::snCount = 0;
rtl::Reference<sc::CLBuildKernelThread> ScFormulaCellGroup::sxCompilationThread;
+#endif
ScFormulaCellGroup::ScFormulaCellGroup() :
mnRefCount(0),
@@ -420,6 +420,7 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
meCalcState(sc::GroupCalcEnabled),
meKernelState(sc::OpenCLKernelNone)
{
+#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
if (ScInterpreter::GetGlobalConfig().mbOpenCLEnabled)
{
osl::MutexGuard aGuard(getOpenCLCompilationThreadMutex());
@@ -430,10 +431,12 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
sxCompilationThread->launch();
}
}
+#endif
}
ScFormulaCellGroup::~ScFormulaCellGroup()
{
+#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
if (ScInterpreter::GetGlobalConfig().mbOpenCLEnabled)
{
osl::MutexGuard aGuard(getOpenCLCompilationThreadMutex());
@@ -446,17 +449,20 @@ ScFormulaCellGroup::~ScFormulaCellGroup()
sxCompilationThread.clear();
}
}
+#endif
delete mpCode;
delete mpCompiledFormula;
}
void ScFormulaCellGroup::scheduleCompilation()
{
+#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
meKernelState = sc::OpenCLKernelCompilationScheduled;
sc::CLBuildKernelWorkItem aWorkItem;
aWorkItem.meWhatToDo = sc::CLBuildKernelWorkItem::COMPILE;
aWorkItem.mxGroup = this;
sxCompilationThread->push(aWorkItem);
+#endif
}
void ScFormulaCellGroup::setCode( const ScTokenArray& rCode )
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 0f6fb22..ec5c4bf 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3426,6 +3426,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
DynamicKernel *pKernel = NULL;
boost::scoped_ptr<DynamicKernel> pLocalKernel;
+#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
if (xGroup->meKernelState == sc::OpenCLKernelCompilationScheduled ||
xGroup->meKernelState == sc::OpenCLKernelBinaryCreated)
{
@@ -3443,6 +3444,10 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
pKernel = static_cast<DynamicKernel*>(createCompiledFormula(rDoc, rTopPos, *xGroup, rCode));
pLocalKernel.reset(pKernel); // to be deleted when done.
}
+#else
+ pKernel = static_cast<DynamicKernel*>(createCompiledFormula(rDoc, rTopPos, *xGroup, rCode));
+ pLocalKernel.reset(pKernel); // to be deleted when done.
+#endif
if (!pKernel)
return false;
More information about the Libreoffice-commits
mailing list