1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <opencl/openclwrapper.hxx>
11 #include <opencl/OpenCLZone.hxx>
12 #include <opencl_device.hxx>
16 #include <officecfg/Office/Common.hxx>
17 #include <com/sun/star/util/XFlushable.hpp>
18 #include <com/sun/star/configuration/theDefaultProvider.hpp>
21 * Called from a signal handler if we get
22 * a crash or hang in some CL code.
24 void OpenCLZone::hardDisable()
26 // protect ourselves from double calling etc.
27 static bool bDisabled
= false;
33 std::shared_ptr
<comphelper::ConfigurationChanges
> xChanges(
34 comphelper::ConfigurationChanges::create());
35 officecfg::Office::Common::Misc::UseOpenCL::set(false, xChanges
);
38 // Force synchronous config write
40 = css::configuration::theDefaultProvider::get(comphelper::getProcessComponentContext());
41 css::uno::Reference
<css::util::XFlushable
> xFlushable(xConfProvider
, css::uno::UNO_QUERY_THROW
);
44 releaseOpenCLEnv(&openclwrapper::gpuEnv
);
47 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */