[Libreoffice-commits] core.git: Branch 'feature/calc-pluggable-opencl' - sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Mon Sep 16 12:33:45 PDT 2013
sc/source/core/opencl/openclwrapper.cxx | 16 ----------------
sc/source/core/opencl/openclwrapper.hxx | 27 +++++++++------------------
2 files changed, 9 insertions(+), 34 deletions(-)
New commits:
commit d9b20e4440e3124aece7a55bd0f07ec175de6b35
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Mon Sep 16 15:35:31 2013 -0400
Some cleanups.
Change-Id: I35bc92fc4bd5feb80b804d411fcd29feacab41ee
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 511c8df..a5dcd57 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -400,22 +400,6 @@ int OpenclDevice::initOpenclAttr( OpenCLEnv * env )
return 0;
}
-int OpenclDevice::createKernel( char * kernelname, KernelEnv * env )
-{
- int clStatus;
-
- env->mpkKernel = clCreateKernel( gpuEnv.mpArryPrograms[0], kernelname, &clStatus );
- env->mpkContext = gpuEnv.mpContext;
- env->mpkCmdQueue = gpuEnv.mpCmdQueue;
- return clStatus != CL_SUCCESS ? 1 : 0;
-}
-
-int OpenclDevice::releaseKernel( KernelEnv * env )
-{
- int clStatus = clReleaseKernel( env->mpkKernel );
- return clStatus != CL_SUCCESS ? 1 : 0;
-}
-
int OpenclDevice::releaseOpenclEnv( GPUEnv *gpuInfo )
{
int i = 0;
diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index e11bdfb..cefec0d 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -93,15 +93,15 @@ namespace sc { namespace opencl {
typedef unsigned int uint;
-typedef struct _OpenCLEnv
+struct OpenCLEnv
{
cl_platform_id mpOclPlatformID;
cl_context mpOclContext;
cl_device_id mpOclDevsID;
cl_command_queue mpOclCmdQueue;
-} OpenCLEnv;
+};
-typedef struct _GPUEnv
+struct GPUEnv
{
//share vb in all modules in hb library
cl_platform_id mpPlatformID;
@@ -119,15 +119,9 @@ typedef struct _GPUEnv
mnIsUserCreated; // 1: created , 0:no create and needed to create by opencl wrapper
int mnKhrFp64Flag;
int mnAmdFp64Flag;
+};
-} GPUEnv;
-
-typedef struct
-{
- char kernelName[MAX_KERNEL_NAME_LEN + 1];
- char *kernelStr;
-} kernel_node;
-typedef struct _SingleVectorFormula
+struct SingleVectorFormula
{
const double *mdpInputLeftData;
const double *mdpInputRightData;
@@ -137,9 +131,9 @@ typedef struct _SingleVectorFormula
uint mnInputRightStartPosition;
int mnInputLeftOffset;
int mnInputRightOffset;
-} SingleVectorFormula;
+};
-typedef struct _DoubleVectorFormula
+struct DoubleVectorFormula
{
const double *mdpInputData;
size_t mnInputDataSize;
@@ -147,7 +141,8 @@ typedef struct _DoubleVectorFormula
uint mnInputEndPosition;
int mnInputStartOffset;
int mnInputEndOffset;
-} DoubleVectorFormula;
+};
+
class OpenclCalcBase
{
public:
@@ -169,8 +164,6 @@ public:
virtual int oclGroundWaterGroup( uint *eOp, uint eOpNum, const double *pOpArray, const double *pSubtractSingle, size_t nSrcDataSize,size_t nElements, double delta,uint *nStartPos,uint *nEndPos ,double *deResult)=0;
virtual double *oclSimpleDeltaOperation( OpCode eOp, const double *pOpArray, const double *pSubtractSingle, size_t nElements, double delta )=0;
-
-
};
@@ -196,9 +189,7 @@ public:
static int compileKernelFile( const char *filename, GPUEnv *gpuInfo, const char *buildOption );
static int initOpenclAttr( OpenCLEnv * env );
- int releaseKernel( KernelEnv * env );
int setKernelEnv( KernelEnv *envInfo );
- int createKernel( char * kernelname, KernelEnv * env );
int runKernel( const char *kernelName, void **userdata );
int convertToString( const char *filename, char **source );
int checkKernelName( KernelEnv *envInfo, const char *kernelName );
More information about the Libreoffice-commits
mailing list