[Libreoffice-commits] core.git: sc/source
haochen
haochen at multicorewareinc.com
Mon Dec 9 16:55:26 PST 2013
sc/source/core/opencl/formulagroupcl.cxx | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
New commits:
commit 031738970b6635505e91065cca511f4378969cb1
Author: haochen <haochen at multicorewareinc.com>
Date: Mon Dec 9 13:07:32 2013 +0800
Release cl_mem&kernel after sumifs reduction kernel
Change-Id: Ibe2eccf92b5f8e7b12b5d885cb393238b16837b0
Signed-off-by: Your Name <you at example.com>
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 665ab46..ee1b655 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1458,7 +1458,7 @@ public:
DynamicKernelArgument *Arg = mvSubArguments[0].get();
DynamicKernelSlidingArgument<VectorRef> *slidingArgPtr =
dynamic_cast< DynamicKernelSlidingArgument<VectorRef> *> (Arg);
- cl_mem mpClmem2;
+ mpClmem2 = NULL;
if (OpSumCodeGen->NeedReductionKernel())
{
@@ -1519,7 +1519,7 @@ public:
err = clFinish(kEnv.mpkCmdQueue);
if (CL_SUCCESS != err)
throw OpenCLError(err);
-
+ clReleaseKernel(redKernel);
// Pass mpClmem2 to the "real" kernel
err = clSetKernelArg(k, argno, sizeof(cl_mem), (void *)&mpClmem2);
if (CL_SUCCESS != err)
@@ -1616,7 +1616,16 @@ public:
for (unsigned i = 0; i < mvSubArguments.size(); i++)
mvSubArguments[i]->DumpInlineFun(decls,funs);
}
+ ~DynamicKernelSoPArguments()
+ {
+ if (mpClmem2)
+ {
+ clReleaseMemObject(mpClmem2);
+ mpClmem2 = NULL;
+ }
+ }
private:
+ cl_mem mpClmem2;
SubArgumentsType mvSubArguments;
boost::shared_ptr<SlidingFunctionBase> mpCodeGen;
};
@@ -1676,7 +1685,7 @@ DynamicKernelArgument *VectorRefFactory(const std::string &s,
DynamicKernelSoPArguments::DynamicKernelSoPArguments(
const std::string &s, const FormulaTreeNodeRef& ft, SlidingFunctionBase* pCodeGen) :
- DynamicKernelArgument(s, ft), mpCodeGen(pCodeGen)
+ DynamicKernelArgument(s, ft), mpCodeGen(pCodeGen),mpClmem2(NULL)
{
size_t nChildren = ft->Children.size();
More information about the Libreoffice-commits
mailing list