[Libreoffice-commits] core.git: 10 commits - sc/source

Tor Lillqvist tml at collabora.com
Tue Oct 28 05:07:50 PDT 2014


 sc/source/core/opencl/openclwrapper.cxx |   44 ----------------
 sc/source/core/opencl/openclwrapper.hxx |   83 --------------------------------
 2 files changed, 2 insertions(+), 125 deletions(-)

New commits:
commit 1b1c11f51914448d1ebc0fe18abf2b325f8c4791
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:42:43 2014 +0200

    Bin dead and commented-out code
    
    Change-Id: I4c3d666155af4bd36e819c077f660a30dbe72cdb

diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 0e0cf1e..baf3bcc 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -76,45 +76,6 @@ OString getCacheFolder()
     return rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8);
 }
 
-void clearCache()
-{
-#if 0
-    // We used to delete all files that did not end with the hash of
-    // the static kernel source string from oclkernels.hxx. But as
-    // those static kernels were not used for anything, it was
-    // pointless, that hash never changed. The static kernels are now
-    // removed, their hash is not part of the .bin file names any
-    // more.  So there is little this function can do until we come up
-    // with some other way to figure out which cached .bin files are
-    // "current".
-    OUString aCacheDirURL(rtl::OStringToOUString(OpenCLDevice::maCacheFolder, RTL_TEXTENCODING_UTF8));
-    osl::Directory aCacheDir(aCacheDirURL);
-    osl::FileBase::RC status = aCacheDir.open();
-    if(status != osl::FileBase::E_None)
-        return;
-
-    osl::DirectoryItem aItem;
-    while(osl::FileBase::E_None == aCacheDir.getNextItem(aItem))
-    {
-        osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileName|osl_FileStatus_Mask_FileURL);
-        status = aItem.getFileStatus(aFileStatus);
-        if(status != osl::FileBase::E_None)
-            continue;
-
-        OUString aFileName = aFileStatus.getFileName();
-        if(aFileName.endsWith(".bin"))
-        {
-            if ( file is in some way obsolete )
-            {
-                // delete the file
-                OUString aFileUrl = aFileStatus.getFileURL();
-                osl::File::remove(aFileUrl);
-            }
-        }
-    }
-#endif
-}
-
 }
 
 OString OpenCLDevice::maCacheFolder = getCacheFolder();
