[Libreoffice-commits] core.git: Branch 'feature/calc-opencl-cache' - 2 commits - sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Sep 18 04:14:39 PDT 2013


 sc/source/core/opencl/openclwrapper.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit db7a3629d308eece702889efd4d0d7aebb0fbca6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Sep 18 13:06:16 2013 +0200

    fix memory leak
    
    Change-Id: If1afe59bc5bb40bb3fff4c74b863c6d77e006cc5

diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index c93c724..9a7b165 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -459,10 +459,10 @@ int OpenclDevice::compileKernelFile( GPUEnv *gpuInfo, const char *buildOption )
         {
             // something went wrong, fall back to compiling from source
             bBinaryExisted = false;
-            for(size_t i = 0; i < numDevices; ++i)
-            {
-                delete[] pBinary[i];
-            }
+        }
+        for(size_t i = 0; i < numDevices; ++i)
+        {
+            delete[] pBinary[i];
         }
     }
 
commit 1e39ef24c9eda9943e3bdf15ac08452342b21bb4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Sep 18 13:05:31 2013 +0200

    fall back to compiling from source if binary failed
    
    Change-Id: I8e8d8fb5b1da18c44e1537f97317d4e5b57c47b6

diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index c630939..c93c724 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -457,14 +457,16 @@ int OpenclDevice::compileKernelFile( GPUEnv *gpuInfo, const char *buildOption )
                                            &binary_status, &clStatus );
         if(clStatus != CL_SUCCESS)
         {
+            // something went wrong, fall back to compiling from source
+            bBinaryExisted = false;
             for(size_t i = 0; i < numDevices; ++i)
             {
                 delete[] pBinary[i];
             }
         }
-        CHECK_OPENCL( clStatus, "clCreateProgramWithBinary" );
     }
-    else
+
+    if(!bBinaryExisted)
     {
         // create a CL program using the kernel source
         fprintf(stderr, "Create kernel from source\n");


More information about the Libreoffice-commits mailing list