summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx47
1 files changed, 27 insertions, 20 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 55668ee5f383..82cafdb5a4b2 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -96,11 +96,15 @@ size_t VectorRef::Marshal(cl_kernel k, int argno, int, cl_program)
if (pHostBuffer)
{
mpClmem = clCreateBuffer(kEnv.mpkContext,
- (cl_mem_flags) CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR,
+ (cl_mem_flags) CL_MEM_READ_ONLY,
szHostBuffer,
- pHostBuffer, &err);
+ NULL, &err);
if (CL_SUCCESS != err)
throw OpenCLError(err);
+ err = clEnqueueWriteBuffer(kEnv.mpkCmdQueue, mpClmem,CL_TRUE, 0, szHostBuffer,
+ pHostBuffer, 0, NULL, NULL);
+ if (CL_SUCCESS != err)
+ throw OpenCLError(err);
}
else
{
@@ -112,15 +116,15 @@ size_t VectorRef::Marshal(cl_kernel k, int argno, int, cl_program)
szHostBuffer, NULL, &err);
if (CL_SUCCESS != err)
throw OpenCLError(err);
- double *pNanBuffer = (double*)clEnqueueMapBuffer(
- kEnv.mpkCmdQueue, mpClmem, CL_TRUE, CL_MAP_WRITE, 0,
- szHostBuffer, 0, NULL, NULL, &err);
- if (CL_SUCCESS != err)
- throw OpenCLError(err);
+ double *pNanBuffer = new double[szHostBuffer/sizeof(double)];
for (size_t i = 0; i < szHostBuffer/sizeof(double); i++)
pNanBuffer[i] = NAN;
- err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, mpClmem,
- pNanBuffer, 0, NULL, NULL);
+ err = clEnqueueWriteBuffer(kEnv.mpkCmdQueue, mpClmem,CL_TRUE, 0, szHostBuffer,
+ pNanBuffer, 0, NULL, NULL);
+ if (CL_SUCCESS != err)
+ throw OpenCLError(err);
+ delete[] pNanBuffer;
+
}
err = clSetKernelArg(k, argno, sizeof(cl_mem), (void*)&mpClmem);
@@ -799,9 +803,15 @@ public:
mpDVR->GetArrays()[Base::mnIndex].mpNumericArray);
size_t szHostBuffer = nInput * sizeof(double);
Base::mpClmem = clCreateBuffer(kEnv.mpkContext,
- (cl_mem_flags) CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR,
+ (cl_mem_flags) CL_MEM_READ_ONLY,
szHostBuffer,
- pHostBuffer, &err);
+ NULL, &err);
+ if (CL_SUCCESS != err)
+ throw OpenCLError(err);
+ err = clEnqueueWriteBuffer(kEnv.mpkCmdQueue, Base::mpClmem,CL_TRUE, 0,
+ szHostBuffer, pHostBuffer, 0, NULL, NULL);
+ if (CL_SUCCESS != err)
+ throw OpenCLError(err);
mpClmem2 = clCreateBuffer(kEnv.mpkContext, CL_MEM_WRITE_ONLY,
sizeof(double)*w, NULL, NULL);
if (CL_SUCCESS != err)
@@ -2623,7 +2633,7 @@ public:
cl_int err;
// The results
mpResClmem = clCreateBuffer(kEnv.mpkContext,
- (cl_mem_flags) CL_MEM_READ_WRITE|CL_MEM_ALLOC_HOST_PTR,
+ (cl_mem_flags) CL_MEM_READ_WRITE,
nr*sizeof(double), NULL, &err);
if (CL_SUCCESS != err)
throw OpenCLError(err);
@@ -2905,17 +2915,14 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
// Map results back
cl_mem res = pKernel->GetResultBuffer();
cl_int err;
- double *resbuf = (double*)clEnqueueMapBuffer(kEnv.mpkCmdQueue,
- res,
- CL_TRUE, CL_MAP_READ, 0,
- xGroup->mnLength*sizeof(double), 0, NULL, NULL,
- &err);
+ double *resbuf = new double[xGroup->mnLength];
+ err = clEnqueueReadBuffer(kEnv.mpkCmdQueue,res,
+ CL_TRUE, 0, xGroup->mnLength*sizeof(double), resbuf, 0, NULL, NULL);
if (err != CL_SUCCESS)
throw OpenCLError(err);
+
rDoc.SetFormulaResults(rTopPos, resbuf, xGroup->mnLength);
- err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, res, resbuf, 0, NULL, NULL);
- if (err != CL_SUCCESS)
- throw OpenCLError(err);
+ delete[] resbuf;
if (xGroup->meCalcState == sc::GroupCalcRunning)
delete pKernel;
}
the codebase that will need to be done by hand (*) the plugin needs lots of handholding, due to needing to add #include and update macros Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-01-17tdf#42949 Fix IWYU warnings in svx/source/[a-e]*/*cxx and svx/qa/Gabor Kelemen Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I68110cdc5cff99a3bc15184c04ae309412511f9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86633 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> 2019-11-20loplugin:unusedmethodsNoel Grandin Remove a filtering step in the python script that was hiding some results Change-Id: Id94268f150902405ab197c077f18aaedf98845fc Reviewed-on: https://gerrit.libreoffice.org/83256 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2019-09-03loplugin:constmethod in svxNoel Grandin Change-Id: I6ae7c04479e3ea8ecd7535c33224a5e7095b64bb Reviewed-on: https://gerrit.libreoffice.org/78396 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2018-08-02Add missing sal/log.hxx headersGabor Kelemen rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from stoc to svx Change-Id: If562b1aa1d676d2c1cf513e953238abbb846c65c Reviewed-on: https://gerrit.libreoffice.org/58224 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> 2017-07-27loplugin:constparams in svxNoel Grandin and fix a bug in the plugin itself when calling operator's like the one on std::function<> Change-Id: I1617607107eeff06785c1841f69e13ad2926218e Reviewed-on: https://gerrit.libreoffice.org/40446 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2017-01-26Remove dynamic exception specificationsStephan Bergmann ...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2016-12-11OSL_TRACE -> SAL in sfx2..svxNoel Grandin Change-Id: I78cf8058a5682baa3d7b00a25feeb2d28fb3e66e Reviewed-on: https://gerrit.libreoffice.org/31799 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> 2016-08-25drop enum IAccessibleViewForwarderListener::ChangeTypeNoel Grandin since only one of it's values was in use, and simplify the ViewForwarderChanged method as a consequence. Change-Id: I00544c9b0a601c01e49519be5bafe192c6f735f6 2016-07-04typo: emtpy → emptyChristian Lohmaier Change-Id: I60cdcdc7fc38c175243c071f34295efa8739b717 2016-02-11Simplify ChildrenManagerStephan Bergmann Change-Id: I43762aa8b572651676d8cac4848d4c6d478cf850 2016-02-09Remove excess newlinesChris Sherlock A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> 2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann Change-Id: I71682f28c6a54d33da6b0c971f34d0a705ff04f5 2015-10-31com::sun::star->css in svxNoel Grandin Change-Id: If2c11fa548c5ebef2297d2491edd837b54e3707c Reviewed-on: https://gerrit.libreoffice.org/19690 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2015-04-15remove unnecessary use of void in function declarationsNoel Grandin ie. void f(void); becomes void f(); I used the following command to make the changes: git grep -lP '\(\s*void\s*\)' -- *.cxx \ | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;' and ran it for both .cxx and .hxx files. Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd 2014-08-19svx: Cleanup ASCII art and useless commentsChris Laplante Change-Id: I5399362056276f324fd43eda05d3f606dc6f8c71 Reviewed-on: https://gerrit.libreoffice.org/11011 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> 2014-06-30Called C++ object pointer is nullCaolán McNamara Change-Id: I88efc4be6ff869ef97a2b398d43f7b7914debfc6