@@ -212,7 +173,6 @@ std::vector<boost::shared_ptr<osl::File> > OpenCLDevice::binaryGenerated( const
 
 bool OpenCLDevice::writeBinaryToFile( const OString& rFileName, const char* binary, size_t numBytes )
 {
-    clearCache();
     osl::File file(rtl::OStringToOUString(rFileName, RTL_TEXTENCODING_UTF8));
     osl::FileBase::RC status = file.open(
             osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
commit e901c15c63ad118f9722505776cb8d74c2004526
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:34:30 2014 +0200

    Bin unused SingleVectorFormula and DoubleVectorFormula types
    
    Change-Id: Ia71a4aec6097a6dd07716438d7647dff4252e190

diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index 8e1974d..ef9842a 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -68,28 +68,6 @@ struct GPUEnv
     bool mnAmdFp64Flag;
 };
 
-struct SingleVectorFormula
-{
-    const double *mdpInputLeftData;
-    const double *mdpInputRightData;
-    size_t mnInputLeftDataSize;
-    size_t mnInputRightDataSize;
-    uint mnInputLeftStartPosition;
-    uint mnInputRightStartPosition;
-    int mnInputLeftOffset;
-    int mnInputRightOffset;
-};
-
-struct DoubleVectorFormula
-{
-    const double *mdpInputData;
-    size_t mnInputDataSize;
-    uint mnInputStartPosition;
-    uint mnInputEndPosition;
-    int mnInputStartOffset;
-    int mnInputEndOffset;
-};
-
 class OpenCLDevice
 {
 public:
commit 7aa411f0b4586dc27ae75adf673eef331acb7d36
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:32:16 2014 +0200

    This is C++
    
    Change-Id: I10e8be566fc0814e81938b878e14849cfef31986

diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index c8ff48c4..8e1974d 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -34,12 +34,12 @@ if( status != CL_SUCCESS )    \
 
 #include <cstdio>
 
-typedef struct _KernelEnv
+struct KernelEnv
 {
     cl_context mpkContext;
     cl_command_queue mpkCmdQueue;
     cl_program mpkProgram;
-} KernelEnv;
+};
 
 namespace sc { namespace opencl {
 
commit ca0670c5bb1d35c3960fbd8e44fb712f68770938
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:26:00 2014 +0200

    Bin unused cl_kernel_function typedef
    
    Change-Id: I42c944bdeb93dd0fdbc582ef48d8722380915bf1

diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index 0d9ce14..c8ff48c4 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -41,14 +41,6 @@ typedef struct _KernelEnv
     cl_program mpkProgram;
 } KernelEnv;
 
-extern "C" {
-
-// user defined, this is function wrapper which is used to set the input
-// parameters, launch kernel and copy data from GPU to CPU or CPU to GPU.
-typedef int ( *cl_kernel_function )( void **userdata, KernelEnv *kenv );
-
-}
-
 namespace sc { namespace opencl {
 
 typedef unsigned int uint;
commit ed929e63aae8287f7b680b784b231140643269ac
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:25:10 2014 +0200

    Bin unused strcasecmp macro
    
    Change-Id: Ia6f24bb6e84680aa0f8ba4709a16dc41df05ccdd

diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index a0434f1..0d9ce14 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -32,12 +32,6 @@ if( status != CL_SUCCESS )    \
 
 #define MAX_CLFILE_NUM 50
 
-#if defined(_MSC_VER)
-#ifndef strcasecmp
-#define strcasecmp strcmp
-#endif
-#endif
-
 #include <cstdio>
 
 typedef struct _KernelEnv
commit af0694e6459519911900a81815e533084a2407f8
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:22:32 2014 +0200

    If we #define MAX_CLKERNEL_NUM 200, we know that it isn't <= 0
    
    Change-Id: Ieadc73ce2bd6f7d11b434312d3ff872a1489307a

diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 245fb77..0e0cf1e 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -471,10 +471,6 @@ bool OpenCLDevice::buildProgramFromBinary(const char* buildOption, GPUEnv* gpuIn
 
 bool OpenCLDevice::initOpenCLRunEnv( int argc )
 {
-    if ( MAX_CLKERNEL_NUM <= 0 )
-    {
-        return true;
-    }
     if ( ( argc > MAX_CLFILE_NUM ) || ( argc < 0 ) )
         return true;
 
diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index d1b744f..a0434f1 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -31,7 +31,6 @@ if( status != CL_SUCCESS )    \
 }
 
 #define MAX_CLFILE_NUM 50
-#define MAX_CLKERNEL_NUM 200
 
 #if defined(_MSC_VER)
 #ifndef strcasecmp
commit c22b6d1d13c161b6c0acbec8cf80334d517c2886
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:21:52 2014 +0200

    Bin unused macros
    
    Change-Id: I3a9ae0187e7421aaccdbdd93b5a9c916bfbbc738

diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index f03acc2..d1b744f 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -30,10 +30,8 @@ if( status != CL_SUCCESS )    \
     return false;    \
 }
 
-#define MAX_KERNEL_STRING_LEN 64
 #define MAX_CLFILE_NUM 50
 #define MAX_CLKERNEL_NUM 200
-#define MAX_KERNEL_NAME_LEN 64
 
 #if defined(_MSC_VER)
 #ifndef strcasecmp
commit cce9bc2390090e695727fea48238f1a86083aa45
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:19:25 2014 +0200

    Bin unused macros
    
    Change-Id: I71aa24b21d7f39fd5ae65615a94a70ab3a8ed4e2

diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index 538bec1..f03acc2 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -23,11 +23,6 @@
 
 #include "clcc/clew.h"
 
-#define MaxTextExtent 4096
-//support AMD opencl
-#define CL_QUEUE_THREAD_HANDLE_AMD 0x403E
-#define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2)
-
 #define CHECK_OPENCL(status,name)    \
 if( status != CL_SUCCESS )    \
 {    \
commit 726ff5d2e87a918621aa3c072cdf8f23022ac614
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:10:20 2014 +0200

    Bin unused OPENCLWRAPPER_CL_MAP_WRITE_FLAG
    
    Change-Id: I004836b811ddac5a62215507e280e460ad50e8fa

diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index b9e0edf..538bec1 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -23,20 +23,6 @@
 
 #include "clcc/clew.h"
 
-// CL_MAP_WRITE_INVALIDATE_REGION is new in OpenCL 1.2.
-
-// When compiling against an older OpenCL, use CL_MAP_WRITE.
-
-// FIXME: But what if this code has been compiled against OpenCL 1.2
-// headers but then runs against an OpenCL 1.1 implementation?
-// Probably the code should check at run-time the version of the
-// OpenCL implementation and choose which flag to use based on that.
-#ifdef CL_MAP_WRITE_INVALIDATE_REGION
-#define OPENCLWRAPPER_CL_MAP_WRITE_FLAG CL_MAP_WRITE_INVALIDATE_REGION
-#else
-#define OPENCLWRAPPER_CL_MAP_WRITE_FLAG CL_MAP_WRITE
-#endif
-
 #define MaxTextExtent 4096
 //support AMD opencl
 #define CL_QUEUE_THREAD_HANDLE_AMD 0x403E
commit 2435dfef425adf256c2655731dc37dea819628db
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 28 13:03:38 2014 +0200

    Bin unused macros
    
    Change-Id: I5271367d5c0acb5620d07043167d1df99687ed49

diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index ab3e233..b9e0edf 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -49,27 +49,6 @@ if( status != CL_SUCCESS )    \
     return false;    \
 }
 
-#define CHECK_OPENCL_PTR(status,name)    \
-if( status != CL_SUCCESS )    \
-{    \
-    printf ("OpenCL error code is %d at " SAL_DETAIL_WHERE " when %s .\n", status, name);    \
-    return NULL;    \
-}
-
-#define CHECK_OPENCL_VOID(status,name)    \
-if( status != CL_SUCCESS )    \
-{    \
-    printf ("OpenCL error code is %d at " SAL_DETAIL_WHERE " when %s .\n", status, name);    \
-}
-
-#define CHECK_OPENCL_RELEASE(status,name)    \
-if ( name != NULL )    \
-    clReleaseMemObject( name );    \
-if( status != CL_SUCCESS )    \
-{    \
-    printf ("OpenCL error code is %d at " SAL_DETAIL_WHERE " when clReleaseMemObject( %s ).\n", status, #name);    \
-}
-
 #define MAX_KERNEL_STRING_LEN 64
 #define MAX_CLFILE_NUM 50
 #define MAX_CLKERNEL_NUM 200


More information about the Libreoffice-commits mailing list