summaryrefslogtreecommitdiff
path: root/sc/source/core/opencl
AgeCommit message (Collapse)AuthorFilesLines
2021-03-23tdf#124176 Use pragma once in s*Vincent LE GARREC9-36/+9
sc, scaddins, sccomp, scripting Change-Id: Ia99fec9e238033821cb784810edd4762c09bd5db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112049 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-02-28tdf#124176 Use pragma once in sc/source/core/openclSuhaas Joshi1-5/+1
Change-Id: I90253fdf9528116379cf06cb00a3342944e3351a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108918 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2020-11-27tdf#42949 Fix new IWYU warnings in directory sc/Gabor Kelemen1-0/+2
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I217817e2e4a42b096f5a7fb6344568c10d69aab2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106078 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-11loplugin:stringviewNoel1-1/+1
Add new methods "subView" to O(U)String to return substring views of the underlying data. Add a clang plugin to warn when replacing existing calls to copy() would be better to use subView(). Change-Id: I03a5732431ce60808946f2ce2c923b22845689ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-17ScCompiler ctors never passed a null ScDocument*Caolán McNamara1-1/+1
add one assert to ScXMLConditionalFormatContext where this isn't immediately certain. Change-Id: I2103c5cd42288e0a5d2a1c2e2d2d031f806773bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102906 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-09improve loplugin:unusedvarsglobalNoel Grandin1-38/+0
to find any global variable, was checking the wrong property of VarDecl Change-Id: I454b4e0c1701bb0771768a1ee10cd738c4ab0726 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102278 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-09loplugin:flatten in scNoel Grandin3-542/+540
Change-Id: Iedb6ca37d1b006131d1fc77eca3303a12ccb60c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100401 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-01Upcoming improved loplugin:staticanonymous -> redundantstatic: scStephan Bergmann1-1/+1
Change-Id: Ie2d2d26bac69f4b228eadef712b06b665b3974eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97650 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-09compact namespace in scNoel Grandin9-18/+18
Change-Id: I05ffad6b92883d3eb6d337fe75f5fc7864485861 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93860 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07fix use after std::moveNoel Grandin1-1/+1
regression from commit 5efd34eabcbd374f0f06cac12b7b25f955db7965 loplugin:makeshared in sc Change-Id: I1ec603f6ea01aca86cb478f2bf3a6d5d37f235af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93639 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-30loplugin:makeshared in scNoel Grandin1-251/+251
Change-Id: I512d05ea24c519c25f03a35842e362bf23f05693 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93198 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-12Revert "loplugin:constfields in sc"Noel Grandin2-12/+12
This reverts commit fb1d3b580763a333bbbfe115d09e1b5cd8849675. Now that we know that making fields has negative side effects like disabling assignment operator generation. Change-Id: Ib48334ffbeb2c768896dd8ced6818aa0b9910b0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90333 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-07add OpenCLZone in suitable places in Calc's OpenCL codeLuboš Luňák1-0/+16
Change-Id: I0ce230a9a876c2f1fdbcd7ed81a1aba043cc5fb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88012 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-01-24loplugin:makeshared in scNoel Grandin1-24/+23
Change-Id: Ie287b5c11a1276c56f416f17ea69cddd5992b4a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87326 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15clang-tidy modernize-concat-nested-namespace in scNoel Grandin10-20/+20
Change-Id: I6a9b2b912434c053e20ce06ef03e52451e506693 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86804 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-06Incomplete OpAverage, OpCount must not be used in dynamic_castStephan Bergmann1-369/+376
...even in template code (which compilers often only analyze late during compilation, but which Clang trunk now apparently processes more aggressively, presumably since <https://github.com/llvm/llvm-project/commit/ 878a24ee244a24c39d1c57e9af2e88c621f7cce9> "Reapply 'Fix crash on switch conditions of non-integer types in templates'", emitting errors about incomplete types) Change-Id: I851d266007f72cc4063f299412eadacbc6084f70 Reviewed-on: https://gerrit.libreoffice.org/84657 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-06loplugin:implicitboolconversionStephan Bergmann1-2/+2
...in non-dependent templated code that Clang trunk now apparently processes more aggressively, presumably since <https://github.com/llvm/llvm-project/ commit/878a24ee244a24c39d1c57e9af2e88c621f7cce9> "Reapply 'Fix crash on switch conditions of non-integer types in templates'" Change-Id: I561d046c736b4e9574565c01daf0f59e7d5ec414 Reviewed-on: https://gerrit.libreoffice.org/84656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-22Fix typoAndrea Gelmini1-5/+5
Change-Id: Ibf2e90ff53f201d7b1f279c11eb8238eb403c05e Reviewed-on: https://gerrit.libreoffice.org/83533 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann1-2/+17
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-17Extend loplugin:external to warn about enumsStephan Bergmann1-0/+4
To mitigate the dangers of silently breaking ADL when moving enums into unnamed namespaces (see the commit message of 206b5b2661be37efdff3c6aedb6f248c4636be79 "New loplugin:external"), note all functions that are affected. (The plan is to extend loplugin:external further to also warn about classes and class templates, and the code to identify affected functions already takes that into account, so some parts of that code are not actually relevant for enums.) But it appears that none of the functions that are actually affected by the changes in this commit relied on being found through ADL, so no adaptions were necessary for them. (clang::DeclContext::collectAllContexts is non-const, which recursively means that External's Visit... functions must take non-const Decl*. Which required compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support such Visit... functions with non-const Decl* parameters.) Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd Reviewed-on: https://gerrit.libreoffice.org/83001 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-06loplugin:indentation find broken if statementsNoel Grandin1-1/+3
so I don't read the "then" block as being a sequential statements Change-Id: Ib2004acd3518bd4ebd2246f02a26c2c0a8bbab4c Reviewed-on: https://gerrit.libreoffice.org/82069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-11simplify "a = a +" to "a +="Noel Grandin1-1/+1
mostly so that my stringadd loplugin can point out places to improve Change-Id: I9920ee1c99cdb6b811ba67ff9d8e32aa261884b5 Reviewed-on: https://gerrit.libreoffice.org/80618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20loplugin:constvars in package..scNoel Grandin2-3/+3
Change-Id: Ibaa9ebd6440d9229ba313f4c130f5752d432b338 Reviewed-on: https://gerrit.libreoffice.org/77792 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-18Fix typosAndrea Gelmini1-2/+2
It passed "make check" on Linux Change-Id: Ibda74a6c5bd50bac7af3b3af1f294817c3e406cc Reviewed-on: https://gerrit.libreoffice.org/77667 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-06-13Intel OpenCL also has broken nan() that ignores the argumentLuboš Luňák1-4/+2
And since whether this works correctly is tested by cl-test.ods, without this OpenCL gets disabled on Intel machines. Change-Id: I8d5c9b1298a08f2e2cb6dfdf183f542315372889 Reviewed-on: https://gerrit.libreoffice.org/73887 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-06-04Missing includeStephan Bergmann1-0/+2
Change-Id: I4c733df9c5a01f911c6a99fca21a2dd70aeecf18 Reviewed-on: https://gerrit.libreoffice.org/73407 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-22New loplugin:dataStephan Bergmann1-2/+2
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-15improve loplugin simplifyconstructNoel Grandin1-1/+1
to find stuff like OUString s = OUString("xxx") Change-Id: Ie7ed074c1ae012734c67a2a89c564c1900a4ab04 Reviewed-on: https://gerrit.libreoffice.org/70697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-06loplugin:unnecessaryparen improve member expressionNoel Grandin1-1/+1
Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09loplugin:indentation in scNoel Grandin5-245/+245
Change-Id: Ieafabbafde456edba5adbe1fd587c32f04aedb98 Reviewed-on: https://gerrit.libreoffice.org/67562 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-31Simplify containers iterations in sc/source/core/[o-t]*Arkadiy Illarionov1-16/+11
Use range-based loop or replace with STL functions Change-Id: I3ecd9e92b9690e416b4a6c8f3830346ea23c5882 Reviewed-on: https://gerrit.libreoffice.org/67182 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-24in dbgutils mode, abort if an OpenCL program fails to compileLuboš Luňák1-0/+5
Change-Id: I86e57e6da645b59f8c71387057047c9aab4d1759 Reviewed-on: https://gerrit.libreoffice.org/65480 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-01-24avoid incorrect OpenCL code with empty argumentsLuboš Luňák2-2/+15
Change-Id: Ib7438cc2e9a020ce0cfcc649cd82667c64e0d3df Reviewed-on: https://gerrit.libreoffice.org/65479 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-01-24fix svDoubleRef handling in OpenCLLuboš Luňák1-40/+62
Basically just adjust it based on svSingleRef handling, as that one seems sane, while the svDoubleRef case, as a comment puts it, is "such crack". It didn't seem to make much sense written that way, and it didn't handle correctly e.g. COUNT() with only strings, OpCount says it doesn't take strings, but the code passed the arguments to it anyway, in the "other case". It'd be better to merge the code into one shared function, but sadly there are small differencies, so at least this way for now. Change-Id: Ia5f6ce60dae54b1d5a97e049600503aaa9be3bf0 Reviewed-on: https://gerrit.libreoffice.org/65478 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-01-24say in log message which opcode is not handled by OpenCLLuboš Luňák1-1/+5
Change-Id: I836969c777382a3a7dce23733ebfc331391bf4b4 Reviewed-on: https://gerrit.libreoffice.org/65477 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-01-24loplugin:constparams in scNoel Grandin1-3/+3
Change-Id: Ie211eea01eaceb718f701d3fdbb6253700d14e5e Reviewed-on: https://gerrit.libreoffice.org/66831 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-16use unique_ptr in scNoel Grandin1-11/+6
Change-Id: I780157687ba0727ee11f5ccdaf64412eb89c1757 Reviewed-on: https://gerrit.libreoffice.org/66418 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-06print also contents of OpenCL buffers in debug outputLuboš Luňák1-6/+85
Specifically, the input arguments of the run programs and the results buffer. This should make it much simpler to check if an OpenCL program works correctly. Change-Id: I0667082bf9a88757c8bda0c7ed54e2fc918534d7 Reviewed-on: https://gerrit.libreoffice.org/64547 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-05OpenCL FVSCHEDULE() error checkingLuboš Luňák1-0/+3
Change-Id: If93a9ea6e0265ba616b4a1fbe138d310ea3e8693 Reviewed-on: https://gerrit.libreoffice.org/64546 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-05OpenCL SQRT() error checkingLuboš Luňák1-0/+6
Change-Id: I6208cf21f53d1a2a0eb4f08962c7bddcc372aab5 Reviewed-on: https://gerrit.libreoffice.org/64545 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-05OpenCL NORMDIST() error checkingLuboš Luňák1-0/+2
Change-Id: I15636a64ad869bf874fc6e2ada87842050da1a9a Reviewed-on: https://gerrit.libreoffice.org/64544 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-05fix OpenCL ROUND() when the second parameter is negativeLuboš Luňák1-0/+5
Change-Id: Ibbf374f72e83609a602504d9ffde922896338c2c Reviewed-on: https://gerrit.libreoffice.org/64543 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-05better/sane error checking in OpenCL BESSELJ()Luboš Luňák2-12/+7
Change-Id: I1f1945e7fd2721a320ab11196385e22a70d3da70 Reviewed-on: https://gerrit.libreoffice.org/64542 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-04fixes for OpenCL COVAR()Luboš Luňák1-1/+6
Change-Id: Ie171eea334de65b993554146c11adb95e0dbb85e Reviewed-on: https://gerrit.libreoffice.org/64245 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-04make OpenCL SLOPE() handle problems more gracefullyLuboš Luňák1-20/+4
It's silly to just return NaN just because the function can't handle something. If nothing else, at least a proper error should be reported (or in this case, the fallback to the core function will take care of it). Change-Id: I9c971082f4c5c9836318cf63d15fa7c278274273 Reviewed-on: https://gerrit.libreoffice.org/64244 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-04check that OpenCL NORMDIST() takes a proper number of argumentsLuboš Luňák1-1/+3
Change-Id: I885a1b70556311f5a0862fec24a3596dbeada5d6 Reviewed-on: https://gerrit.libreoffice.org/64243 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-04opencl SERIESSUM does not handle plain double argumentsLuboš Luňák1-1/+3
sc_subsequent_filters_test in ScFiltersTest::testFunctionsODS() also checks "SERIESSUM(2;3;2;3)", which the opencl code does not handle. At least bail out gracefully instead of returning 0. Change-Id: I154dca8cc437a6225b4eb98012232d80683f0114 Reviewed-on: https://gerrit.libreoffice.org/64242 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-04fix opencl YIELDDISCLuboš Luňák2-0/+4
Otherwise the yielddisc unittest fails. Change-Id: I2ebb0fbf9d4aea6678c91d0289418991aa92dbb5 Reviewed-on: https://gerrit.libreoffice.org/64241 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-03check in opencl for MROUND to take exactly 2 argumentsLuboš Luňák1-0/+1
Otherwise the mround unittest fails in opencl mode. Change-Id: I6c8866495bbb44ff7dfc075ba4aac58d80dac7c7 Reviewed-on: https://gerrit.libreoffice.org/64240 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-03add a macro for detecting incorrect number of parameters in openclLuboš Luňák3-0/+29
Change-Id: Id8253537025cc373c1ff183c0059158489e11750 Reviewed-on: https://gerrit.libreoffice.org/64239 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>