path: root/desktop/source/app/opencl.cxx
AgeCommit message (Collapse)AuthorFilesLines
2020-04-14loplugin:flatten in desktopNoel Grandin1-21/+21
Change-Id: I1ab39e041025692cac06eb6602787f16a3a9cb0c Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-02-07merge OpenGLZone and OpenCLZone into one generic codeLuboš Luňák1-1/+1
To be used also by Skia code to detect problems with Vulkan drivers. The watchdog does not handle OpenCL because neither did the original code, but also because OpenCLZone::hardDisable() called from it would deadlock on SolarMutex for some reason. Change-Id: I483d8cb0b11a4e1e65c564f4e4c29ab68843ff71 Reviewed-on: Tested-by: Jenkins Reviewed-by: Luboš Luňák <>
2019-12-03Make OpenCLMinimumDataSize configuration property non-nillableStephan Bergmann1-1/+1
It had curiously been added as nillable (by default) alongside other properties that were added as non-nillable with ef809ce9480182ea5c4f77843f72d1d45bd48c35 "More work on the new OpenCL options", but with a non-nil default value, and no code sets a nil value, and ScModelObj::getFormulaCellNumberLimit, which reads its value and expects it to be non-nil, would cause UB if it was nil. So make it non-nillable and thereby simplify the code handling it. (Similar to how e8bb827571f540ac4af2247cb11239bb96876669 "Fixed cppheader.xsl nillable treatment" retrofitted lots of existing properties to be non-nillable in the past.) Change-Id: I60ac95025f363e346f3102ef80f38d00862e6e9a Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann1-1/+1
...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to <>, and our baseline for iOS and macOS is still Xcode 9.3 according to And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2019-10-30Fix Plugin::containsPreprocessingConditionalInclusionStephan Bergmann1-2/+1
...which had been broken since dfc0dc4801707b2d8080af1540625b43bd463e17 "loplugin:casttovoid: fix containsPreprocessingConditionalInclusion()", and, when range.getEnd() was a macro loc, would typically have wandered off past the end of the intended range, until it would have encountered some #if etc. and erroneously returned true. Fixed the fallout across the code base. While at it, added a clarifying comment and made the "lexing fails" cases that should never happen fail with a fatal error in debug mode. Change-Id: Ieff44548384426d7716b6fc6c836c9069d878729 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2019-10-15move HAVE_FEATURE_DESKTOP/OPENCL to their dedicated headersLuboš Luňák1-1/+1
HAVE_FEATURE_OPENCL is included by a common Calc header and HAVE_FEATURE_DESKTOP is included by a common Writer header, causing pretty much their full rebuilds if any feature changes. Change-Id: If29bf78bd4fd70b37981e0826a577777fd255c89 Reviewed-on: Tested-by: Jenkins Reviewed-by: Tor Lillqvist <>
2019-10-01loplugin:stringadd in dbaccess..desktopNoel Grandin1-2/+2
Change-Id: I79966c4b5947c87658980b26bea1e0c2898f3343 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-07-19cid#1448295 Unchecked return valueCaolán McNamara1-1/+1
Change-Id: I4b0dd4fc9051f04448a651cb87b449a58d2a5349 Reviewed-on: Tested-by: Jenkins Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2019-07-18cid#1448333 Unchecked return valueCaolán McNamara1-1/+1
Change-Id: If23db9a245b4dd4b59b9b5410a094f2f374eedfd Reviewed-on: Tested-by: Jenkins Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2019-06-15loplugin:logexceptionnicely in desktopNoel Grandin1-2/+3
Change-Id: I19f70b0e9d1ca2bbcd2595af24f2e15766d14b33 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin1-1/+1
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-04-29test in a separate helper process if OpenCL crashes (tdf#112252)Luboš Luňák1-1/+60
Some OpenCL implementations may be broken, e.g. pocl simply asserts and aborts if it can't find Clang. In order to protect against crashes caused by faulty OpenCL drivers, when testing OpenCL functionality on OpenCL setup change, first do a simple test in a separate helper. Change-Id: I1cf328e731c48f47745b27c7130e7521254209f5 Reviewed-on: Tested-by: Jenkins Reviewed-by: Luboš Luňák <>
2018-09-18make sure testOpenCLCompute() doesn't fail because of a stale lockfileLuboš Luňák1-0/+11
If the lockfile for the testing .ods stays around, e.g. because of a crash, the next loading will fail (because no UI interaction is allowed at that point) and so the whole openCL test will fail. Change-Id: Ic193003f52e407e47cd634773b6eb4cdefcc2753 Reviewed-on: Tested-by: Jenkins Reviewed-by: Luboš Luňák <>
2018-09-17New loplugin:externalStephan Bergmann1-1/+1
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2018-08-01Add missing sal/log.hxx headersGabor Kelemen1-0/+1
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 dbaccess to extensions Change-Id: I4d15aa35e11664ef78c836ffc2937c7e0bb6ea59 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
2017-10-23loplugin:includeform: desktopStephan Bergmann1-1/+1
Change-Id: I2dacb21cd0c9618dadb49912e0f09c9ab576f9b0
2017-10-04add << operator for css::uno::ExceptionNoel Grandin1-1/+1
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: Reviewed-by: Stephan Bergmann <> Tested-by: Jenkins <>
2017-08-25Get rid of need to use initial :: for ::opencl to avoid clash with sc::openclTor Lillqvist1-5/+5
Rename the global opencl namespace to openclwrapper. Its public API is after all declared in a file called openclwrapper.hxx. The confusion started when part of the OpenCL code was moved out from sc some years ago. Change-Id: I98ebd8498b2244804411e5de9169eb619f86070b
2017-07-02loplugin:casttovoid: desktopStephan Bergmann1-1/+0
Change-Id: Iea973ac2047c030019b70e6db37328d05058af08
2017-02-28new loplugin unoanyNoel Grandin1-1/+1
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2017-02-01Need <config_features.h> here, tooTor Lillqvist1-0/+1
Change-Id: I39d443e582a6e82947f9c833b157f137a082a358
2016-10-24tdf#103395 opencl: don't initialize OpenCL when disabledTomaž Vajngerl1-3/+1
If SAL_DISABLE_OPENCL is set we don't want to do any kind of OpenCL initialization. Put an extra guard in fillOpenCLInfo (and similar methods in opencl package) to prevent that. Put the check if OpenCL can be used into one place which checks SAL_DISABLE_OPENCL and UseOpenCL in configuration. Change-Id: Icc216d4299d3a7942843117ab9b9411de8075b11 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Tomaž Vajngerl <>
2016-10-17Force disable OpenCL in Safe ModeSamuel Mehrbrodt1-0/+1
Change-Id: I046eb2a01c528945232cedabbf5fa08483c9e057 Reviewed-on: Reviewed-by: Samuel Mehrbrodt <> Tested-by: Samuel Mehrbrodt <>
2016-10-01Fix typosAndrea Gelmini1-1/+1
Change-Id: I8374d6d08f4eb4ae2821e213371c615b92d7e9ab Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2016-08-14tdf#100965: Restart on initialisation-time OpenCL crashTor Lillqvist1-0/+1
Add a flag to the OpenCLZone indicating whether we are performing the first-start OpenCL functionality verification, so that if we run into a crash that is caught by the VCL VCLExceptionSignal_impl() handler, we terminate the process with the EXITHELPER_NORMAL_RESTART status after first having disabled OpenCL use. The wrapper process will then restart soffice.bin. This is for Windows only so far. This matches what we do if OpenGL fails early during start of LibreOffice. Change-Id: Ibb9bf3a86b7521bf16728de2a118ad4323be674b Reviewed-on: Reviewed-by: Tor Lillqvist <> Tested-by: Tor Lillqvist <>
2016-07-28desktop: fix Android buildMiklos Vajna1-0/+2
Change-Id: I1ea8edba2dc34386c2748c3ee2310963252082e6
2016-07-25Fix some misleading commentsTor Lillqvist1-4/+2
Change-Id: I0f29133c3e9b881835b970b2226583ec348828cb
2016-07-12tdf#100883 - opencl impls. that use SEH are still bad.Michael Meeks1-0/+12
Amazingly we fell-back to the old calculation path for crashes in older LibreOffices, might as well have this on master. Change-Id: Ifc1de41c93329207d7a1917c736e361d840c2821 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Michael Meeks <>
2016-07-12opencl: bail out early in missing OpenCL case.Michael Meeks1-0/+1
Change-Id: I2ff1466ec89f4ad9743cedbfa5dd52be8bf86590 Reviewed-on: Reviewed-by: Tomaž Vajngerl <> Tested-by: Tomaž Vajngerl <>
2016-07-12desktop: validate OpenCL drivers before use.Michael Meeks1-0/+173
OpenCL validation needs to happen before drivers are used in anger. This should isolate any crashes, and/or mis-behavior to We use app version, CL driver version and file time-stamp to trigger re-testing the device. If anything fails: hard disable OpenCL. We use an opencl validation sheet (cl-test.ods) and install it. It is a minimal CL set - it requires a very short formula group length, and combines several CL functions into few formulae to test more. The sheet structure, in particular the manual squaring / SQRT is necessary to stick within the default CL subset, and ensure that formulae are CL enabled from the root of the dependency tree up. Change-Id: I18682dbdf9a8ba9c16d52bad4447e9acce97f0a3 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Michael Meeks <>