[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed Mar 12 03:12:53 PDT 2014


 sc/source/core/opencl/formulagroupcl.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 667943572cafa1c869597db68dd4c3c28fdaff6d
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.
    
    (cherry picked from commit 80842a50b1580b9a6da3a2c39a88a72b5b98d278)
    
    Conflicts:
    	sc/source/core/opencl/formulagroupcl.cxx
    
    Change-Id: I08b6df65550cecfa48f937b163fb1c5b20ed8ac9
    Reviewed-on: https://gerrit.libreoffice.org/8538
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index a478b21..0f6fb22 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3423,7 +3423,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)
@@ -3440,6 +3441,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)
@@ -3465,8 +3467,6 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
         err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, res, resbuf, 0, NULL, NULL);
         if (err != CL_SUCCESS)
             throw OpenCLError(err);
-        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