diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-18 13:53:29 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-18 13:57:10 -0500 |
commit | 64c479e9da02f724e1870649c99fac92f5f27cd3 (patch) | |
tree | 5d2b597d9d2e06091c4522499b1651314e188a46 | |
parent | 20f8006e21943b08f1f152e4a0359c9ebe4786f2 (diff) |
Unmap memory object right after the buffer is read.
Change-Id: Ic7c355dc005b8071a3b5db347f51882d89d2160f
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 5a2bca4e9e24..c3ee9323c3d2 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; } }; |