Kaydet (Commit) c1d09b1a authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst ccfb8c78
......@@ -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) \
......
......@@ -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) \
......
......@@ -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@
......
......@@ -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
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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: */
......@@ -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();
}
......
......@@ -57,8 +57,6 @@ private:
CheckBox* m_pCollectUsageInfo;
CheckBox* m_pUseOpenCL;
DECL_LINK( TwoFigureHdl, NumericField* );
DECL_LINK( TwoFigureConfigHdl, NumericField* );
DECL_LINK(HelpCheckHdl_Impl, void *);
......
/* -*- 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: */
/* -*- 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: */
......@@ -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
......
......@@ -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
......
This diff is collapsed.
......@@ -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>
This diff is collapsed.
/* -*- 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: */
/* -*- 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: */
......@@ -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