summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-07-08 22:16:27 +0900
committerMichael Meeks <michael.meeks@collabora.com>2016-07-12 08:56:47 +0000
commitb535d0ae52089bc7e28024b76a3380ab91574466 (patch)
tree14329c062e9c77f3d48a4d201ccc7cf581b9f26b /vcl
parent1bb21a08054d6909725ac46be8a4d6d7e5141d7c (diff)
opencl: OpenCLZone, detect CL device change and disable CL on crash
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> (cherry picked from commit f41eb66302208f384a475fb20c98b6d1b0676cb6) Reviewed-on: https://gerrit.libreoffice.org/27099 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Library_vcl.mk1
-rw-r--r--vcl/source/app/svmain.cxx5
2 files changed, 6 insertions, 0 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 83383ff5898d..761fcbe90036 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -81,6 +81,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\
cppuhelper \
i18nlangtag \
i18nutil \
+ $(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
cppu \
sal \
salhelper \
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 2ebb805d2d1a..54aecfdcddae 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -85,6 +85,7 @@
#include <cppuhelper/implbase.hxx>
#include <uno/current_context.hxx>
+#include <opencl/OpenCLZone.hxx>
#include <opengl/zone.hxx>
#include <opengl/watchdog.hxx>
@@ -120,6 +121,10 @@ oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo
if (OpenGLZone::isInZone())
OpenGLZone::hardDisable();
#endif
+#if HAVE_FEATURE_OPENCL
+ if (OpenCLZone::isInZone())
+ OpenCLZone::hardDisable();
+#endif
}
// RC