diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2016-07-11 15:12:38 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-07-13 21:14:18 +0200 |
commit | 9252f2a95a07fff2d97f71d3b8f93ebef355abea (patch) | |
tree | cefd952fabc0a1c1f0c256be67330778a403243f /sc | |
parent | e79f63ee76b2c4dd2e47c250e07931433305855c (diff) |
desktop: validate OpenCL drivers before use.
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
Diffstat (limited to 'sc')
-rw-r--r-- | sc/Module_sc.mk | 1 | ||||
-rw-r--r-- | sc/Package_opencl.mk | 16 | ||||
-rw-r--r-- | sc/source/core/opencl/cl-test.ods | bin | 0 -> 18186 bytes | |||
-rw-r--r-- | sc/source/core/tool/formulagroup.cxx | 21 |
4 files changed, 19 insertions, 19 deletions
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index d656f71f3e5e..e135e300817c 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -15,6 +15,7 @@ $(eval $(call gb_Module_add_targets,sc,\ Library_scd \ Library_scfilt \ $(call gb_Helper_optional,DESKTOP,Library_scui) \ + $(call gb_Helper_optional,OPENCL,Package_opencl) \ )) $(eval $(call gb_Module_add_l10n_targets,sc,\ diff --git a/sc/Package_opencl.mk b/sc/Package_opencl.mk new file mode 100644 index 000000000000..ef1579f52eb5 --- /dev/null +++ b/sc/Package_opencl.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Package_Package,sc_opencl_runtimetest,$(SRCDIR)/sc/source/core/opencl)) + +$(eval $(call gb_Package_add_files,sc_opencl_runtimetest,$(LIBO_ETC_FOLDER)/opencl,\ + cl-test.ods \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/source/core/opencl/cl-test.ods b/sc/source/core/opencl/cl-test.ods Binary files differnew file mode 100644 index 000000000000..8380e0b93a83 --- /dev/null +++ b/sc/source/core/opencl/cl-test.ods diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx index abe92e89ec31..8f166ceeb190 100644 --- a/sc/source/core/tool/formulagroup.cxx +++ b/sc/source/core/tool/formulagroup.cxx @@ -338,26 +338,9 @@ bool FormulaGroupInterpreter::switchOpenCLDevice(const OUString& rDeviceId, bool return false; delete msInstance; - msInstance = nullptr; + msInstance = new sc::opencl::FormulaGroupInterpreterOpenCL(); - if (bOpenCLEnabled) - { - msInstance = new sc::opencl::FormulaGroupInterpreterOpenCL(); - - if (aSelectedCLDeviceVersionID != officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::get()) - { - // perform OpenCL calculation tests - - // save the device - std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::set(aSelectedCLDeviceVersionID, xBatch); - xBatch->commit(); - } - - return msInstance != nullptr; - } - - return false; + return true; } void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int32& rPlatformId) |