summaryrefslogtreecommitdiff
path: root/include/opencl
AgeCommit message (Collapse)AuthorFilesLines
2019-11-03make some classes module-privateNoel Grandin1-2/+2
improve the script, but it still generates some false positives Change-Id: If8ee1cba8c04ac0be11f73220149e6de15f24f44 Reviewed-on: https://gerrit.libreoffice.org/81929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-27Silence false cid#1454000 "Side effect in assertion"Stephan Bergmann1-0/+1
The side effect is intentional here. Change-Id: I05d166bb312ea3a97905607c5effccf1e8d8eef7 Reviewed-on: https://gerrit.libreoffice.org/79668 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-18-Werror=volatile in OpenCLZoneStephan Bergmann1-7/+11
Recent GCC 10 trunk in C++20 mode reports issues like > include/opencl/OpenCLZone.hxx:27:9: error: ‘++’ expression of ‘volatile’-qualified type is deprecated [-Werror=volatile] > 27 | gnEnterCount++; > | ^~~~~~~~~~~~ But unlike in the case of ec17c8ec5256386b0197a8ffe5d7cad3e7d70f8f "-Werror=volatile in OpenGLZone", * it looks like there are no multi-threading issues here, and the counters are just accessed (via OpenCLZone::isInZone) from the VCLExceptionSignal_impl signal handler in addition to being modified (via OpenCLZone RAII objects) from mainline code; and * from the usage pattern of gnEnterCount and gnLeaveCount it appears that they can be combined into a single counter. (f41eb66302208f384a475fb20c98b6d1b0676cb6 "opencl: OpenCLZone, detect CL device change and disable CL on crash" presumably modelled OpenCLZone naively after OpenGLZone, without simplifying it where possible.) One minor advantage of having two monotonically increasing counters is that when they overflow, the implementation of isInZone (comparing them for equality) still gives ~useful results (assuming that a false "match" of non-overflown gnEnterCount against overflown gnLeaveCount is highly unlikely). But instances of OpenCLZone RAII objects are presumably never nested very deeply (if at all), so that the newly added "TODO: overflow" comment (which would even cause UB if std::sig_atomic_t is signed) is probably of no practical concern. Change-Id: I92e1f2c46ca996a0a86bacabcda2accba5eb6298 Reviewed-on: https://gerrit.libreoffice.org/79106 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-29test in a separate helper process if OpenCL crashes (tdf#112252)Luboš Luňák1-0/+2
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: https://gerrit.libreoffice.org/71080 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-10-24tdf#42949 Fix IWYU warnings in include/opencl/*Gabor Kelemen2-6/+6
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I76f15a8e7724384e8ba773621bdcac1351b32a0a Reviewed-on: https://gerrit.libreoffice.org/62086 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-08-25Get rid of need to use initial :: for ::opencl to avoid clash with sc::openclTor Lillqvist1-1/+1
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
2016-10-24tdf#103395 opencl: don't initialize OpenCL when disabledTomaž Vajngerl1-1/+4
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: https://gerrit.libreoffice.org/30025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-18tdf#103204 opencl: initialize command queue on demandTomaž Vajngerl1-0/+1
Change-Id: Ie3da1d6ec91e951b1ffc15abf376c7af57789e47 Reviewed-on: https://gerrit.libreoffice.org/29802 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-08-14tdf#100965: Restart on initialisation-time OpenCL crashTor Lillqvist1-0/+9
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: https://gerrit.libreoffice.org/28086 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-08-12The enter() and leave() functions are not used anywhereTor Lillqvist1-8/+0
Change-Id: I42d2d6a12d49fc60c625dc2d230f70d05cf67673
2016-07-26Need to try to avoid TDR also with NVIDIA cards on Windows 7 or earlierLaszlo Nemeth1-1/+1
(TDR is Timeout detection and recovery, was introduced in Vista.) Change-Id: Ic49629adf7630e61cebcdfcc431ca96ba3fbaf7e Reviewed-on: https://gerrit.libreoffice.org/27518 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2016-07-12tdf#100883 - opencl impls. that use SEH are still bad.Michael Meeks1-0/+1
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: https://gerrit.libreoffice.org/27166 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-07-11opencl: OpenCLZone, detect CL device change and disable CL on crashTomaž Vajngerl2-1/+55
Guard OpenCL calls with OpenCLZone, so if a OpenCL call crashes we detect this and disable OpenCL so next time the user doesn't encounter the crash at the same calculation because he has a broken OpenCL drivers. Similar has been implemented for OpenGL with good results. Additionaly we persistently remember a known good OpenCL device ID and driver version so we can match this and perform calculation tests when they change. This is to ensure that the selected OpenCL device performs as we expect. In this commit the calculation tests aren't included yet. Remove complex static initializer in opencl wrapper library. Change-Id: I1a8b81ee31298731efcf63dc6a476955afc035e9 Reviewed-on: https://gerrit.libreoffice.org/27064 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-07-01tdf#90336 - further cleanup of OpenCL options page.Michael Meeks1-1/+4
Still problematic; since we only show OpenCL as being available if it has already been initialized and used. Change-Id: I5e82a3f778f4f2025408330b6d9da51402d01e79 Reviewed-on: https://gerrit.libreoffice.org/26866 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-04-12cleanup: remove unused com/sun/star/uno includesJochen Nitschke1-2/+0
Sequence.h(xx), Any.h(xx) and Type.h(xx) and remove unused using-declarations from these files. Add a few missing includes provided by them. Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4 Reviewed-on: https://gerrit.libreoffice.org/23805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-12-15No need for <config_features.h> hereTor Lillqvist1-2/+0
Change-Id: Ieccd31d3cefd2fc397a296827de29d834ce093f0
2015-11-24loplugin:unusedfields in include/oox/Noel Grandin1-1/+0
Change-Id: Ie7a53f3ecc05d1d4f6f71aa8165315f9155c60dc
2015-09-16YAGNITor Lillqvist1-1/+0
We use only one OpenCL device per context or program, so get rid of half-implemented (or half-reverted?) "support" for multiple devices per context. Change-Id: I951f29e867e5b3f96f6e051567ee38d607bd7ecf
2015-09-15Split formula group for OpenCL up into smaller bits when necessaryTor Lillqvist1-0/+1
Will make it less demanding on low-end hardware, where the device driver is unresponsive for too long when an OpenCL kernel handling lots of data is executing. This makes Windows restart the driver which is problematic. I tried several approaches of splitting, both at higher levels in sc and at the lowest level just before creating and executing the OpenCL kernel(s). This seems to be the most minimal and local approach. Doing it at the lower level would have required too much poking into our obscure OpenCL code, like passing an offset parameter to every kernel. Use a simple heuristic to find out whether to split. On the problematic low-end devices, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT is 4, while for more performant devices it is 1 or 8.
2015-09-14boost->stdCaolán McNamara1-1/+0
Change-Id: I3fd9e1599c5ad812879a58cf1dabbcd393105e1c Reviewed-on: https://gerrit.libreoffice.org/18564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-02-06Move OpenCLError::strerror() from sc to opencl, and rename to errorString()Tor Lillqvist1-0/+6
There is nothing Calc-specific in this function, and surely it will be good to output OpenCL errors symbolically also in the opencl module. Change-Id: Ibe7d0d036f24dd87e06b8290224e1033dda0f3d1
2015-02-05The horrible CHECK_OPENCL() fortunately is used only in openclwrapper.cxxTor Lillqvist1-8/+0
So move it there. While at it, make it use SAL_WARN() instead of printf. Also, add a few more SAL_WARN() and SAL_INFO(). Change-Id: Ib058fb20d07757331ca364a8d7649abc59e9494b
2015-01-07Set up foundation for supporting multiple OpenCL command queues per device.Kohei Yoshida1-1/+9
Change-Id: Ia63c8bd6552cdbc2b5eabadaa044b9f1eca5f664
2014-12-08Don't treat clew as part of an "external" clcc moduleTor Lillqvist2-2/+2
There is no obvious authoritative upstream for clew anyway, so it causes philosophical problems for distros. For a while, we used to use a zip archive from the "clcc" project on SourceForge that included clew.c and clew.h. (Before that we also just had clew.c and clew.h in our source repo.) So, drop the external/clcc module and have clew.c and clew.h in the source repo again. But this time clew is in a module of its own, not in sc. This re-introduces "No need to have OpenCL optional at configure-time" This reverts commit 764836cb00e8e6dfd2ab48e080a166ec90359e01. Change-Id: I413142f4f9f8399489f9c3e5327132822f07a454 Reviewed-on: https://gerrit.libreoffice.org/13368 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2014-11-28The compiler-generated dtor is good enough, no need for thisTor Lillqvist1-3/+0
Change-Id: Ib72e0df4ac3ca90d440a32359e711d77e758cca0
2014-11-27Put the KernelEnv struct inside the opencl namespace, tooTor Lillqvist1-2/+2
Change-Id: I33d51b0e30445c34c792210e7c656c1d48159019
2014-11-27The OpenCLEnv struct is used only inside openclwrapper.cxxTor Lillqvist1-8/+0
Change-Id: I95fbee302213e6ced469dd7a2a1c254178159357
2014-11-27Clean up confusing OpenCL code a bitTor Lillqvist1-19/+4
Get rid of the silly OpenCLDevice class that had only static members. We can as well just use namespacing. Remove functions only used internally in openclwrapper.cxx from the now public openclwrapper.hxx header. Change-Id: If7336edd262c772564dc13e64113d72d0b52428c
2014-11-27Move more Calc-independent OpenCL stuff from the sc to the opencl moduleTor Lillqvist1-0/+109
No cleanups yet. Just removed the "sc" namespace parts now when this stuff is no longer Calc-specific. There is still horribly confusing use of the same OpenCLDevice name for both a class and as a namespace, for instance. And the OpenCLDevice class has only public static members even, so effectively it acts as just a namespace anyway... Etc. Change-Id: Idc5f30a721df0101426c676f04a85e02c5dc8443
2014-11-27Try to fix MSVC buildTor Lillqvist1-0/+3
Change-Id: I24c48d2540a8cb7d2a823862d53cddf90d41f94a
2014-11-27Work in progress: Move Calc-independend OpenCL configuration out of scTor Lillqvist3-0/+185
Intermediate commit. More changes will follow: The device selection logic needs to be moved, too. (And cleaned up.) Instead of the separate formulacalculationoptions dialog we should simply have a normal options page for those OpenCL-related settings that will remain purely Calc-specific, like the formula opcode subsetting. Change-Id: Id60d95e80d377cbbf5780beb473b221bce06b5e5