Kaydet (Commit) 64c479e9 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Unmap memory object right after the buffer is read.

Change-Id: Ic7c355dc005b8071a3b5db347f51882d89d2160f
üst 20f8006e
...@@ -3688,6 +3688,14 @@ public: ...@@ -3688,6 +3688,14 @@ public:
mnGroupLength * sizeof(double), 0, NULL, NULL, mnGroupLength * sizeof(double), 0, NULL, NULL,
&err); &err);
if (err != CL_SUCCESS)
{
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) if (err != CL_SUCCESS)
{ {
SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err); SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err);
...@@ -3701,18 +3709,6 @@ public: ...@@ -3701,18 +3709,6 @@ public:
return false; return false;
rDoc.SetFormulaResults(rTopPos, mpResBuf, mnGroupLength); 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; return true;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment