Unmap memory object right after the buffer is read.
Change-Id: Ic7c355dc005b8071a3b5db347f51882d89d2160f
This commit is contained in:
@@ -3688,6 +3688,14 @@ public:
|
||||
mnGroupLength * sizeof(double), 0, NULL, NULL,
|
||||
&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)
|
||||
{
|
||||
SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err);
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user