[Libreoffice-commits] core.git: config_host.mk.in configure.ac cui/Library_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk include/opencl officecfg/registry opencl/Library_opencl.mk opencl/Makefile opencl/Module_opencl.mk opencl/source Repository.mk RepositoryModule_host.mk sc/CppunitTest_sc_opencl_test.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/Library_sc.mk sc/Library_scui.mk sc/qa sc/source sc/uiconfig
Tor Lillqvist
tml at collabora.com
Thu Nov 27 01:08:43 PST 2014
Repository.mk | 1
RepositoryModule_host.mk | 1
config_host.mk.in | 1
configure.ac | 8
cui/Library_cui.mk | 6
cui/UIConfig_cui.mk | 3
cui/source/inc/cuires.hrc | 2
cui/source/options/optgdlg.cxx | 10
cui/source/options/optgdlg.hxx | 2
cui/source/options/optopencl.cxx | 283 ++++++++++
cui/source/options/optopencl.hxx | 71 ++
cui/source/options/treeopt.cxx | 2
cui/source/options/treeopt.src | 1
cui/uiconfig/ui/blackorwhitelistentrydialog.ui | 281 ++++++++++
cui/uiconfig/ui/optgeneralpage.ui | 41 -
cui/uiconfig/ui/optopenclpage.ui | 349 +++++++++++++
include/opencl/openclconfig.hxx | 100 +++
include/opencl/opencldllapi.h | 34 +
include/opencl/platforminfo.hxx | 51 +
officecfg/registry/schema/org/openoffice/Office/Calc.xcs | 14
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 14
opencl/Library_opencl.mk | 42 +
opencl/Makefile | 14
opencl/Module_opencl.mk | 16
opencl/source/openclconfig.cxx | 256 +++++++++
opencl/source/platforminfo.cxx | 46 +
sc/CppunitTest_sc_opencl_test.mk | 1
sc/CppunitTest_sc_ucalc.mk | 4
sc/Library_sc.mk | 12
sc/Library_scui.mk | 1
sc/inc/calcconfig.hxx | 59 --
sc/inc/formulagroup.hxx | 2
sc/inc/platforminfo.hxx | 50 -
sc/qa/unit/opencl-test.cxx | 2
sc/source/core/inc/openclwrapper.hxx | 5
sc/source/core/opencl/opencl_device.cxx | 11
sc/source/core/opencl/openclwrapper.cxx | 83 ---
sc/source/core/tool/calcconfig.cxx | 43 -
sc/source/core/tool/formulagroup.cxx | 3
sc/source/core/tool/formulaopt.cxx | 101 ---
sc/source/core/tool/platforminfo.cxx | 48 -
sc/source/ui/optdlg/calcoptionsdlg.cxx | 207 -------
sc/source/ui/optdlg/calcoptionsdlg.hxx | 29 -
sc/source/ui/unoobj/docuno.cxx | 8
sc/uiconfig/scalc/ui/formulacalculationoptions.ui | 260 ---------
45 files changed, 1617 insertions(+), 961 deletions(-)
New commits:
commit c1d09b1ad02160850d40c0d242a0d0ec0a8dc1bc
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Nov 26 22:30:33 2014 +0200
Work in progress: Move Calc-independend OpenCL configuration out of sc
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
diff --git a/Repository.mk b/Repository.mk
index 5476f89..b124c91 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -402,6 +402,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
odfflatxml \
offacc \
oox \
+ $(call gb_Helper_optional,OPENCL,opencl) \
passwordcontainer \
pcr \
$(if $(ENABLE_NPAPI_FROM_BROWSER),pl) \
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 6190e4b..4ad30ff 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -82,6 +82,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
officecfg \
oovbaapi \
oox \
+ $(call gb_Helper_optional,OPENCL,opencl) \
package \
postprocess \
$(call gb_Helper_optional,PYUNO,pyuno) \
diff --git a/config_host.mk.in b/config_host.mk.in
index a23629f..58e8899 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -157,7 +157,6 @@ export ENABLE_ONLINE_UPDATE=@ENABLE_ONLINE_UPDATE@
export ENABLE_OOENV=@ENABLE_OOENV@
export ENABLE_OPENGL=@ENABLE_OPENGL@
export ENABLE_OPENGL_CANVAS=@ENABLE_OPENGL_CANVAS@
-export ENABLE_OPENCL=@ENABLE_OPENCL@
export ENABLE_PACKAGEKIT=@ENABLE_PACKAGEKIT@
export ENABLE_PCH=@ENABLE_PCH@
export ENABLE_PDFIMPORT=@ENABLE_PDFIMPORT@
diff --git a/configure.ac b/configure.ac
index 92a2d1b..316bfb0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10261,13 +10261,13 @@ dnl =================================================
dnl Check whether to build with OpenCL support.
dnl =================================================
-ENABLE_OPENCL=
if test $_os != iOS -a $_os != Android; then
- ENABLE_OPENCL=TRUE
- BUILD_TYPE="$BUILD_TYPE CLCC"
+ # CLCC in BUILD_TYPE tells that we are building a bundled clcc (just the clew part), OPENCL in
+ # BUILD_TYPE tells that OpenCL is potentially available on the platform (optional at run-time,
+ # used through clew).
+ BUILD_TYPE="$BUILD_TYPE CLCC OPENCL"
AC_DEFINE(HAVE_FEATURE_OPENCL)
fi
-AC_SUBST(ENABLE_OPENCL)
dnl ===================================================================
dnl Check whether to enable glTF support
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index b821f2a..b564e4d 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -44,6 +44,8 @@ $(eval $(call gb_Library_use_libraries,cui,\
$(if $(ENABLE_JAVA), \
jvmfwk) \
lng \
+ $(call gb_Helper_optional,OPENCL, \
+ opencl) \
sal \
salhelper \
sax \
@@ -64,6 +66,8 @@ $(eval $(call gb_Library_use_libraries,cui,\
$(eval $(call gb_Library_use_externals,cui,\
boost_headers \
+ $(call gb_Helper_optional,OPENCL,\
+ clew) \
icuuc \
icu_headers \
))
@@ -153,6 +157,8 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/options/optjsearch \
cui/source/options/optlingu \
cui/source/options/optmemory \
+ $(call gb_Helper_optional,OPENCL, \
+ cui/source/options/optopencl) \
cui/source/options/optpath \
cui/source/options/optsave \
cui/source/options/optupdt \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 70438d4..d8cd178 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -28,6 +28,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/backgroundpage \
cui/uiconfig/ui/baselinksdialog \
cui/uiconfig/ui/bitmaptabpage \
+ cui/uiconfig/ui/blackorwhitelistentrydialog \
cui/uiconfig/ui/borderareatransparencydialog \
cui/uiconfig/ui/borderbackgrounddialog \
cui/uiconfig/ui/borderpage \
@@ -131,6 +132,8 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/optmemorypage \
cui/uiconfig/ui/optnewdictionarydialog \
cui/uiconfig/ui/optonlineupdatepage \
+ $(call gb_Helper_optional,OPENCL, \
+ cui/uiconfig/ui/optopenclpage) \
cui/uiconfig/ui/optpathspage \
cui/uiconfig/ui/optproxypage \
cui/uiconfig/ui/optsavepage \
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index d25afbb..f2202c2 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -436,6 +436,8 @@
#define RID_SVXSTR_PERSONA_MUSIC (RID_SVX_START + 1288)
#define RID_SVXSTR_PERSONA_NATURE (RID_SVX_START + 1289)
+#define RID_SVXPAGE_OPENCL (RID_SVX_START + 254)
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index c449eb0..e68743d 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -209,7 +209,6 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
get(m_pYearValueField, "year");
get(m_pToYearFT, "toyear");
get(m_pCollectUsageInfo, "collectusageinfo");
- get(m_pUseOpenCL, "useopencl");
if (m_pFileDlgCB->IsVisible() && SvtMiscOptions().IsUseSystemFileDialogReadOnly())
{
@@ -302,12 +301,6 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
bModified = true;
}
- if (m_pUseOpenCL->IsValueChangedFromSaved())
- {
- officecfg::Office::Common::Misc::UseOpenCL::set(m_pUseOpenCL->IsChecked(), batch);
- bModified = true;
- }
-
batch->commit();
return bModified;
@@ -349,9 +342,6 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
m_pCollectUsageInfo->Check(officecfg::Office::Common::Misc::CollectUsageInformation::get());
m_pCollectUsageInfo->SaveValue();
-
- m_pUseOpenCL->Check(officecfg::Office::Common::Misc::UseOpenCL::get());
- m_pUseOpenCL->SaveValue();
}
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index a6a7dac..3353457 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -57,8 +57,6 @@ private:
CheckBox* m_pCollectUsageInfo;
- CheckBox* m_pUseOpenCL;
-
DECL_LINK( TwoFigureHdl, NumericField* );
DECL_LINK( TwoFigureConfigHdl, NumericField* );
DECL_LINK(HelpCheckHdl_Impl, void *);
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
new file mode 100644
index 0000000..1de17b8
--- /dev/null
+++ b/cui/source/options/optopencl.cxx
@@ -0,0 +1,283 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <vcl/fixed.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+#include <vcl/settings.hxx>
+#include <svl/zforlist.hxx>
+#include <opencl/openclconfig.hxx>
+#include <officecfg/Office/Common.hxx>
+
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
+#include <com/sun/star/setup/UpdateCheckConfig.hpp>
+
+#include "cuires.hrc"
+#include "optopencl.hxx"
+
+SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) :
+ SfxTabPage(pParent, "OptOpenCLPage", "cui/ui/optopenclpage.ui", &rSet),
+ maConfig(OpenCLConfig::get())
+{
+ get(mpUseOpenCL, "useopencl");
+ get(mpBlackList, "blacklist");
+ get(mpBlackListEdit, "bledit");
+ get(mpBlackListAdd, "bladd");
+ get(mpBlackListDelete, "bldelete");
+ get(mpWhiteList, "whitelist");
+ get(mpWhiteListEdit, "wledit");
+ get(mpWhiteListAdd, "wladd");
+ get(mpWhiteListDelete, "wldelete");
+
+ mpBlackListEdit->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListEditHdl));
+ mpBlackListAdd->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListAddHdl));
+ mpBlackListDelete->SetClickHdl(LINK(this, SvxOpenCLTabPage, BlackListDeleteHdl));
+
+ mpWhiteListEdit->SetClickHdl(LINK(this, SvxOpenCLTabPage, WhiteListEditHdl));
+ mpWhiteListAdd->SetClickHdl(LINK(this, SvxOpenCLTabPage, WhiteListAddHdl));
+ mpWhiteListDelete->SetClickHdl(LINK(this, SvxOpenCLTabPage, WhiteListDeleteHdl));
+
+ mpBlackList->set_height_request(4 * mpBlackList->GetTextHeight());
+ mpWhiteList->set_height_request(4 * mpWhiteList->GetTextHeight());
+}
+
+SvxOpenCLTabPage::~SvxOpenCLTabPage()
+{
+}
+
+SfxTabPage*
+SvxOpenCLTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return new SvxOpenCLTabPage(pParent, *rAttrSet);
+}
+
+bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* )
+{
+ bool bModified = false;
+ boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+
+ if (mpUseOpenCL->IsValueChangedFromSaved())
+ maConfig.mbUseOpenCL = mpUseOpenCL->IsChecked();
+
+ if (maConfig != OpenCLConfig::get())
+ {
+ maConfig.set();
+ bModified = true;
+ }
+
+ if (bModified)
+ batch->commit();
+
+ return bModified;
+}
+
+namespace {
+
+OUString format(const OpenCLConfig::ImplMatcher& rImpl)
+{
+ return (rImpl.maOS + " " +
+ rImpl.maOSVersion + " " +
+ rImpl.maPlatformVendor + " " +
+ rImpl.maDevice + " " +
+ rImpl.maDriverVersion);
+}
+
+void fillListBox(ListBox* pListBox, const OpenCLConfig::ImplMatcherSet& rSet)
+{
+ pListBox->SetUpdateMode(false);
+ pListBox->Clear();
+
+ for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
+ {
+ pListBox->InsertEntry(format(*i), LISTBOX_APPEND);
+ }
+
+ pListBox->SetUpdateMode(true);
+}
+
+}
+
+void SvxOpenCLTabPage::Reset( const SfxItemSet* )
+{
+ maConfig = OpenCLConfig::get();
+
+ mpUseOpenCL->Check(maConfig.mbUseOpenCL);
+ mpUseOpenCL->SaveValue();
+
+ fillListBox(mpBlackList, maConfig.maBlackList);
+ fillListBox(mpWhiteList, maConfig.maWhiteList);
+}
+
+void SvxOpenCLTabPage::FillUserData()
+{
+}
+
+namespace {
+
+class ListEntryDialog : public ModalDialog
+{
+public:
+ OpenCLConfig::ImplMatcher maEntry;
+
+ Edit* mpOS;
+ Edit* mpOSVersion;
+ Edit* mpPlatformVendor;
+ Edit* mpDevice;
+ Edit* mpDriverVersion;
+
+ DECL_LINK(EditModifiedHdl, Edit*);
+
+ ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag);
+};
+
+ListEntryDialog::ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag)
+ : ModalDialog(pParent, "BlackOrWhiteListEntryDialog",
+ "cui/ui/blackorwhitelistentrydialog.ui"),
+ maEntry(rEntry)
+{
+ get(mpOS, "os");
+ get(mpOSVersion, "osversion");
+ get(mpPlatformVendor, "platformvendor");
+ get(mpDevice, "device");
+ get(mpDriverVersion, "driverversion");
+
+ mpOS->SetText(rEntry.maOS);
+ mpOSVersion->SetText(rEntry.maOSVersion);
+ mpPlatformVendor->SetText(rEntry.maPlatformVendor);
+ mpDevice->SetText(rEntry.maDevice);
+ mpDriverVersion->SetText(rEntry.maDriverVersion);
+
+ mpOS->SetModifyHdl(LINK(this, ListEntryDialog, EditModifiedHdl));
+ mpOSVersion->SetModifyHdl(LINK(this, ListEntryDialog, EditModifiedHdl));
+ mpPlatformVendor->SetModifyHdl(LINK(this, ListEntryDialog, EditModifiedHdl));
+ mpDevice->SetModifyHdl(LINK(this, ListEntryDialog, EditModifiedHdl));
+ mpDriverVersion->SetModifyHdl(LINK(this, ListEntryDialog, EditModifiedHdl));
+
+ SetText(get<FixedText>(rTag + "title")->GetText());
+}
+
+IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit)
+{
+ if (pEdit == mpOS)
+ maEntry.maOS = pEdit->GetText();
+ else if (pEdit == mpOSVersion)
+ maEntry.maOSVersion = pEdit->GetText();
+ else if (pEdit == mpPlatformVendor)
+ maEntry.maPlatformVendor = pEdit->GetText();
+ else if (pEdit == mpDevice)
+ maEntry.maDevice = pEdit->GetText();
+ else if (pEdit == mpDriverVersion)
+ maEntry.maDriverVersion = pEdit->GetText();
+
+ return 0;
+}
+
+void openListDialog(SvxOpenCLTabPage* pTabPage, OpenCLConfig::ImplMatcher& rEntry, const OString& rTag)
+{
+ ListEntryDialog aDlg(pTabPage, rEntry, rTag);
+
+ if (aDlg.Execute() == RET_OK)
+ rEntry = aDlg.maEntry;
+}
+
+const OpenCLConfig::ImplMatcher& findCurrentEntry(OpenCLConfig::ImplMatcherSet& rSet, ListBox* pListBox)
+{
+ auto i = rSet.begin();
+ std::advance(i, pListBox->GetSelectEntryPos());
+
+ return *i;
+}
+
+}
+
+long SvxOpenCLTabPage::EditHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet, const OString& rTag)
+{
+ if (pListBox->GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND)
+ return 0;
+
+ OpenCLConfig::ImplMatcher rEntry(findCurrentEntry(rSet, pListBox));
+ rSet.erase(rEntry);
+ openListDialog(this, rEntry, rTag);
+ rSet.insert(rEntry);
+ fillListBox(pListBox, rSet);
+
+ return 0;
+}
+
+long SvxOpenCLTabPage::AddHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet, const OString& rTag)
+{
+ OpenCLConfig::ImplMatcher rEntry;
+ openListDialog(this, rEntry, rTag);
+ if (rEntry != OpenCLConfig::ImplMatcher())
+ {
+ rSet.insert(rEntry);
+ fillListBox(pListBox, rSet);
+ }
+
+ return 0;
+}
+
+long SvxOpenCLTabPage::DeleteHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet)
+{
+ if (pListBox->GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND)
+ return 0;
+
+ OpenCLConfig::ImplMatcher rEntry(findCurrentEntry(rSet, pListBox));
+ rSet.erase(rEntry);
+ fillListBox(pListBox, rSet);
+
+ return 0;
+}
+
+IMPL_LINK_NOARG(SvxOpenCLTabPage, BlackListEditHdl)
+{
+ return EditHdl(mpBlackList, maConfig.maBlackList, "bledit");
+}
+
+IMPL_LINK_NOARG(SvxOpenCLTabPage, BlackListAddHdl)
+{
+ return AddHdl(mpBlackList, maConfig.maBlackList, "bladd");
+}
+
+IMPL_LINK_NOARG(SvxOpenCLTabPage, BlackListDeleteHdl)
+{
+ return DeleteHdl(mpBlackList, maConfig.maBlackList);
+}
+
+IMPL_LINK_NOARG(SvxOpenCLTabPage, WhiteListEditHdl)
+{
+ return EditHdl(mpWhiteList, maConfig.maWhiteList, "wledit");
+}
+
+IMPL_LINK_NOARG(SvxOpenCLTabPage, WhiteListAddHdl)
+{
+ return AddHdl(mpWhiteList, maConfig.maWhiteList, "wladd");
+}
+
+IMPL_LINK_NOARG(SvxOpenCLTabPage, WhiteListDeleteHdl)
+{
+ return DeleteHdl(mpWhiteList, maConfig.maWhiteList);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optopencl.hxx b/cui/source/options/optopencl.hxx
new file mode 100644
index 0000000..818eec4
--- /dev/null
+++ b/cui/source/options/optopencl.hxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CUI_SOURCE_OPTIONS_OPTOPENCL_HXX
+#define INCLUDED_CUI_SOURCE_OPTIONS_OPTOPENCL_HXX
+
+#include <opencl/openclconfig.hxx>
+#include <sfx2/tabdlg.hxx>
+#include <svtools/simptabl.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+
+class SvxOpenCLTabPage : public SfxTabPage
+{
+private:
+ OpenCLConfig maConfig;
+
+ CheckBox* mpUseOpenCL;
+
+ ListBox* mpBlackList;
+ PushButton* mpBlackListEdit;
+ PushButton* mpBlackListAdd;
+ PushButton* mpBlackListDelete;
+
+ ListBox* mpWhiteList;
+ PushButton* mpWhiteListEdit;
+ PushButton* mpWhiteListAdd;
+ PushButton* mpWhiteListDelete;
+
+ DECL_LINK(BlackListEditHdl, void*);
+ DECL_LINK(BlackListAddHdl, void*);
+ DECL_LINK(BlackListDeleteHdl, void*);
+
+ DECL_LINK(WhiteListEditHdl, void*);
+ DECL_LINK(WhiteListAddHdl, void*);
+ DECL_LINK(WhiteListDeleteHdl, void*);
+
+ long EditHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet, const OString& rTag);
+ long AddHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet, const OString& rTag);
+ long DeleteHdl(ListBox* pListBox, OpenCLConfig::ImplMatcherSet& rSet);
+
+public:
+ SvxOpenCLTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ virtual ~SvxOpenCLTabPage();
+
+ static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+
+ virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
+ virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
+ virtual void FillUserData() SAL_OVERRIDE;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index fd7810c..772f80f 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -47,6 +47,7 @@
#include "optjsearch.hxx"
#include "optlingu.hxx"
#include "optmemory.hxx"
+#include "optopencl.hxx"
#include "optpath.hxx"
#include "optsave.hxx"
#include "optupdt.hxx"
@@ -320,6 +321,7 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, vcl::Window* pParent, const Sf
case RID_SVXPAGE_ACCESSIBILITYCONFIG: fnCreate = &SvxAccessibilityOptionsTabPage::Create; break;
case RID_SVXPAGE_OPTIONS_CTL: fnCreate = &SvxCTLOptionsPage::Create ; break;
case RID_SVXPAGE_OPTIONS_JAVA: fnCreate = &SvxJavaOptionsPage::Create ; break;
+ case RID_SVXPAGE_OPENCL: fnCreate = &SvxOpenCLTabPage::Create ; break;
case RID_SVXPAGE_ONLINEUPDATE: fnCreate = &SvxOnlineUpdateTabPage::Create; break;
case RID_OPTPAGE_CHART_DEFCOLORS: fnCreate = &SvxDefaultColorOptPage::Create; break;
#if HAVE_FEATURE_SCRIPTING
diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src
index 54be930..fac9779 100644
--- a/cui/source/options/treeopt.src
+++ b/cui/source/options/treeopt.src
@@ -43,6 +43,7 @@ Resource RID_OFADLG_OPTIONS_TREE_PAGES
< "Advanced" ; RID_SVXPAGE_OPTIONS_JAVA ; > ;
< "Basic IDE Options" ; RID_SVXPAGE_BASICIDE_OPTIONS ; > ;
< "Online Update" ; RID_SVXPAGE_ONLINEUPDATE ; > ;
+ < "OpenCL" ; RID_SVXPAGE_OPENCL ; > ;
};
};
StringArray SID_LANGUAGE_OPTIONS
diff --git a/cui/uiconfig/ui/blackorwhitelistentrydialog.ui b/cui/uiconfig/ui/blackorwhitelistentrydialog.ui
new file mode 100644
index 0000000..3c2b238
--- /dev/null
+++ b/cui/uiconfig/ui/blackorwhitelistentrydialog.ui
@@ -0,0 +1,281 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkDialog" id="BlackOrWhiteListEntryDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="no">dummy</property>
+ <property name="resizable">False</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">12</property>
+ <child>
+ <object class="GtkGrid" id="grid4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">OS:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">name</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="os">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="width_chars">12</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">OS version:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">name</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="osversion">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="width_chars">22</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">OpenCL platform vendor:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">name</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="platformvendor">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="width_chars">12</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Device:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">name</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="device">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="width_chars">22</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Driver version:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">name</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="driverversion">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="width_chars">22</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="bledittitle">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Edit Black-list Entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="bladdtitle">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Create Black-list Entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="wledittitle">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Edit White-list Entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="wladdtitle">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Create White-list Entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/cui/uiconfig/ui/optgeneralpage.ui b/cui/uiconfig/ui/optgeneralpage.ui
index d3e8015..b1447c5 100644
--- a/cui/uiconfig/ui/optgeneralpage.ui
+++ b/cui/uiconfig/ui/optgeneralpage.ui
@@ -370,46 +370,5 @@
<property name="top_attach">5</property>
</packing>
</child>
- <child>
- <object class="GtkFrame" id="openclframe">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkAlignment" id="alignment7">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkCheckButton" id="useopencl">
- <property name="label" translatable="yes">Allow use of OpenCL</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">OpenCL</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">6</property>
- </packing>
- </child>
</object>
</interface>
diff --git a/cui/uiconfig/ui/optopenclpage.ui b/cui/uiconfig/ui/optopenclpage.ui
new file mode 100644
index 0000000..84fe49b
--- /dev/null
+++ b/cui/uiconfig/ui/optopenclpage.ui
@@ -0,0 +1,349 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkFrame" id="OptOpenCLPage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="border_width">6</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkBox" id="blacklistbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkCheckButton" id="useopencl">
+ <property name="label" translatable="yes">Allow use of OpenCL</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">OpenCL black-list:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">blacklist</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkButtonBox" id="buttonbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <property name="layout_style">start</property>
+ <child>
+ <object class="GtkButton" id="bledit">
+ <property name="label" translatable="yes">_Edit...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="bladd">
+ <property name="label" translatable="yes">_Add...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="bldelete">
+ <property name="label" translatable="yes">_Delete...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkGrid" id="grid3">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="os">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">OS</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="osversion">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">OS Version</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="vendor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Platform vendor</property>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="device">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Device</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="driverversion">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Driver version</property>
+ </object>
+ <packing>
+ <property name="left_attach">4</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTreeView" id="blacklist">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">OpenCL white-list:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">blacklist</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkButtonBox" id="buttonbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <property name="layout_style">start</property>
+ <child>
+ <object class="GtkButton" id="wledit">
+ <property name="label" translatable="yes">_Edit...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="wladd">
+ <property name="label" translatable="yes">_Add...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="wldelete">
+ <property name="label" translatable="yes">_Delete...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkTreeView" id="whitelist">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">OpenCL Options</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <object class="GtkSizeGroup" id="sizegroup1">
+ <widgets>
+ </widgets>
+ </object>
+</interface>
diff --git a/include/opencl/openclconfig.hxx b/include/opencl/openclconfig.hxx
new file mode 100644
index 0000000..c3a1103
--- /dev/null
+++ b/include/opencl/openclconfig.hxx
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_OPENCL_OPENCLCONFIG_HXX
+#define INCLUDED_OPENCL_OPENCLCONFIG_HXX
+
+#include <ostream>
+#include <set>
+
+#include <opencl/opencldllapi.h>
+#include <opencl/platforminfo.hxx>
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/uno/Sequence.hxx>
+
+struct OPENCL_DLLPUBLIC OpenCLConfig
+{
+ struct ImplMatcher
+ {
+ OUString maOS;
+ OUString maOSVersion;
+ OUString maPlatformVendor;
+ OUString maDevice;
+ OUString maDriverVersion;
+
+ ImplMatcher()
+ {
+ }
+
+ ImplMatcher(const OUString& rOS,
+ const OUString& rOSVersion,
+ const OUString& rPlatformVendor,
+ const OUString& rDevice,
+ const OUString& rDriverVersion)
+ : maOS(rOS),
+ maOSVersion(rOSVersion),
+ maPlatformVendor(rPlatformVendor),
+ maDevice(rDevice),
+ maDriverVersion(rDriverVersion)
+ {
+ }
+
+ bool operator==(const ImplMatcher& r) const
+ {
+ return maOS == r.maOS &&
+ maOSVersion == r.maOSVersion &&
+ maPlatformVendor == r.maPlatformVendor &&
+ maDevice == r.maDevice &&
+ maDriverVersion == r.maDriverVersion;
+ }
+ bool operator!=(const ImplMatcher& r) const
+ {
+ return !operator==(r);
+ }
+ bool operator<(const ImplMatcher& r) const
+ {
+ return (maOS < r.maOS ||
+ (maOS == r.maOS &&
+ (maOSVersion < r.maOSVersion ||
+ (maOSVersion == r.maOSVersion &&
+ (maPlatformVendor < r.maPlatformVendor ||
+ (maPlatformVendor == r.maPlatformVendor &&
+ (maDevice < r.maDevice ||
+ (maDevice == r.maDevice &&
+ (maDriverVersion < r.maDriverVersion)))))))));
+ }
+ };
+
+ bool mbUseOpenCL;
+
+ typedef std::set<ImplMatcher> ImplMatcherSet;
+
+ ImplMatcherSet maBlackList;
+ ImplMatcherSet maWhiteList;
+
+ OpenCLConfig();
+
+ bool operator== (const OpenCLConfig& r) const;
+ bool operator!= (const OpenCLConfig& r) const;
+
+ static OpenCLConfig get();
+
+ void set();
+
+ bool checkImplementation(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice) const;
+};
+
+OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig& rConfig);
+OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcher& rImpl);
+OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcherSet& rSet);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/opencl/opencldllapi.h b/include/opencl/opencldllapi.h
new file mode 100644
index 0000000..f62b94c
--- /dev/null
+++ b/include/opencl/opencldllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_OPENCL_OPENCLDLLAPI_H
+#define INCLUDED_OPENCL_OPENCLDLLAPI_H
+
+#include <sal/types.h>
+
+#if defined(OPENCL_DLLIMPLEMENTATION)
+#define OPENCL_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define OPENCL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define OPENCL_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/platforminfo.hxx b/include/opencl/platforminfo.hxx
similarity index 53%
rename from sc/inc/platforminfo.hxx
rename to include/opencl/platforminfo.hxx
index 8fd0ee2..6c40c43 100644
--- a/sc/inc/platforminfo.hxx
+++ b/include/opencl/platforminfo.hxx
@@ -7,21 +7,22 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_SC_INC_PLATFORMINFO_HXX
-#define INCLUDED_SC_INC_PLATFORMINFO_HXX
+#ifndef INCLUDED_OPENCL_PLATFORMINFO_HXX
+#define INCLUDED_OPENCL_PLATFORMINFO_HXX
#include <ostream>
#include <vector>
-#include <rtl/ustring.hxx>
+#include <clew.h>
-#include "scdllapi.h"
+#include <opencl/opencldllapi.h>
+#include <rtl/ustring.hxx>
-namespace sc {
+// Struct that describs an actual instance of an OpenCL device
-struct SC_DLLPUBLIC OpenCLDeviceInfo
+struct OPENCL_DLLPUBLIC OpenCLDeviceInfo
{
- void* device;
+ cl_device_id device;
OUString maName;
OUString maVendor;
OUString maDriver;
@@ -32,9 +33,11 @@ struct SC_DLLPUBLIC OpenCLDeviceInfo
OpenCLDeviceInfo();
};
-struct SC_DLLPUBLIC OpenCLPlatformInfo
+// Struct that describs an actual instance of an OpenCL platform implementation
+
+struct OPENCL_DLLPUBLIC OpenCLPlatformInfo
{
- void* platform;
+ cl_platform_id platform;
OUString maVendor;
OUString maName;
std::vector<OpenCLDeviceInfo> maDevices;
@@ -42,9 +45,7 @@ struct SC_DLLPUBLIC OpenCLPlatformInfo
OpenCLPlatformInfo();
};
-}
-
-SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLPlatformInfo& rPlatform);
-SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLDeviceInfo& rDevice);
+OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLPlatformInfo& rPlatform);
+OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLDeviceInfo& rDevice);
#endif
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 001654a..d82ade0 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1382,20 +1382,6 @@
</info>
<value/>
</prop>
- <prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
- <!-- UIHints: Tools - Options Spreadsheet Formula -->
- <info>
- <desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be bad. Each entry is a string consisting of five parts separated by slashes. An empty part matches anything. In case a slash, percent or semicolon occurs inside a part, it is replaced by a percent followed by the corresponding number as two hex digits. The parts except OS can contain regular expressions. Inside these regular expressions the usual characters .*()[]\ are special and should be quoted with a backslash to be interpreted literally. OS should be just one of "Linux", "OS X" (including the space) or "Windows" (without quotes). Has higher priority than OpenCLWhiteList.</desc>
- </info>
- <value oor:separator=";">Windows//Intel\(R\) Corporation//9\.17\.10\.2884</value>
- </prop>
- <prop oor:name="OpenCLWhiteList" oor:type="oor:string-list" oor:nillable="false">
- <!-- UIHints: Tools - Options Spreadsheet Formula -->
- <info>
- <desc>Like OpenCLBlackList, but for combinations known to be good.</desc>
- </info>
- <value oor:separator=";">Linux//Advanced Micro Devices, Inc\.//1445\.5 \(sse2,avx\);//Advanced Micro Devices, Inc\.//;//Intel\(R\) Corporation//;//NVIDIA Corporation//</value>
- </prop>
</group>
<group oor:name="Syntax">
<info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 74a25aa..af930da 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5560,6 +5560,20 @@
</info>
<value>true</value>
</prop>
+ <prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
+ <!-- UIHints: Tools - Options General OpenCL -->
+ <info>
+ <desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be bad. Each entry is a string consisting of five parts separated by slashes. An empty part matches anything. In case a slash, percent or semicolon occurs inside a part, it is replaced by a percent followed by the corresponding number as two hex digits. The parts except OS can contain regular expressions. Inside these regular expressions the usual characters .*()[]\ are special and should be quoted with a backslash to be interpreted literally. OS should be just one of "Linux", "OS X" (including the space) or "Windows" (without quotes). Has higher priority than OpenCLWhiteList.</desc>
+ </info>
+ <value oor:separator=";">Windows//Intel\(R\) Corporation//9\.17\.10\.2884</value>
+ </prop>
+ <prop oor:name="OpenCLWhiteList" oor:type="oor:string-list" oor:nillable="false">
+ <!-- UIHints: Tools - Options General OpenCL -->
+ <info>
+ <desc>Like OpenCLBlackList, but for combinations known to be good.</desc>
+ </info>
+ <value oor:separator=";">Linux//Advanced Micro Devices, Inc\.//1445\.5 \(sse2,avx\);//Advanced Micro Devices, Inc\.//;//Intel\(R\) Corporation//;//NVIDIA Corporation//</value>
+ </prop>
<prop oor:name="MacroRecorderMode" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Determines if the limited, and awkward code producing
diff --git a/opencl/Library_opencl.mk b/opencl/Library_opencl.mk
new file mode 100644
index 0000000..51ca62c
--- /dev/null
+++ b/opencl/Library_opencl.mk
@@ -0,0 +1,42 @@
+# -*- 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_Library_Library,opencl))
+
+$(eval $(call gb_Library_add_defs,opencl,\
+ -DOPENCL_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_use_externals,opencl,\
+ boost_headers \
+ clew \
+ icu_headers \
+ icui18n \
+ icuuc \
+))
+
+$(eval $(call gb_Library_use_custom_headers,opencl,\
+ officecfg/registry \
+))
+
+$(eval $(call gb_Library_use_sdk_api,opencl))
+
+$(eval $(call gb_Library_use_libraries,opencl,\
+ configmgr \
+ comphelper \
+ cppu \
+ sal \
+))
+
+$(eval $(call gb_Library_add_exception_objects,opencl,\
+ opencl/source/openclconfig \
+ opencl/source/platforminfo \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/opencl/Makefile b/opencl/Makefile
new file mode 100644
index 0000000..0997e62
--- /dev/null
+++ b/opencl/Makefile
@@ -0,0 +1,14 @@
+# -*- 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/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/opencl/Module_opencl.mk b/opencl/Module_opencl.mk
new file mode 100644
index 0000000..92a8016
--- /dev/null
+++ b/opencl/Module_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_Module_Module,opencl))
+
+$(eval $(call gb_Module_add_targets,opencl,\
+ Library_opencl \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx
new file mode 100644
index 0000000..aa7a07a
--- /dev/null
+++ b/opencl/source/openclconfig.cxx
@@ -0,0 +1,256 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include <boost/shared_ptr.hpp>
+#include <unicode/regex.h>
+
+#include <comphelper/configuration.hxx>
+#include <officecfg/Office/Common.hxx>
+#include <opencl/openclconfig.hxx>
+#include <opencl/platforminfo.hxx>
+#include <rtl/ustring.hxx>
+#include <sal/types.h>
+
+OpenCLConfig::OpenCLConfig() :
+ mbUseOpenCL(true)
+{
+ // This entry we have had for some time (when blacklisting was
+ // done elsewhere in the code), so presumably there is a known
+ // good reason for it.
+ maBlackList.insert(ImplMatcher("Windows", "", "Intel\\(R\\) Corporation", "", "9\\.17\\.10\\.2884"));
+
+ // This is what I have tested on Linux and it works for our unit tests.
+ maWhiteList.insert(ImplMatcher("Linux", "", "Advanced Micro Devices, Inc\\.", "", "1445\\.5 \\(sse2,avx\\)"));
+
+ // For now, assume that AMD, Intel and NVIDIA drivers are good
+ maWhiteList.insert(ImplMatcher("", "", "Advanced Micro Devices, Inc\\.", "", ""));
+ maWhiteList.insert(ImplMatcher("", "", "Intel\\(R\\) Corporation", "", ""));
+ maWhiteList.insert(ImplMatcher("", "", "NVIDIA Corporation", "", ""));
+}
+
+bool OpenCLConfig::operator== (const OpenCLConfig& r) const
+{
+ return (mbUseOpenCL == r.mbUseOpenCL &&
+ maBlackList == r.maBlackList &&
+ maWhiteList == r.maWhiteList &&
+ true);
+}
+
+bool OpenCLConfig::operator!= (const OpenCLConfig& r) const
+{
+ return !operator== (r);
+}
+
+namespace {
+
+css::uno::Sequence<OUString> SetOfImplMatcherToStringSequence(const OpenCLConfig::ImplMatcherSet& rSet)
+{
+ css::uno::Sequence<OUString> result(rSet.size());
+
+ size_t n(0);
+ for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
+ {
+ result[n++] =
+ (*i).maOS.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
+ (*i).maOSVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
+ (*i).maPlatformVendor.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
+ (*i).maDevice.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
+ (*i).maDriverVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B");
+ }
+
+ return result;
+}
+
+OUString getToken(const OUString& string, sal_Int32& index)
+{
+ OUString token(string.getToken(0, '/', index));
+ OUString result;
+ sal_Int32 i(0);
+ sal_Int32 p;
+ while ((p = token.indexOf('%', i)) >= 0)
+ {
+ if (p > i)
+ result += token.copy(i, p - i);
+ if (p < token.getLength() - 2)
+ {
+ result += OUString(static_cast<sal_Unicode>(token.copy(p+1, 2).toInt32(16)));
+ i = p + 3;
+ }
+ else
+ {
+ i = token.getLength();
+ }
+ }
+ result += token.copy(i);
+
+ return result;
+}
+
+OpenCLConfig::ImplMatcherSet StringSequenceToSetOfImplMatcher(const css::uno::Sequence<OUString>& rSequence)
+{
+ OpenCLConfig::ImplMatcherSet result;
+
+ for (auto i = rSequence.begin(); i != rSequence.end(); ++i)
+ {
+ OpenCLConfig::ImplMatcher m;
+ sal_Int32 index(0);
+ m.maOS = getToken(*i, index);
+ m.maOSVersion = getToken(*i, index);
+ m.maPlatformVendor = getToken(*i, index);
+ m.maDevice = getToken(*i, index);
+ m.maDriverVersion = getToken(*i, index);
+
+ result.insert(m);
+ }
+
+ return result;
+}
+
+bool match(const OUString& rPattern, const OUString& rInput)
+{
+ if (rPattern == "")
+ return true;
+
+ UErrorCode nIcuError(U_ZERO_ERROR);
+ icu::UnicodeString sIcuPattern(reinterpret_cast<const UChar*>(rPattern.getStr()), rPattern.getLength());
+ icu::UnicodeString sIcuInput(reinterpret_cast<const UChar*>(rInput.getStr()), rInput.getLength());
+ RegexMatcher aMatcher(sIcuPattern, sIcuInput, 0, nIcuError);
+
+ if (U_SUCCESS(nIcuError) && aMatcher.matches(nIcuError) && U_SUCCESS(nIcuError))
+ return true;
+
+ return false;
+}
+
+bool match(const OpenCLConfig::ImplMatcher& rListEntry, const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
+{
+#if defined WNT
+ if (rListEntry.maOS != "" && rListEntry.maOS != "Windows")
+ return false;
+#elif defined LINUX
+ if (rListEntry.maOS != "" && rListEntry.maOS != "Linux")
+ return false;
+#elif defined MACOSX
+ if (rListEntry.maOS != "" && rListEntry.maOS != "OS X")
+ return false;
+#endif
+
+ // OS version check not yet implemented
+
+ if (!match(rListEntry.maPlatformVendor, rPlatform.maVendor))
+ return false;
+
+ if (!match(rListEntry.maDevice, rDevice.maName))
+ return false;
+
+ if (!match(rListEntry.maDriverVersion, rDevice.maDriver))
+ return false;
+
+ return true;
+}
+
+bool match(const OpenCLConfig::ImplMatcherSet& rList, const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice, const char* sKindOfList)
+{
+ for (auto i = rList.cbegin(); i != rList.end(); ++i)
+ {
+ SAL_INFO("sc.opencl", "Looking for match for platform=" << rPlatform << ", device=" << rDevice <<
+ " in " << sKindOfList << " entry=" << *i);
+
+ if (match(*i, rPlatform, rDevice))
+ {
+ SAL_INFO("sc.opencl", "Match!");
+ return true;
+ }
+ }
+ return false;
+}
+
+} // anonymous namespace
+
+OpenCLConfig OpenCLConfig::get()
+{
+ OpenCLConfig result;
+
+ result.mbUseOpenCL = officecfg::Office::Common::Misc::UseOpenCL::get();
+
+ result.maBlackList = StringSequenceToSetOfImplMatcher(officecfg::Office::Common::Misc::OpenCLBlackList::get());
+ result.maWhiteList = StringSequenceToSetOfImplMatcher(officecfg::Office::Common::Misc::OpenCLWhiteList::get());
+
+ return result;
+}
+
+void OpenCLConfig::set()
+{
+ boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+
+ officecfg::Office::Common::Misc::UseOpenCL::set(mbUseOpenCL, batch);
+ officecfg::Office::Common::Misc::OpenCLBlackList::set(SetOfImplMatcherToStringSequence(maBlackList), batch);
+ officecfg::Office::Common::Misc::OpenCLWhiteList::set(SetOfImplMatcherToStringSequence(maWhiteList), batch);
+
+ batch->commit();
+}
+
+bool OpenCLConfig::checkImplementation(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice) const
+{
+ // Check blacklist of known bad OpenCL implementations
+ if (match(maBlackList, rPlatform, rDevice, "blacklist"))
+ {
+ SAL_INFO("opencl", "Rejecting");
+ return true;
+ }
+
+ // Check for whitelist of known good OpenCL implementations
+ if (match(maWhiteList, rPlatform, rDevice, "whitelist"))
+ {
+ SAL_INFO("opencl", "Approving");
+ return false;
+ }
+
+ // Fallback: reject
+ SAL_INFO("opencl", "Fallback: rejecting platform=" << rPlatform << ", device=" << rDevice);
+ return true;
+}
+
+std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig& rConfig)
+{
+ rStream << "{"
+ "UseOpenCL=" << (rConfig.mbUseOpenCL ? "YES" : "NO") << ","
+ "BlackList=" << rConfig.maBlackList << ","
+ "WhiteList=" << rConfig.maWhiteList <<
+ "}";
+ return rStream;
+}
+
+std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcher& rImpl)
+{
+ rStream << "{"
+ "OS=" << rImpl.maOS << ","
+ "OSVersion=" << rImpl.maOSVersion << ","
+ "PlatformVendor=" << rImpl.maPlatformVendor << ","
+ "Device=" << rImpl.maDevice << ","
+ "DriverVersion=" << rImpl.maDriverVersion <<
+ "}";
+
+ return rStream;
+}
+
+std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcherSet& rSet)
+{
+ rStream << "{";
+ for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
+ {
+ if (i != rSet.cbegin())
+ rStream << ",";
+ rStream << *i;
+ }
+ rStream << "}";
+ return rStream;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/platforminfo.cxx b/opencl/source/platforminfo.cxx
similarity index 80%
rename from sc/source/core/tool/platforminfo.cxx
rename to opencl/source/platforminfo.cxx
index 6258844..4871702 100644
--- a/sc/source/core/tool/platforminfo.cxx
+++ b/opencl/source/platforminfo.cxx
@@ -7,9 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "platforminfo.hxx"
+#include <ostream>
-namespace sc {
+#include <opencl/platforminfo.hxx>
OpenCLDeviceInfo::OpenCLDeviceInfo()
: device(0)
@@ -24,9 +24,7 @@ OpenCLPlatformInfo::OpenCLPlatformInfo()
{
}
-}
-
-std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLPlatformInfo& rPlatform)
+std::ostream& operator<<(std::ostream& rStream, const OpenCLPlatformInfo& rPlatform)
{
rStream << "{"
"Vendor=" << rPlatform.maVendor << ","
@@ -35,7 +33,7 @@ std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLPlatformInfo& rP
return rStream;
}
-std::ostream& operator<<(std::ostream& rStream, const sc::OpenCLDeviceInfo& rDevice)
+std::ostream& operator<<(std::ostream& rStream, const OpenCLDeviceInfo& rDevice)
{
rStream << "{"
"Name=" << rDevice.maName << ","
diff --git a/sc/CppunitTest_sc_opencl_test.mk b/sc/CppunitTest_sc_opencl_test.mk
index 16ebd5e..65aedde 100644
--- a/sc/CppunitTest_sc_opencl_test.mk
+++ b/sc/CppunitTest_sc_opencl_test.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sc_opencl_test, \
$(eval $(call gb_CppunitTest_use_externals,sc_opencl_test, \
boost_headers \
+ clew \
mdds_headers \
orcus \
orcus-parser \
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 86795e8..9d07b3e 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -31,7 +31,7 @@ endif
$(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\
boost_headers \
- $(call gb_Helper_optional,CLCC,clew) \
+ $(call gb_Helper_optional,OPENCL,clew) \
icu_headers \
icui18n \
icuuc \
@@ -53,6 +53,8 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
forui \
i18nlangtag \
i18nutil \
+ $(call gb_Helper_optional,OPENCL, \
+ opencl) \
sal \
salhelper \
sax \
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index ca854a8..3ad559f 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -37,7 +37,7 @@ $(eval $(call gb_Library_use_sdk_api,sc))
$(eval $(call gb_Library_use_externals,sc,\
boost_headers \
- $(call gb_Helper_optional,CLCC,clew) \
+ $(call gb_Helper_optional,OPENCL,clew) \
icu_headers \
icui18n \
icuuc \
@@ -72,6 +72,8 @@ $(eval $(call gb_Library_use_libraries,sc,\
forui \
i18nlangtag \
i18nutil \
+ $(call gb_Helper_optional,OPENCL, \
+ opencl) \
sal \
salhelper \
sax \
@@ -247,7 +249,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/optutil \
sc/source/core/tool/orcusxml \
sc/source/core/tool/parclass \
- sc/source/core/tool/platforminfo \
sc/source/core/tool/printopt \
sc/source/core/tool/prnsave \
sc/source/core/tool/progress \
@@ -660,8 +661,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/xmlsource/xmlsourcedlg \
))
-ifneq (,$(ENABLE_OPENCL))
-
+$(call gb_Helper_optional,OPENCL,\
$(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/opencl/formulagroupcl \
sc/source/core/opencl/openclwrapper \
@@ -675,7 +675,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/opencl/op_array \
sc/source/core/opencl/op_logical \
sc/source/core/opencl/op_spreadsheet \
-))
+)))
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,sc,\
@@ -683,8 +683,6 @@ $(eval $(call gb_Library_add_libs,sc,\
))
endif
-endif
-
$(eval $(call gb_SdiTarget_SdiTarget,sc/sdi/scslots,sc/sdi/scalc))
$(eval $(call gb_SdiTarget_set_include,sc/sdi/scslots,\
diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk
index 477b6fc..a00e81a 100644
--- a/sc/Library_scui.mk
+++ b/sc/Library_scui.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_Library_use_sdk_api,scui))
$(eval $(call gb_Library_use_externals,scui,\
boost_headers \
+ $(call gb_Helper_optional,OPENCL,clew) \
mdds_headers \
))
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 0a27d1b..1477134 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -40,58 +40,6 @@ struct SC_DLLPUBLIC ScCalcConfig
STRING_CONVERSION_UNAMBIGUOUS, ///< =1+"1" gives 2, but =1+"1.000" or =1+"x" give #VALUE!
STRING_CONVERSION_LOCALE_DEPENDENT ///< =1+"1.000" may be 2 or 1001 ... =1+"x" gives #VALUE!
};
-
- struct OpenCLImplMatcher
- {
- OUString maOS;
- OUString maOSVersion;
- OUString maPlatformVendor;
- OUString maDevice;
- OUString maDriverVersion;
-
- OpenCLImplMatcher()
- {
- }
-
- OpenCLImplMatcher(const OUString& rOS,
- const OUString& rOSVersion,
- const OUString& rPlatformVendor,
- const OUString& rDevice,
- const OUString& rDriverVersion)
- : maOS(rOS),
- maOSVersion(rOSVersion),
- maPlatformVendor(rPlatformVendor),
- maDevice(rDevice),
- maDriverVersion(rDriverVersion)
- {
- }
-
- bool operator==(const OpenCLImplMatcher& r) const
- {
- return maOS == r.maOS &&
- maOSVersion == r.maOSVersion &&
- maPlatformVendor == r.maPlatformVendor &&
- maDevice == r.maDevice &&
- maDriverVersion == r.maDriverVersion;
- }
- bool operator!=(const OpenCLImplMatcher& r) const
- {
- return !operator==(r);
- }
- bool operator<(const OpenCLImplMatcher& r) const
- {
- return (maOS < r.maOS ||
- (maOS == r.maOS &&
- (maOSVersion < r.maOSVersion ||
- (maOSVersion == r.maOSVersion &&
- (maPlatformVendor < r.maPlatformVendor ||
- (maPlatformVendor == r.maPlatformVendor &&
- (maDevice < r.maDevice ||
- (maDevice == r.maDevice &&
- (maDriverVersion < r.maDriverVersion)))))))));
- }
- };
-
formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax;
StringConversion meStringConversion;
bool mbEmptyStringAsZero:1;
@@ -105,11 +53,6 @@ struct SC_DLLPUBLIC ScCalcConfig
OpCodeSet maOpenCLSubsetOpCodes;
- typedef std::set<OpenCLImplMatcher> OpenCLImplMatcherSet;
-
- OpenCLImplMatcherSet maOpenCLBlackList;
- OpenCLImplMatcherSet maOpenCLWhiteList;
-
ScCalcConfig();
void setOpenCLConfigToDefault();
@@ -121,8 +64,6 @@ struct SC_DLLPUBLIC ScCalcConfig
bool operator!= (const ScCalcConfig& r) const;
};
-SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMatcher& rImpl);
-SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMatcherSet& rSet);
SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig& rConfig);
SC_DLLPUBLIC OUString ScOpCodeSetToNumberString(const ScCalcConfig::OpCodeSet& rOpCodes);
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx
index ba5f318..19debee 100644
--- a/sc/inc/formulagroup.hxx
+++ b/sc/inc/formulagroup.hxx
@@ -12,10 +12,10 @@
#include "address.hxx"
#include "types.hxx"
-#include "platforminfo.hxx"
#include "stlalgorithm.hxx"
#include <formula/opcode.hxx>
+#include <opencl/platforminfo.hxx>
#include <svl/sharedstringpool.hxx>
#include <set>
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index f5f8324..8ead150 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -10,6 +10,7 @@
#include <osl/file.hxx>
#include "scdll.hxx"
+#include <opencl/platforminfo.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -30,7 +31,6 @@
#include "drwlayer.hxx"
#include "userdat.hxx"
#include "formulacell.hxx"
-#include "platforminfo.hxx"
#include "formulagroup.hxx"
#include <svx/svdpage.hxx>
diff --git a/sc/source/core/inc/openclwrapper.hxx b/sc/source/core/inc/openclwrapper.hxx
index 9f3edc9..9dad747 100644
--- a/sc/source/core/inc/openclwrapper.hxx
+++ b/sc/source/core/inc/openclwrapper.hxx
@@ -11,13 +11,12 @@
#define INCLUDED_SC_SOURCE_CORE_OPENCL_OPENCLWRAPPER_HXX
#include <config_features.h>
-#include <formula/opcode.hxx>
#include <sal/detail/log.h>
+#include <opencl/platforminfo.hxx>
#include <osl/file.hxx>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <cassert>
-#include "platforminfo.hxx"
#include <rtl/string.hxx>
@@ -102,8 +101,6 @@ bool switchOpenCLDevice(const OUString* pDeviceId, bool bAutoSelect,
void getOpenCLDeviceInfo(size_t& rDeviceId, size_t& rPlatformId);
-bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice);
-
}}
#endif
diff --git a/sc/source/core/opencl/opencl_device.cxx b/sc/source/core/opencl/opencl_device.cxx
index 958fd1a..f845f42 100644
--- a/sc/source/core/opencl/opencl_device.cxx
+++ b/sc/source/core/opencl/opencl_device.cxx
@@ -21,13 +21,16 @@
#include <iostream>
#include <sstream>
#include <vector>
-#include <sal/log.hxx>
-#include <comphelper/random.hxx>
+
#include <boost/scoped_ptr.hpp>
+#include <comphelper/random.hxx>
+#include <opencl/openclconfig.hxx>
+#include <opencl/platforminfo.hxx>
+#include <sal/log.hxx>
+
#include "opencl_device.hxx"
#include "openclwrapper.hxx"
-#include "platforminfo.hxx"
#define INPUTSIZE 15360
#define OUTPUTSIZE 15360
@@ -418,7 +421,7 @@ ds_status pickBestDevice(ds_profile* profile, int* bestDeviceIdx)
aDevice.maDriver = OUString(device.oclDriverVersion, strlen(device.oclDriverVersion), RTL_TEXTENCODING_UTF8);
// If blacklisted or not whitelisted, ignore it
- if (opencl::checkForKnownBadCompilers(aPlatform, aDevice))
+ if (OpenCLConfig::get().checkImplementation(aPlatform, aDevice))
{
SAL_INFO("sc.opencl.device", "Device[" << d << "] " << device.oclDeviceName << " is blacklisted or not whitelisted");
pScore->fTime = DBL_MAX;
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 66af89f..20f4919 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -15,6 +15,7 @@
#include "openclwrapper.hxx"
#include <comphelper/string.hxx>
+#include <opencl/openclconfig.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/digest.h>
@@ -519,65 +520,6 @@ bool OpenCLDevice::initOpenCLRunEnv( GPUEnv *gpuInfo )
namespace {
-bool match(const OUString& rPattern, const OUString& rInput)
-{
- if (rPattern == "")
- return true;
-
- UErrorCode nIcuError(U_ZERO_ERROR);
- icu::UnicodeString sIcuPattern(reinterpret_cast<const UChar*>(rPattern.getStr()), rPattern.getLength());
- icu::UnicodeString sIcuInput(reinterpret_cast<const UChar*>(rInput.getStr()), rInput.getLength());
- RegexMatcher aMatcher(sIcuPattern, sIcuInput, 0, nIcuError);
-
- if (U_SUCCESS(nIcuError) && aMatcher.matches(nIcuError) && U_SUCCESS(nIcuError))
- return true;
-
- return false;
-}
-
-bool match(const ScCalcConfig::OpenCLImplMatcher& rListEntry, const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
-{
-#if defined WNT
- if (rListEntry.maOS != "" && rListEntry.maOS != "Windows")
- return false;
-#elif defined LINUX
- if (rListEntry.maOS != "" && rListEntry.maOS != "Linux")
- return false;
-#elif defined MACOSX
- if (rListEntry.maOS != "" && rListEntry.maOS != "OS X")
- return false;
-#endif
-
- // OS version check not yet implemented
-
- if (!match(rListEntry.maPlatformVendor, rPlatform.maVendor))
- return false;
-
- if (!match(rListEntry.maDevice, rDevice.maName))
- return false;
-
- if (!match(rListEntry.maDriverVersion, rDevice.maDriver))
- return false;
-
- return true;
-}
-
-bool match(const ScCalcConfig::OpenCLImplMatcherSet& rList, const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice, const char* sKindOfList)
-{
- for (auto i = rList.cbegin(); i != rList.end(); ++i)
- {
- SAL_INFO("sc.opencl", "Looking for match for platform=" << rPlatform << ", device=" << rDevice <<
- " in " << sKindOfList << " entry=" << *i);
-
- if (match(*i, rPlatform, rDevice))
- {
- SAL_INFO("sc.opencl", "Match!");
- return true;
- }
- }
- return false;
-}
-
// based on crashes and hanging during kernel compilation
void createDeviceInfo(cl_device_id aDeviceId, OpenCLPlatformInfo& rPlatformInfo)
{
@@ -635,7 +577,7 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenCLPlatformInfo& rPlatformInfo)
aDeviceInfo.mnComputeUnits = nComputeUnits;
- if(!checkForKnownBadCompilers(rPlatformInfo, aDeviceInfo))
+ if(!OpenCLConfig::get().checkImplementation(rPlatformInfo, aDeviceInfo))
rPlatformInfo.maDevices.push_back(aDeviceInfo);
}
@@ -679,27 +621,6 @@ bool createPlatformInfo(cl_platform_id nPlatformId, OpenCLPlatformInfo& rPlatfor
}
-bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
-{
- // Check blacklist of known bad OpenCL implementations
- if (match(ScInterpreter::GetGlobalConfig().maOpenCLBlackList, rPlatform, rDevice, "blacklist"))
- {
- SAL_INFO("sc.opencl", "Rejecting");
- return true;
- }
-
- // Check for whitelist of known good OpenCL implementations
- if (match(ScInterpreter::GetGlobalConfig().maOpenCLWhiteList, rPlatform, rDevice, "whitelist"))
- {
- SAL_INFO("sc.opencl", "Approving");
- return false;
- }
-
- // Fallback: reject
- SAL_INFO("sc.opencl", "Fallback: rejecting platform=" << rPlatform << ", device=" << rDevice);
- return true;
-}
-
const std::vector<OpenCLPlatformInfo>& fillOpenCLInfo()
{
static std::vector<OpenCLPlatformInfo> aPlatforms;
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index ede5570..91ae7e5 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -64,19 +64,6 @@ void ScCalcConfig::setOpenCLConfigToDefault()
maOpenCLSubsetOpCodes.insert(ocCount);
maOpenCLSubsetOpCodes.insert(ocNormDist);
maOpenCLSubsetOpCodes.insert(ocSumIfs);
-
- // This entry we have had for some time (when blacklisting was
- // done elsewhere in the code), so presumably there is a known
- // good reason for it.
- maOpenCLBlackList.insert(OpenCLImplMatcher("Windows", "", "Intel\\(R\\) Corporation", "", "9\\.17\\.10\\.2884"));
-
- // This is what I have tested on Linux and it works for our unit tests.
- maOpenCLWhiteList.insert(OpenCLImplMatcher("Linux", "", "Advanced Micro Devices, Inc\\.", "", "1445\\.5 \\(sse2,avx\\)"));
-
- // For now, assume that AMD, Intel and NVIDIA drivers are good
- maOpenCLWhiteList.insert(OpenCLImplMatcher("", "", "Advanced Micro Devices, Inc\\.", "", ""));
- maOpenCLWhiteList.insert(OpenCLImplMatcher("", "", "Intel\\(R\\) Corporation", "", ""));
- maOpenCLWhiteList.insert(OpenCLImplMatcher("", "", "NVIDIA Corporation", "", ""));
}
void ScCalcConfig::reset()
@@ -103,8 +90,6 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const
maOpenCLDevice == r.maOpenCLDevice &&
mnOpenCLMinimumFormulaGroupSize == r.mnOpenCLMinimumFormulaGroupSize &&
maOpenCLSubsetOpCodes == r.maOpenCLSubsetOpCodes &&
- maOpenCLBlackList == r.maOpenCLBlackList &&
- maOpenCLWhiteList == r.maOpenCLWhiteList &&
true;
}
@@ -113,32 +98,6 @@ bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
return !operator==(r);
}
-std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMatcher& rImpl)
-{
- rStream << "{"
- "OS=" << rImpl.maOS << ","
- "OSVersion=" << rImpl.maOSVersion << ","
- "PlatformVendor=" << rImpl.maPlatformVendor << ","
- "Device=" << rImpl.maDevice << ","
- "DriverVersion=" << rImpl.maDriverVersion <<
- "}";
-
- return rStream;
-}
-
-std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig::OpenCLImplMatcherSet& rSet)
-{
- rStream << "{";
- for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
- {
- if (i != rSet.cbegin())
- rStream << ",";
- rStream << *i;
- }
- rStream << "}";
- return rStream;
-}
-
std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig& rConfig)
{
rStream << "{"
@@ -150,8 +109,6 @@ std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig& rConfig)
"OpenCLDevice='" << rConfig.maOpenCLDevice << "',"
"OpenCLMinimumFormulaGroupSize=" << rConfig.mnOpenCLMinimumFormulaGroupSize << ","
"OpenCLSubsetOpCodes={" << ScOpCodeSetToSymbolicString(rConfig.maOpenCLSubsetOpCodes) << "},"
- "OpenCLBlackList=" << rConfig.maOpenCLBlackList << ","
- "OpenCLWhiteList=" << rConfig.maOpenCLWhiteList <<
"}";
return rStream;
}
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index e7a6125..332072c 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -21,6 +21,7 @@
#include <formula/vectortoken.hxx>
#include <officecfg/Office/Common.hxx>
+#include <opencl/platforminfo.hxx>
#include <rtl/bootstrap.hxx>
#include <vector>
@@ -541,7 +542,7 @@ void FormulaGroupInterpreter::fillOpenCLInfo(std::vector<OpenCLPlatformInfo>& rP
#if !HAVE_FEATURE_OPENCL
(void) rPlatforms;
#else
- const std::vector<sc::OpenCLPlatformInfo>& rPlatformsFromWrapper =
+ const std::vector<OpenCLPlatformInfo>& rPlatformsFromWrapper =
sc::opencl::fillOpenCLInfo();
rPlatforms.assign(rPlatformsFromWrapper.begin(), rPlatformsFromWrapper.end());
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 8596653..b0f76c8 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -205,9 +205,7 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const
#define SCFORMULAOPT_OPENCL_SUBSET_ONLY 12
#define SCFORMULAOPT_OPENCL_MIN_SIZE 13
#define SCFORMULAOPT_OPENCL_SUBSET_OPS 14
-#define SCFORMULAOPT_OPENCL_BLACKLIST 15
-#define SCFORMULAOPT_OPENCL_WHITELIST 16
-#define SCFORMULAOPT_COUNT 17
+#define SCFORMULAOPT_COUNT 15
Sequence<OUString> ScFormulaCfg::GetPropertyNames()
{
@@ -228,8 +226,6 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
"Calculation/OpenCLSubsetOnly", // SCFORMULAOPT_OPENCL_SUBSET_ONLY
"Calculation/OpenCLMinimumDataSize", // SCFORMULAOPT_OPENCL_MIN_SIZE
"Calculation/OpenCLSubsetOpCodes", // SCFORMULAOPT_OPENCL_SUBSET_OPS
- "Calculation/OpenCLBlackList", // SCFORMULAOPT_OPENCL_BLACKLIST
- "Calculation/OpenCLWhiteList", // SCFORMULAOPT_OPENCL_WHITELIST
};
Sequence<OUString> aNames(SCFORMULAOPT_COUNT);
OUString* pNames = aNames.getArray();
@@ -258,8 +254,6 @@ ScFormulaCfg::PropsToIds ScFormulaCfg::GetPropNamesToId()
SCFORMULAOPT_OPENCL_SUBSET_ONLY,
SCFORMULAOPT_OPENCL_MIN_SIZE,
SCFORMULAOPT_OPENCL_SUBSET_OPS,
- SCFORMULAOPT_OPENCL_BLACKLIST,
- SCFORMULAOPT_OPENCL_WHITELIST,
};
OSL_ENSURE( SAL_N_ELEMENTS(aVals) == aPropNames.getLength(), "Properties and ids are out of Sync");
PropsToIds aPropIdMap;
@@ -276,73 +270,6 @@ ScFormulaCfg::ScFormulaCfg() :
EnableNotification( aNames );
}
-namespace {
-
-css::uno::Sequence<OUString> SetOfOpenCLImplMatcherToStringSequence(std::set<ScCalcConfig::OpenCLImplMatcher>& rSet)
-{
- css::uno::Sequence<OUString> result(rSet.size());
-
- size_t n(0);
- for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
- {
- result[n++] =
- (*i).maOS.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
- (*i).maOSVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
- (*i).maPlatformVendor.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
- (*i).maDevice.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" +
- (*i).maDriverVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B");
- }
-
- return result;
-}
-
-OUString getToken(const OUString& string, sal_Int32& index)
-{
- OUString token(string.getToken(0, '/', index));
- OUString result;
- sal_Int32 i(0);
- sal_Int32 p;
- while ((p = token.indexOf('%', i)) >= 0)
- {
- if (p > i)
- result += token.copy(i, p - i);
- if (p < token.getLength() - 2)
- {
- result += OUString(static_cast<sal_Unicode>(token.copy(p+1, 2).toInt32(16)));
- i = p + 3;
- }
- else
- {
- i = token.getLength();
- }
- }
- result += token.copy(i);
-
- return result;
-}
-
-std::set<ScCalcConfig::OpenCLImplMatcher> StringSequenceToSetOfOpenCLImplMatcher(css::uno::Sequence<OUString>& rSequence)
-{
- std::set<ScCalcConfig::OpenCLImplMatcher> result;
-
- for (auto i = rSequence.begin(); i != rSequence.end(); ++i)
- {
- ScCalcConfig::OpenCLImplMatcher m;
- sal_Int32 index(0);
- m.maOS = getToken(*i, index);
- m.maOSVersion = getToken(*i, index);
- m.maPlatformVendor = getToken(*i, index);
- m.maDevice = getToken(*i, index);
- m.maDriverVersion = getToken(*i, index);
-
- result.insert(m);
- }
-
- return result;
-}
-
-} // anonymous namespace
-
void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
{
Sequence<Any> aValues = GetProperties(aNames);
@@ -574,20 +501,6 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
GetCalcConfig().maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal);
}
break;
- case SCFORMULAOPT_OPENCL_BLACKLIST:
- {
- css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList);
- pValues[nProp] >>= sVal;
- GetCalcConfig().maOpenCLBlackList = StringSequenceToSetOfOpenCLImplMatcher(sVal);
- }
- break;
- case SCFORMULAOPT_OPENCL_WHITELIST:
- {
- css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLWhiteList);
- pValues[nProp] >>= sVal;
- GetCalcConfig().maOpenCLWhiteList = StringSequenceToSetOfOpenCLImplMatcher(sVal);
- }
- break;
}
}
}
@@ -734,18 +647,6 @@ void ScFormulaCfg::Commit()
pValues[nProp] <<= sVal;
}
break;
- case SCFORMULAOPT_OPENCL_BLACKLIST:
- {
- css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList);
- pValues[nProp] <<= sVal;
- }
- break;
- case SCFORMULAOPT_OPENCL_WHITELIST:
- {
- css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLWhiteList);
- pValues[nProp] <<= sVal;
- }
- break;
}
}
if(bSetOpenCL)
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index dbf390a..4dc5c4f 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -42,8 +42,6 @@ typedef enum {
CALC_OPTION_ENABLE_OPENCL_SUBSET,
CALC_OPTION_OPENCL_MIN_SIZE,
CALC_OPTION_OPENCL_SUBSET_OPS,
- CALC_OPTION_OPENCL_BLACKLIST,
- CALC_OPTION_OPENCL_WHITELIST,
} CalcOptionOrder;
class OptionString : public SvLBoxString
@@ -155,16 +153,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
get(mpBtnFalse, "false");
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list