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,
|
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:
|
|||||||
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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user