diff --git a/Repository.mk b/Repository.mk index 5476f89c5cdc..b124c9122118 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 6190e4bd94e4..4ad30ff84be3 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 a23629f05098..58e8899dfb71 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 92a2d1b05eb0..316bfb01b450 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 b821f2a6a45b..b564e4d32012 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 70438d4906bd..d8cd1784dc75 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 d25afbb47d6b..f2202c2ecafb 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 c449eb04b75a..e68743da2310 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 a6a7dac8df83..33534573502d 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 000000000000..1de17b8248b1 --- /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 +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#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 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(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 000000000000..818eec45f739 --- /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 +#include +#include +#include +#include + +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 fd7810c7ada2..772f80f8fb10 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 54be930ff059..fac9779839ce 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 000000000000..3c2b2384362a --- /dev/null +++ b/cui/uiconfig/ui/blackorwhitelistentrydialog.ui @@ -0,0 +1,281 @@ + + + + + + + False + 6 + dummy + False + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + True + + + + + False + True + end + 0 + + + + + True + False + True + 12 + + + True + False + True + 6 + + + True + False + 0 + OS: + True + name + + + 0 + 0 + + + + + True + True + True + 12 + + + 0 + 0 + + + + + True + False + 0 + OS version: + True + name + + + 0 + 0 + + + + + True + True + True + 22 + + + 0 + 1 + + + + + True + False + 0 + OpenCL platform vendor: + True + name + + + 0 + 2 + + + + + True + True + True + 12 + + + 0 + 3 + + + + + True + False + 0 + Device: + True + name + + + 0 + 4 + + + + + True + True + True + 22 + + + 0 + 5 + + + + + True + False + 0 + Driver version: + True + name + + + 0 + 6 + + + + + True + True + True + 22 + + + 0 + 7 + + + + + 0 + 1 + + + + + False + True + Edit Black-list Entry + + + 0 + 2 + + + + + False + True + Create Black-list Entry + + + 0 + 3 + + + + + False + True + Edit White-list Entry + + + 0 + 4 + + + + + False + True + Create White-list Entry + + + 0 + 5 + + + + + False + True + 1 + + + + + + ok + cancel + help + + + diff --git a/cui/uiconfig/ui/optgeneralpage.ui b/cui/uiconfig/ui/optgeneralpage.ui index d3e801593ff0..b1447c59cecd 100644 --- a/cui/uiconfig/ui/optgeneralpage.ui +++ b/cui/uiconfig/ui/optgeneralpage.ui @@ -370,46 +370,5 @@ 5 - - - True - False - 0 - none - - - True - False - 6 - 12 - - - Allow use of OpenCL - True - True - False - True - 0 - True - - - - - - - True - False - OpenCL - - - - - - - - 0 - 6 - - diff --git a/cui/uiconfig/ui/optopenclpage.ui b/cui/uiconfig/ui/optopenclpage.ui new file mode 100644 index 000000000000..84fe49b0095b --- /dev/null +++ b/cui/uiconfig/ui/optopenclpage.ui @@ -0,0 +1,349 @@ + + + + + + True + False + True + 6 + 0 + none + + + True + False + True + 6 + 12 + + + True + False + True + True + vertical + 12 + + + Allow use of OpenCL + True + True + False + True + 0 + True + + + False + True + 0 + + + + + True + False + 0 + OpenCL black-list: + True + blacklist + + + False + True + 1 + + + + + True + False + True + True + 12 + + + True + False + vertical + 12 + start + + + _Edit... + True + True + True + True + + + False + True + 0 + + + + + _Add... + True + True + True + True + + + False + True + 1 + + + + + _Delete... + True + True + True + True + + + False + True + 2 + + + + + 1 + 0 + + + + + True + False + True + True + + + False + True + 6 + + + True + False + 0 + OS + + + 0 + 1 + + + + + True + False + 0 + OS Version + + + 1 + 1 + + + + + True + False + 0 + Platform vendor + + + 3 + 1 + + + + + True + False + 0 + Device + + + 2 + 1 + + + + + True + False + 0 + Driver version + + + 4 + 1 + + + + + 0 + 0 + + + + + True + False + True + True + + + 0 + 1 + + + + + 0 + 0 + + + + + False + True + 2 + + + + + True + False + 0 + OpenCL white-list: + True + blacklist + + + False + True + 3 + + + + + True + False + True + True + 12 + + + True + False + vertical + 12 + start + + + _Edit... + True + True + True + True + + + False + True + 0 + + + + + _Add... + True + True + True + True + + + False + True + 1 + + + + + _Delete... + True + True + True + True + + + False + True + 2 + + + + + 1 + 0 + + + + + True + False + True + True + + + True + False + True + True + + + 0 + 1 + + + + + 0 + 0 + + + + + False + True + 4 + + + + + + + + + True + False + OpenCL Options + + + + + + + + + + + diff --git a/include/opencl/openclconfig.hxx b/include/opencl/openclconfig.hxx new file mode 100644 index 000000000000..c3a11034f1b4 --- /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 +#include + +#include +#include +#include + +#include + +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 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 000000000000..f62b94cb77fc --- /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 + +#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 8fd0ee2aeabc..6c40c438ed5a 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 #include +#include + +#include #include -#include "scdllapi.h" +// Struct that describs an actual instance of an OpenCL device -namespace sc { - -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 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 001654a5e30d..d82ade012fd0 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -1382,20 +1382,6 @@ - - - - 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. - - Windows//Intel\(R\) Corporation//9\.17\.10\.2884 - - - - - Like OpenCLBlackList, but for combinations known to be good. - - Linux//Advanced Micro Devices, Inc\.//1445\.5 \(sse2,avx\);//Advanced Micro Devices, Inc\.//;//Intel\(R\) Corporation//;//NVIDIA Corporation// - diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 74a25aa4811f..af930da023ea 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5560,6 +5560,20 @@ true + + + + 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. + + Windows//Intel\(R\) Corporation//9\.17\.10\.2884 + + + + + Like OpenCLBlackList, but for combinations known to be good. + + Linux//Advanced Micro Devices, Inc\.//1445\.5 \(sse2,avx\);//Advanced Micro Devices, Inc\.//;//Intel\(R\) Corporation//;//NVIDIA Corporation// + 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 000000000000..51ca62c71302 --- /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 000000000000..0997e628485b --- /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 000000000000..92a80160a1bb --- /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 000000000000..aa7a07ae3e97 --- /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 +#include + +#include +#include +#include +#include +#include +#include + +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 SetOfImplMatcherToStringSequence(const OpenCLConfig::ImplMatcherSet& rSet) +{ + css::uno::Sequence 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(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& 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(rPattern.getStr()), rPattern.getLength()); + icu::UnicodeString sIcuInput(reinterpret_cast(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 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 6258844840fb..4871702800a0 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 -namespace sc { +#include 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 16ebd5e32bd0..65aedde067dc 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 86795e82850d..9d07b3e5c704 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 ca854a86ac69..3ad559fc0687 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 477b6fc3527d..a00e81a6225d 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 0a27d1b3be1a..1477134511de 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 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 ba5f31893345..19debeeec669 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 +#include #include #include diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index f5f8324bdd57..8ead15020965 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -10,6 +10,7 @@ #include #include "scdll.hxx" +#include #include #include #include @@ -30,7 +31,6 @@ #include "drwlayer.hxx" #include "userdat.hxx" #include "formulacell.hxx" -#include "platforminfo.hxx" #include "formulagroup.hxx" #include diff --git a/sc/source/core/inc/openclwrapper.hxx b/sc/source/core/inc/openclwrapper.hxx index 9f3edc9c3b4c..9dad74749bb6 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 -#include #include +#include #include #include #include #include -#include "platforminfo.hxx" #include @@ -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 958fd1ac97b3..f845f423d0e1 100644 --- a/sc/source/core/opencl/opencl_device.cxx +++ b/sc/source/core/opencl/opencl_device.cxx @@ -21,13 +21,16 @@ #include #include #include -#include -#include + #include +#include +#include +#include +#include + #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 66af89fa05e2..20f4919c88c0 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -15,6 +15,7 @@ #include "openclwrapper.hxx" #include +#include #include #include #include @@ -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(rPattern.getStr()), rPattern.getLength()); - icu::UnicodeString sIcuInput(reinterpret_cast(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& fillOpenCLInfo() { static std::vector aPlatforms; diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx index ede5570dee02..91ae7e5676a2 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 e7a61259fd18..332072c09def 100644 --- a/sc/source/core/tool/formulagroup.cxx +++ b/sc/source/core/tool/formulagroup.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -541,7 +542,7 @@ void FormulaGroupInterpreter::fillOpenCLInfo(std::vector& rP #if !HAVE_FEATURE_OPENCL (void) rPlatforms; #else - const std::vector& rPlatformsFromWrapper = + const std::vector& 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 85966530a4dc..b0f76c86b048 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 ScFormulaCfg::GetPropertyNames() { @@ -228,8 +226,6 @@ Sequence 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 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 SetOfOpenCLImplMatcherToStringSequence(std::set& rSet) -{ - css::uno::Sequence 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(token.copy(p+1, 2).toInt32(16))); - i = p + 3; - } - else - { - i = token.getLength(); - } - } - result += token.copy(i); - - return result; -} - -std::set StringSequenceToSetOfOpenCLImplMatcher(css::uno::Sequence& rSequence) -{ - std::set 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& aNames ) { Sequence aValues = GetProperties(aNames); @@ -574,20 +501,6 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence& aNames ) GetCalcConfig().maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal); } break; - case SCFORMULAOPT_OPENCL_BLACKLIST: - { - css::uno::Sequence sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList); - pValues[nProp] >>= sVal; - GetCalcConfig().maOpenCLBlackList = StringSequenceToSetOfOpenCLImplMatcher(sVal); - } - break; - case SCFORMULAOPT_OPENCL_WHITELIST: - { - css::uno::Sequence 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 sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList); - pValues[nProp] <<= sVal; - } - break; - case SCFORMULAOPT_OPENCL_WHITELIST: - { - css::uno::Sequence 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 dbf390a688a1..4dc5c4f556f0 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"); get(mpSpinButton, "spinbutton"); get(mpEditField, "entry"); - get(mpOpenCLWhiteAndBlackListGrid, "listgrid"); - get(mpOpenCLWhiteAndBlackListBox, "listbox"); - get(mpOS, "os"); - get(mpOSVersion, "osversion"); - get(mpPlatformVendor, "platformvendor"); - get(mpDevice, "opencldevice"); - get(mpDriverVersion, "opencldriverversion"); - get(mpListNewButton, "listbox-new"); - get(mpListDeleteButton, "listbox-delete"); - get(mpTestButton, "test"); get(mpOpenclInfoList, "opencl_list"); get(mpBtnAutomaticSelectionTrue, "automatic_select_true"); get(mpBtnAutomaticSelectionFalse, "automatic_select_false"); @@ -174,14 +162,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi mpSpinButton->SetModifyHdl(LINK(this, ScCalcOptionsDialog, NumModifiedHdl)); mpEditField->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl)); - mpOS->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl)); - mpOSVersion->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl)); - mpPlatformVendor->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl)); - mpDevice->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl)); - mpDriverVersion->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl)); - - mpOpenCLWhiteAndBlackListBox->set_height_request(4* mpOpenCLWhiteAndBlackListBox->GetTextHeight()); - mpOpenCLWhiteAndBlackListBox->SetStyle(mpOpenCLWhiteAndBlackListBox->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE); mpOpenclInfoList->set_height_request(4* mpOpenclInfoList->GetTextHeight()); mpOpenclInfoList->SetStyle(mpOpenclInfoList->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE); @@ -214,12 +194,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi maCaptionOpenCLSubsetOpCodes = get("opencl_subset_opcodes")->GetText(); maDescOpenCLSubsetOpCodes = get("opencl_subset_opcodes_desc")->GetText(); - maCaptionOpenCLBlackList = get("opencl_blacklist")->GetText(); - maDescOpenCLBlackList = get("opencl_blacklist_desc")->GetText(); - - maCaptionOpenCLWhiteList = get("opencl_whitelist")->GetText(); - maDescOpenCLWhiteList = get("opencl_whitelist_desc")->GetText(); - maSoftware = get("software")->GetText(); mpLbSettings->set_height_request(8 * mpLbSettings->GetTextHeight()); @@ -230,14 +204,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi mpLbSettings->SetSelectHdl(aLink); mpLbOptionEdit->SetSelectHdl(aLink); - aLink = LINK(this, ScCalcOptionsDialog, OpenCLWhiteAndBlackListSelHdl); - mpOpenCLWhiteAndBlackListBox->SetSelectHdl(aLink); - - mpListNewButton->SetClickHdl(LINK(this, ScCalcOptionsDialog, ListNewClickHdl)); - mpListDeleteButton->SetClickHdl(LINK(this, ScCalcOptionsDialog, ListDeleteClickHdl)); - - mpTestButton->SetClickHdl(LINK(this, ScCalcOptionsDialog, TestClickHdl)); - aLink = LINK(this, ScCalcOptionsDialog, BtnToggleHdl); mpBtnTrue->SetToggleHdl(aLink); // Set handler only to the 'True' button. @@ -293,10 +259,10 @@ void ScCalcOptionsDialog::fillOpenCLList() SvTreeListEntry* pSelectedEntry = NULL; sc::FormulaGroupInterpreter::fillOpenCLInfo(maPlatformInfo); - for(std::vector::iterator it = maPlatformInfo.begin(), + for(std::vector::iterator it = maPlatformInfo.begin(), itEnd = maPlatformInfo.end(); it != itEnd; ++it) { - for(std::vector::iterator + for(std::vector::iterator itr = it->maDevices.begin(), itrEnd = it->maDevices.end(); itr != itrEnd; ++itr) { OUString aDeviceId = it->maVendor + " " + itr->maName + " " + itr->maDriver; @@ -320,32 +286,6 @@ void ScCalcOptionsDialog::fillOpenCLList() SelectedDeviceChanged(); } -namespace { - -OUString format(const ScCalcConfig::OpenCLImplMatcher& rImpl) -{ - return (rImpl.maOS + " " + - rImpl.maOSVersion + " " + - rImpl.maPlatformVendor + " " + - rImpl.maDevice + " " + - rImpl.maDriverVersion); -} - -void fillListBox(ListBox* pListBox, const ScCalcConfig::OpenCLImplMatcherSet& rSet) -{ - pListBox->SetUpdateMode(false); - pListBox->Clear(); - - for (auto i = rSet.cbegin(); i != rSet.cend(); ++i) - { - pListBox->InsertEntry(format(*i), LISTBOX_APPEND); - } - - pListBox->SetUpdateMode(true); -} - -} // anonymous namespace - #endif namespace { @@ -386,8 +326,6 @@ void ScCalcOptionsDialog::FillOptionsList() pModel->Insert(createItem(maCaptionOpenCLSubsetEnabled,toString(maConfig.mbOpenCLSubsetOnly))); pModel->Insert(createItem(maCaptionOpenCLMinimumFormulaSize,toString(maConfig.mnOpenCLMinimumFormulaGroupSize))); pModel->Insert(createItem(maCaptionOpenCLSubsetOpCodes,ScOpCodeSetToSymbolicString(maConfig.maOpenCLSubsetOpCodes))); - pModel->Insert(createItem(maCaptionOpenCLBlackList,"")); - pModel->Insert(createItem(maCaptionOpenCLWhiteList,"")); fillOpenCLList(); @@ -410,7 +348,6 @@ void ScCalcOptionsDialog::SelectionChanged() mpBtnFalse->Hide(); mpSpinButton->Hide(); mpEditField->Hide(); - mpOpenCLWhiteAndBlackListGrid->Hide(); mpLbOptionEdit->Show(); mpOpenclInfoList->GetParent()->Hide(); @@ -445,7 +382,6 @@ void ScCalcOptionsDialog::SelectionChanged() mpBtnFalse->Hide(); mpSpinButton->Hide(); mpEditField->Hide(); - mpOpenCLWhiteAndBlackListGrid->Hide(); mpLbOptionEdit->Show(); mpOpenclInfoList->GetParent()->Hide(); @@ -482,7 +418,6 @@ void ScCalcOptionsDialog::SelectionChanged() mpBtnFalse->Show(); mpSpinButton->Hide(); mpEditField->Hide(); - mpOpenCLWhiteAndBlackListGrid->Hide(); bool bValue = false; bool bEnable = true; @@ -546,7 +481,6 @@ void ScCalcOptionsDialog::SelectionChanged() mpBtnFalse->Hide(); mpSpinButton->Show(); mpEditField->Hide(); - mpOpenCLWhiteAndBlackListGrid->Hide(); mpOpenclInfoList->GetParent()->Hide(); mpFtAnnotation->SetText(maDescOpenCLMinimumFormulaSize); mpSpinButton->SetValue(nValue); @@ -563,38 +497,12 @@ void ScCalcOptionsDialog::SelectionChanged() mpBtnFalse->Hide(); mpSpinButton->Hide(); mpEditField->Show(); - mpOpenCLWhiteAndBlackListGrid->Hide(); mpOpenclInfoList->GetParent()->Hide(); mpFtAnnotation->SetText(maDescOpenCLSubsetOpCodes); mpEditField->SetText(sValue); } break; - // string lists - case CALC_OPTION_OPENCL_BLACKLIST: - case CALC_OPTION_OPENCL_WHITELIST: - { - mpLbOptionEdit->Hide(); - mpBtnTrue->Hide(); - mpBtnFalse->Hide(); - mpSpinButton->Hide(); - mpEditField->Hide(); - mpOpenCLWhiteAndBlackListGrid->Show(); - mpOpenclInfoList->GetParent()->Hide(); -#if HAVE_FEATURE_OPENCL - if ( nSelectedPos == CALC_OPTION_OPENCL_WHITELIST ) - { - mpFtAnnotation->SetText(maDescOpenCLWhiteList); - fillListBox(mpOpenCLWhiteAndBlackListBox, maConfig.maOpenCLWhiteList); - } - else - { - mpFtAnnotation->SetText(maDescOpenCLBlackList); - fillListBox(mpOpenCLWhiteAndBlackListBox, maConfig.maOpenCLBlackList); - } -#endif - } - break; } } @@ -647,8 +555,6 @@ void ScCalcOptionsDialog::ListOptionValueChanged() case CALC_OPTION_ENABLE_OPENCL_SUBSET: case CALC_OPTION_OPENCL_MIN_SIZE: case CALC_OPTION_OPENCL_SUBSET_OPS: - case CALC_OPTION_OPENCL_BLACKLIST: - case CALC_OPTION_OPENCL_WHITELIST: break; } } @@ -671,7 +577,7 @@ void ScCalcOptionsDialog::SelectedDeviceChanged() if(!pEntry) return; - sc::OpenCLDeviceInfo* pInfo = reinterpret_cast(pEntry->GetUserData()); + OpenCLDeviceInfo* pInfo = reinterpret_cast(pEntry->GetUserData()); if(pInfo) { mpFtFrequency->SetText(OUString::number(pInfo->mnFrequency)); @@ -726,22 +632,6 @@ void ScCalcOptionsDialog::SpinButtonValueChanged() maConfig.mnOpenCLMinimumFormulaGroupSize = nVal; } -ScCalcConfig::OpenCLImplMatcherSet& ScCalcOptionsDialog::CurrentWhiteOrBlackList() -{ - return (mpLbSettings->GetSelectEntryPos() == CALC_OPTION_OPENCL_WHITELIST ? maConfig.maOpenCLWhiteList : maConfig.maOpenCLBlackList); -} - -const ScCalcConfig::OpenCLImplMatcher& ScCalcOptionsDialog::CurrentWhiteOrBlackListEntry() -{ - ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList()); - - auto i = rSet.begin(); - int n(mpOpenCLWhiteAndBlackListBox->GetSelectEntryPos()); - std::advance(i, n); - - return *i; -} - void ScCalcOptionsDialog::EditFieldValueChanged(Control *pCtrl) { Edit& rEdit(dynamic_cast(*pCtrl)); @@ -754,46 +644,6 @@ void ScCalcOptionsDialog::EditFieldValueChanged(Control *pCtrl) // the OpenCL subset list of opcodes maConfig.maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal); } - else - { - // We know that this handler is otherwise currently used only - // for the OpenCL white/blacklists - - const ScCalcConfig::OpenCLImplMatcher& impl(CurrentWhiteOrBlackListEntry()); - ScCalcConfig::OpenCLImplMatcher newImpl(impl); - - if (&rEdit == mpOS) - { - newImpl.maOS = sVal; - } - else if (&rEdit == mpOSVersion) - { - newImpl.maOSVersion = sVal; - } - else if (&rEdit == mpPlatformVendor) - { - newImpl.maPlatformVendor = sVal; - } - else if (&rEdit == mpDevice) - { - newImpl.maDevice = sVal; - } - else if (&rEdit == mpDriverVersion) - { - newImpl.maDriverVersion = sVal; - } - else - assert(false && "rEdit does not match any of the Edit fields"); - - ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList()); - - rSet.erase(impl); - rSet.insert(newImpl); -#if HAVE_FEATURE_OPENCL - fillListBox(mpOpenCLWhiteAndBlackListBox, rSet); - mpOpenCLWhiteAndBlackListBox->SelectEntry(format(newImpl)); -#endif - } } OUString ScCalcOptionsDialog::toString(formula::FormulaGrammar::AddressConvention eConv) const @@ -879,54 +729,7 @@ IMPL_LINK(ScCalcOptionsDialog, EditModifiedHdl, Control*, pCtrl) return 0; } -IMPL_LINK(ScCalcOptionsDialog, OpenCLWhiteAndBlackListSelHdl, Control*, ) -{ - // We know this handler is used for the mpOpenCLWhiteAndBlackListBox - - const ScCalcConfig::OpenCLImplMatcher& impl(CurrentWhiteOrBlackListEntry()); - - mpOS->SetText(impl.maOS); - mpOSVersion->SetText(impl.maOSVersion); - mpPlatformVendor->SetText(impl.maPlatformVendor); - mpDevice->SetText(impl.maDevice); - mpDriverVersion->SetText(impl.maDriverVersion); - - return 0; -} - -IMPL_LINK( ScCalcOptionsDialog, ListNewClickHdl, PushButton*, ) -{ - ScCalcConfig::OpenCLImplMatcher aEmpty; - ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList()); - - mpOS->SetText(""); - mpOSVersion->SetText(""); - mpPlatformVendor->SetText(""); - mpDevice->SetText(""); - mpDriverVersion->SetText(""); - - rSet.insert(aEmpty); -#if HAVE_FEATURE_OPENCL - fillListBox(mpOpenCLWhiteAndBlackListBox, rSet); - mpOpenCLWhiteAndBlackListBox->SelectEntry(format(aEmpty)); -#endif - return 0; -} - -IMPL_LINK( ScCalcOptionsDialog, ListDeleteClickHdl, PushButton*, ) -{ - if (mpOpenCLWhiteAndBlackListBox->GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND) - return 0; - - ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList()); - const ScCalcConfig::OpenCLImplMatcher& rImpl(CurrentWhiteOrBlackListEntry()); - -#if HAVE_FEATURE_OPENCL - rSet.erase(rImpl); - fillListBox(mpOpenCLWhiteAndBlackListBox, rSet); -#endif - return 0; -} +#if 0 namespace { @@ -1360,4 +1163,6 @@ IMPL_LINK( ScCalcOptionsDialog, TestClickHdl, PushButton*, ) return 0; } +#endif + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx index 5c483b02976f..789c01ddbd7d 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.hxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx @@ -25,7 +25,8 @@ #include "calcconfig.hxx" #if HAVE_FEATURE_OPENCL -#include "platforminfo.hxx" +#include +#include #endif class ScCalcOptionsDialog : public ModalDialog @@ -40,10 +41,6 @@ public: DECL_LINK( DeviceSelHdl, void* ); DECL_LINK( NumModifiedHdl, void * ); DECL_LINK( EditModifiedHdl, Control * ); - DECL_LINK( OpenCLWhiteAndBlackListSelHdl, Control* ); - DECL_LINK( ListNewClickHdl, PushButton* ); - DECL_LINK( ListDeleteClickHdl, PushButton* ); - DECL_LINK( TestClickHdl, PushButton* ); const ScCalcConfig& GetConfig() const { return maConfig;} @@ -66,8 +63,8 @@ private: OUString toString(sal_Int32 nVal) const; SvTreeListEntry *createItem(const OUString &rCaption, const OUString& sValue) const; void setValueAt(size_t nPos, const OUString &rString); - std::set& CurrentWhiteOrBlackList(); - const ScCalcConfig::OpenCLImplMatcher& CurrentWhiteOrBlackListEntry(); + OpenCLConfig::ImplMatcherSet& CurrentWhiteOrBlackList(); + const OpenCLConfig::ImplMatcher& CurrentWhiteOrBlackListEntry(); private: SvxCheckListBox* mpLbSettings; @@ -77,16 +74,6 @@ private: RadioButton* mpBtnFalse; NumericField* mpSpinButton; Edit* mpEditField; - VclGrid* mpOpenCLWhiteAndBlackListGrid; - ListBox* mpOpenCLWhiteAndBlackListBox; - Edit* mpOS; - Edit* mpOSVersion; - Edit* mpPlatformVendor; - Edit* mpDevice; - Edit* mpDriverVersion; - PushButton* mpListNewButton; - PushButton* mpListDeleteButton; - PushButton* mpTestButton; FixedText* mpFtAnnotation; FixedText* mpFtFrequency; @@ -128,17 +115,11 @@ private: OUString maCaptionOpenCLSubsetOpCodes; OUString maDescOpenCLSubsetOpCodes; - OUString maCaptionOpenCLWhiteList; - OUString maDescOpenCLWhiteList; - - OUString maCaptionOpenCLBlackList; - OUString maDescOpenCLBlackList; - OUString maSoftware; ScCalcConfig maConfig; #if HAVE_FEATURE_OPENCL - std::vector maPlatformInfo; + std::vector maPlatformInfo; #endif bool mbSelectedEmptyStringAsZero; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 94a06f050073..2e1ee23d5235 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include "docuno.hxx" #include "cellsuno.hxx" @@ -93,7 +94,6 @@ #include "sheetevents.hxx" #include "sc.hrc" #include "scresid.hxx" -#include "platforminfo.hxx" #include "interpre.hxx" #include "formulagroup.hxx" #include "gridwin.hxx" @@ -2369,7 +2369,7 @@ void ScModelObj::selectOpenCLDevice( sal_Int32 nPlatform, sal_Int32 nDevice ) if(nPlatform < 0 || nDevice < 0) throw uno::RuntimeException(); - std::vector aPlatformInfo; + std::vector aPlatformInfo; sc::FormulaGroupInterpreter::fillOpenCLInfo(aPlatformInfo); if(size_t(nPlatform) >= aPlatformInfo.size()) throw uno::RuntimeException(); @@ -2402,7 +2402,7 @@ sal_Int32 ScModelObj::getDeviceID() uno::Sequence< sheet::opencl::OpenCLPlatform > ScModelObj::getOpenCLPlatforms() throw (uno::RuntimeException, std::exception) { - std::vector aPlatformInfo; + std::vector aPlatformInfo; sc::FormulaGroupInterpreter::fillOpenCLInfo(aPlatformInfo); uno::Sequence aRet(aPlatformInfo.size()); @@ -2414,7 +2414,7 @@ uno::Sequence< sheet::opencl::OpenCLPlatform > ScModelObj::getOpenCLPlatforms() aRet[i].Devices.realloc(aPlatformInfo[i].maDevices.size()); for(size_t j = 0; j < aPlatformInfo[i].maDevices.size(); ++j) { - const sc::OpenCLDeviceInfo& rDevice = aPlatformInfo[i].maDevices[j]; + const OpenCLDeviceInfo& rDevice = aPlatformInfo[i].maDevices[j]; aRet[i].Devices[j].Name = rDevice.maName; aRet[i].Devices[j].Vendor = rDevice.maVendor; aRet[i].Devices[j].Driver = rDevice.maDriver; diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui index 0cdaaabc0270..37a10c64c13b 100644 --- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui +++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui @@ -184,210 +184,6 @@ 0 - - - True - True - True - True - - - True - True - True - True - - - 0 - 0 - - - - - True - True - vertical - True - 6 - - - True - False - 0 - OS - os:border - - - 0 - 0 - - - - - True - True - - - 0 - 1 - - - - - True - False - 0 - OS Version - osversion:border - - - 0 - 2 - - - - - True - True - - - 0 - 3 - - - - - True - False - 0 - OpenCL Platform Vendor - platformvendor:border - - - 0 - 4 - - - - - True - True - - - 0 - 5 - - - - - True - False - 0 - OpenCL Device - opencldevice:border - - - 0 - 6 - - - - - True - True - - - 0 - 7 - - - - - True - False - 0 - OpenCL Driver Version - opencldriverversion:border - - - 0 - 8 - - - - - True - True - - - 0 - 9 - - - - - 1 - 0 - - - - - True - False - vertical - 6 - start - - - _New... - True - True - True - - - False - True - 1 - - - - - _Delete - True - True - True - - - False - True - 2 - - - - - _Test - True - True - True - - - False - True - 3 - - - - - 2 - 0 - - - - - 5 - 0 - - 1 @@ -653,62 +449,6 @@ 1 - - - False - True - OpenCL implementation blacklist - - - 0 - 21 - 1 - 1 - - - - - False - True - List of OpenCL implementations known to be not good enough for LibreOffice. All the fields except OS are regular expressions. - True - 56 - - - 0 - 22 - 1 - 1 - - - - - False - True - OpenCL implementation whitelist - - - 0 - 23 - 1 - 1 - - - - - False - True - List of OpenCL implementations known to be usable by LibreOffice. All the fields except OS are regular expressions. - True - 56 - - - 0 - 25 - 1 - 1 - - False