summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-11-13 10:50:12 +0200
committerMichael Meeks <michael.meeks@collabora.com>2013-11-20 18:23:04 +0000
commitc0307ec2bafa0751e7d8ea1f4d6caac58c5cc5dc (patch)
tree9409294335033e5faf8999684b162301e6d8fd7b /sc/source/core/data
parentfeca57d41d515959e3f730eb372a3d33bb251a03 (diff)
WIP commit of threaded OpenCL compilation work
Change-Id: I210d0ded9cb38569b0831355522d8309cee05f56
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/formulacell.cxx22
1 files changed, 16 insertions, 6 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index e0ee5a75f710..c17e4f3638dd 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -418,11 +418,11 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
{
osl::MutexGuard aGuard(getOpenCLCompilationThreadMutex());
if (mnCount++ == 0)
- {
- assert(!mxCLKernelThread.is());
- mxCLKernelThread.set(new sc::CLBuildKernelThread);
- mxCLKernelThread->launch();
- }
+ {
+ assert(!mxCLKernelThread.is());
+ mxCLKernelThread.set(new sc::CLBuildKernelThread);
+ mxCLKernelThread->launch();
+ }
}
}
@@ -443,6 +443,14 @@ ScFormulaCellGroup::~ScFormulaCellGroup()
delete mpCode;
}
+void ScFormulaCellGroup::scheduleCompilation()
+{
+ sc::CLBuildKernelWorkItem aWorkItem;
+ aWorkItem.meWhatToDo = sc::CLBuildKernelWorkItem::COMPILE;
+ aWorkItem.mxGroup = this;
+ mxCLKernelThread->push(aWorkItem);
+}
+
void ScFormulaCellGroup::setCode( const ScTokenArray& rCode )
{
delete mpCode;
@@ -929,7 +937,9 @@ void ScFormulaCell::CompileTokenArray( bool bNoListening )
{
// Not already compiled?
if( !pCode->GetLen() && !aResult.GetHybridFormula().isEmpty() )
+ {
Compile( aResult.GetHybridFormula(), bNoListening, eTempGrammar);
+ }
else if( bCompile && !pDocument->IsClipOrUndo() && !pCode->GetCodeError() )
{
// RPN length may get changed
@@ -3319,6 +3329,7 @@ ScFormulaCellGroupRef ScFormulaCell::CreateCellGroup( SCROW nLen, bool bInvarian
mxGroup->mbInvariant = bInvariant;
mxGroup->mnLength = nLen;
mxGroup->mpCode = pCode; // Move this to the shared location.
+ mxGroup->scheduleCompilation();
return mxGroup;
}
@@ -3509,7 +3520,6 @@ public:
aComp.SetGrammar(formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1);
OUStringBuffer aAsString;
aComp.CreateStringFromTokenArray(aAsString);
- SAL_DEBUG("interpret formula: " << aAsString.makeStringAndClear());
}
#endif