sc/source/core/opencl/formulagroupcl.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
New commits: commit 64c479e9da02f724e1870649c99fac92f5f27cd3 Author: Kohei Yoshida <[email protected]> Date: Thu Dec 18 13:53:29 2014 -0500 Unmap memory object right after the buffer is read. Change-Id: Ic7c355dc005b8071a3b5db347f51882d89d2160f diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 5a2bca4..c3ee932 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -3692,6 +3692,14 @@ public: { SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err); mpResBuf = NULL; + return; + } + + err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, mpCLResBuf, mpResBuf, 0, NULL, NULL); + if (err != CL_SUCCESS) + { + SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err); + mpResBuf = NULL; } } @@ -3701,18 +3709,6 @@ public: return false; rDoc.SetFormulaResults(rTopPos, mpResBuf, mnGroupLength); - - // Obtain cl context - ::opencl::KernelEnv kEnv; - ::opencl::setKernelEnv(&kEnv); - - cl_int err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, mpCLResBuf, mpResBuf, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err); - return false; - } - return true; } }; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
