summaryrefslogtreecommitdiff
path: root/opencl
AgeCommit message (Collapse)Author
2016-11-24tdf#103395 opencl: don't initialize OpenCL when disabledTomaž Vajngerl
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. Reviewed-on: https://gerrit.libreoffice.org/30025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 21e8ed8b5f032f63012a7ee84bce64fac218154f) Change-Id: Icc216d4299d3a7942843117ab9b9411de8075b11 Reviewed-on: https://gerrit.libreoffice.org/30220 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 5f36c66183049522977a386d9afce462ac5d3ec0)
2016-11-24tdf#103204 opencl: initialize command queue on demandTomaž Vajngerl
Change-Id: Ie3da1d6ec91e951b1ffc15abf376c7af57789e47 Reviewed-on: https://gerrit.libreoffice.org/29802 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 4eea4af8924e3b1bb00c22cf1f9d21fc4dec6e83) Reviewed-on: https://gerrit.libreoffice.org/29994 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 4969015d138cbd9b20bf3a9bee0af9d6222f1a68)
2016-11-24tdf#100965: Restart on initialisation-time OpenCL crashTor Lillqvist
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. Also, the enter() and leave() functions are not used anywhere (cherry picked from commit 32881f01833dbcefd5600e1135dd8743178bfd96) (cherry picked from commit b9898f03eb05411c508b1b02588812074d40417a) Reviewed-on: https://gerrit.libreoffice.org/28138 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit e2d5eec6ad49bab6aac2295a1882bf75184aa50c) Change-Id: Ibb9bf3a86b7521bf16728de2a118ad4323be674b
2016-07-29Need to try to avoid TDR also with NVIDIA cards on Windows 7 or earlierLaszlo Nemeth
(TDR is Timeout detection and recovery, was introduced in Vista.) Change-Id: If88f8e9e2aff2a5ffd633607ee6aebb5614c5caf Reviewed-on: https://gerrit.libreoffice.org/27522 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit cb7b91e9946fdf628b750bcfd318545f8a033b34)
2016-07-13tdf#100883 - opencl impls. that use SEH are still bad.Michael Meeks
Amazingly we fell-back to the old calculation path for crashes in older LibreOffices. Change-Id: Ia182f7a25c5560b68494d5cdd68e02925bfd5845 Reviewed-on: https://gerrit.libreoffice.org/27164 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 2b1f1030bf642d1b9c8af91aa78683a9fb95e6f4)
2016-07-13desktop: validate OpenCL drivers before use.Michael Meeks
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. Reviewed-on: https://gerrit.libreoffice.org/27131 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit c44726c48228d9c6a5960e302b1c0bd16b0099c4) + opencl: bail out early in missing OpenCL case. (cherry picked from commit 605a5dc088385ad21c33028d8107125c0316ddb1) + Remove bogus dependency from opencl to configmgr Since f41eb66302208f384a475fb20c98b6d1b0676cb6 "opencl: OpenCLZone, detect CL device change and disable CL on crash" vcl links against opencl (so indirectly linked against configmgr), which caused CppunitTest_configmgr_unit to include the configmgr object files both statically (through gb_CppunitTest_use_library_objects) and through the linked-in configmgr dynamic library, which in turn caused ASan builds to report an ODR violation for a doubly defined 'typeinfo name for configmgr::Access'. (cherry picked from commit 9c711f05fa10dc70e4257a1f48d43f539353541a) Reviewed-on: https://gerrit.libreoffice.org/27146 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 9befbe1f81a7930e167e0a711666b0779898c12e) Change-Id: I18682dbdf9a8ba9c16d52bad4447e9acce97f0a3
2016-07-13opencl: OpenCLZone, detect CL device change and disable CL on crashTomaž Vajngerl
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. Reviewed-on: https://gerrit.libreoffice.org/27064 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit f41eb66302208f384a475fb20c98b6d1b0676cb6) Change-Id: I1a8b81ee31298731efcf63dc6a476955afc035e9 Reviewed-on: https://gerrit.libreoffice.org/27103 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit e1ef22371613f384cc2f6fc75d022cb01bf92af7)
2016-07-08cui: add calculation mode to Help->About.Michael Meeks
Reviewed-on: https://gerrit.libreoffice.org/26964 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit adc3932dfc4fe763b7db0af8843b01614bdc6aa2) Change-Id: I4765436bed8a58c5097afcf7dce768d3ec325015 Reviewed-on: https://gerrit.libreoffice.org/27004 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 2a93d7221672d4fec38a265780af114d2756dbfc)
2016-06-07Ensure that OpenCL device id returned from getDeviceSelection() is valid.cp-5.1-branch-pointMark Hung
Possible fix for tdf#100104 Reviewed-on: https://gerrit.libreoffice.org/24959 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 40b0b9ab7703a165295b008f47df14d2ec076fb1) Change-Id: I756bb57d471db3d3ca1d9c3733d359c7c16b4e66 Reviewed-on: https://gerrit.libreoffice.org/25964 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-05-18backport of opencl coverity fixesCaolán McNamara
includes: coverity#1358843 Argument cannot be negative 77327a03904ad7d6f58b07ec698cd15f02a4d6fa coverity#1358844 Uninitialized pointer field 478a4032da69654245d478e15902feda1e49c84c Change-Id: I1a978106d2909169c5d10755ae88a69889d86274 Reviewed-on: https://gerrit.libreoffice.org/24913 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-04-25tdf#99453 opencl: better logging of devices and device selectionTomaž Vajngerl
changes: - Clew misses a lot of things, added defines needed for gathering platform and device info. - Refactored profile saving and loading to use libxml2 instead the weird type of saving the profile data. - Added an additional "log" file which is similar to the OpenGL but it writes the OpenCL relevant information like which devices and platforms are available (+ all the extra useful version information) and which device was selected (if any at all). (cherry picked from commit 334e2dc9c3da4519e31e0452a40d3a958c401876) Change-Id: I0fe793c756f8f4f1761fe120fc361df36e581903 Reviewed-on: https://gerrit.libreoffice.org/24303 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-11-11new loplugin: memoryvarNoel Grandin
detect when we can convert a new/delete sequence on a local variable to use std::unique_ptr Change-Id: Iecae4e4197eccdfacfce2eed39aa4a69e4a660bc Reviewed-on: https://gerrit.libreoffice.org/19884 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite; Mac-specific code)Stephan Bergmann
Change-Id: I414c1e7fa1b13d23f15f82d883ab95cf11f09299
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I60189077f872dd5da3633b15b67b7b7729a75d0d
2015-10-07clang-analyzer-deadcode.DeadStoresStephan Bergmann
Change-Id: I95404b553f594ced1e2e8b4b8ddf34c08180128f
2015-10-01loplugin:unusedmethodsNoel Grandin
- improvements to the plugin to find more method calls - improvements to python script to remove more false+ - fix the FORCE_COMPILE_ALL build flag to include code in the $WORKDIR Change-Id: I4d6015dcb9b9d60c26f0bcee8abad807177a7836 Reviewed-on: https://gerrit.libreoffice.org/19064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-09-29loplugin:removeunusedmethods, remove unused stuffNoel Grandin
Change-Id: I35456b2a3ad2a84a1d045f09cdfb29e4c19b8350
2015-09-16YAGNITor Lillqvist
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 Lillqvist
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 McNamara
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-08-26Log OpenCL errors symbolically here, tooTor Lillqvist
Change-Id: I96ef317e974a9db1713ad3005d0efcecb2bacda5
2015-08-26Revert "Enable out-of-order kernel execution"Tor Lillqvist
Is not a good idea after all, says mmeeks. Plus, we should check if the device actually supports it (with clGetDeviceInfo (CL_DEVICE_QUEUE_PROPERTIES) before attempting to use it. This reverts commit a4681be5347fe24867b4f603dc57942c3306227b. Change-Id: I11896ab2d40bd8abcb11a21ce5df4eb75816013a
2015-06-17Replace boost::scoped_array<T> with std::unique_ptr<T[]>Takeshi Abe
This may reduce some degree of dependency on boost. Done by running a script like: git grep -l '#include *.boost/scoped_array.hpp.' \ | xargs sed -i -e 's@#include *.boost/scoped_array.hpp.@#include <memory>@' git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \ | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/' ... and then killing duplicate or unnecessary includes, while changing manually m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx, extensions/source/ole/unoconversionutilities.hxx, and extensions/source/ole/oleobjw.cxx. Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-08loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann
Change-Id: I1c8cf28803694f81985b9d1c61c62d28158a2f71
2015-06-02loplugin:cstylecast: deal with those that are (technically) const_castStephan Bergmann
Change-Id: I69193471b9633902d92d0db34b266af52038146a
2015-04-22Various #include <sal/log.hxx> fixupsStephan Bergmann
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. Cleaned up some, but something like grep -FwL sal/log.hxx $(git grep -Elw \ 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF') -- \*.cxx) shows lots more files that potentially need fixing before the include can be removed from rtl/string.hxx and rtl/ustring.hxx. Change-Id: Ibf033363e83d37851776f392dc0b077381cd8b90
2015-03-28Clean up C-style casts from pointers to voidStephan Bergmann
Change-Id: I7e6315bf2a2e3d6e089ef8f5eacc69d2b413374a
2015-03-20Typo: (O/o)veride(n)->(O/o)verride(n)Julien Nabet
Change-Id: Ied81ede9aaf045866596adc40d357cbbddb3d704
2015-03-02OpenCL: correctly handle platforms without devicesGiuseppe Bilotta
When an OpenCL platform has no devices (of the requested type), calls to clGetDeviceIDs() are required to return with the error value CL_DEVICE_NOT_FOUND. Some platforms (e.g. Clover as of Mesa 10.4.2) do not touch their output parameters in such cases, which means that in some conditions the `num` variable where the number of devices of the platform should be stored may be used uninitialized. This can lead to segmentations faults in the subsequent calls to clGetDeviceInfo(). Simply reinitializing num to 0 is sufficient to prevent the segfault in the case of Mesa, but proper error handling is included for completeness. Change-Id: Ia25192f6aa953838a545a9e7c9fca050d2703b60 Reviewed-on: https://gerrit.libreoffice.org/14700 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2015-02-10Add SAL_INFOs for tracing kernel and program life cycleTor Lillqvist
Change-Id: Icb28114d3939063dedaedbd0ce370210b3721fc5
2015-02-06shared_ptr<T>(new T(args)) -> make_shared<T>(args)Caolán McNamara
and boost:make_shared->std::make_shared Change-Id: Ic1e187c52c856a7b27817967b2caa8920f23a98d
2015-02-06Move OpenCLError::strerror() from sc to opencl, and rename to errorString()Tor Lillqvist
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 Lillqvist
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-20Some more loplugin:cstylecast: openclStephan Bergmann
Change-Id: I93c590a71ea768511a89d6fe17dc7aa01fe73b02
2015-01-19Fix typo comments Resouce->ResourceAndrea Gelmini
Change-Id: Ia3195a21ad46b4c9830ee6293135dfe5945986a2 Reviewed-on: https://gerrit.libreoffice.org/13985 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-07Set up foundation for supporting multiple OpenCL command queues per device.Kohei Yoshida
Change-Id: Ia63c8bd6552cdbc2b5eabadaa044b9f1eca5f664
2014-12-18opencl: Use appropriate OUString functions on string constantsStephan Bergmann
Change-Id: I0c461fa2c2ac62f9dd63e793f8cbc0c68c510082
2014-12-17Enable out-of-order kernel execution.Kohei Yoshida
Change-Id: I4dbc69ca2618c37184ffdc217493e3880e149617
2014-12-08Don't treat clew as part of an "external" clcc moduleTor Lillqvist
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-27The OpenCLEnv struct is used only inside openclwrapper.cxxTor Lillqvist
Change-Id: I95fbee302213e6ced469dd7a2a1c254178159357
2014-11-27Clean up confusing OpenCL code a bitTor Lillqvist
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-27Need -lrt for clock_gettime() with older glibc versionsTor Lillqvist
Change-Id: I4651f74a89b8707cbf0ebdd3b950df3a5b99177a
2014-11-27Use correct SAL_INFO log areaTor Lillqvist
Change-Id: I47e6dcf18fe141b8dba33a8c3cd83f80950045cd
2014-11-27Move more Calc-independent OpenCL stuff from the sc to the opencl moduleTor Lillqvist
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-27Add a README fileTor Lillqvist
Change-Id: Id0f8a146ca90efe6f84c7a0c377ad3f83ba7da8d
2014-11-27Work in progress: Move Calc-independend OpenCL configuration out of scTor Lillqvist
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