[Libreoffice-commits] core.git: sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Tue Mar 11 21:53:48 PDT 2014
sc/source/core/opencl/formulagroupcl.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 80842a50b1580b9a6da3a2c39a88a72b5b98d278
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Mar 12 00:49:26 2014 -0400
Don't delete the kernel when pre-compiled.
Because we'll be re-using that same kernel instance for subsequent runs.
Change-Id: I08b6df65550cecfa48f937b163fb1c5b20ed8ac9
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index d329f5d..00909be 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3445,7 +3445,8 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
const ScAddress& rTopPos, ScFormulaCellGroupRef& xGroup,
ScTokenArray& rCode )
{
- DynamicKernel *pKernel;
+ DynamicKernel *pKernel = NULL;
+ boost::scoped_ptr<DynamicKernel> pLocalKernel;
if (xGroup->meKernelState == sc::OpenCLKernelCompilationScheduled ||
xGroup->meKernelState == sc::OpenCLKernelBinaryCreated)
@@ -3462,6 +3463,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
{
assert(xGroup->meCalcState == sc::GroupCalcRunning);
pKernel = static_cast<DynamicKernel*>(createCompiledFormula(rDoc, rTopPos, *xGroup, rCode));
+ pLocalKernel.reset(pKernel); // to be deleted when done.
}
if (!pKernel)
@@ -3487,8 +3489,6 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, res, resbuf, 0, NULL, NULL);
if (err != CL_SUCCESS)
throw OpenCLError(err, __FILE__, __LINE__);
- if (xGroup->meCalcState == sc::GroupCalcRunning)
- delete pKernel;
}
catch (const UnhandledToken &ut) {
std::cerr << "\nDynamic formual compiler: unhandled token: ";
More information about the Libreoffice-commits
mailing list