LibreOffice Module opencl (master) 1
openclconfig.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef INCLUDED_OPENCL_OPENCLCONFIG_HXX
11#define INCLUDED_OPENCL_OPENCLCONFIG_HXX
12
13#include <ostream>
14#include <set>
15
16#include <opencl/opencldllapi.h>
17#include <rtl/ustring.hxx>
18#include <utility>
19
20struct OpenCLDeviceInfo;
22
24{
26 {
27 OUString maOS;
28 OUString maOSVersion;
30 OUString maDevice;
32
34 {
35 }
36
37 ImplMatcher(OUString aOS,
38 OUString aOSVersion,
39 OUString aPlatformVendor,
40 OUString aDevice,
41 OUString aDriverVersion)
42 : maOS(std::move(aOS)),
43 maOSVersion(std::move(aOSVersion)),
44 maPlatformVendor(std::move(aPlatformVendor)),
45 maDevice(std::move(aDevice)),
46 maDriverVersion(std::move(aDriverVersion))
47 {
48 }
49
50 bool operator==(const ImplMatcher& r) const
51 {
52 return maOS == r.maOS &&
53 maOSVersion == r.maOSVersion &&
54 maPlatformVendor == r.maPlatformVendor &&
55 maDevice == r.maDevice &&
56 maDriverVersion == r.maDriverVersion;
57 }
58 bool operator!=(const ImplMatcher& r) const
59 {
60 return !operator==(r);
61 }
62 bool operator<(const ImplMatcher& r) const
63 {
64 return (maOS < r.maOS ||
65 (maOS == r.maOS &&
66 (maOSVersion < r.maOSVersion ||
67 (maOSVersion == r.maOSVersion &&
68 (maPlatformVendor < r.maPlatformVendor ||
69 (maPlatformVendor == r.maPlatformVendor &&
70 (maDevice < r.maDevice ||
71 (maDevice == r.maDevice &&
72 (maDriverVersion < r.maDriverVersion)))))))));
73 }
74 };
75
77
78 typedef std::set<ImplMatcher> ImplMatcherSet;
79
82
84
85 bool operator== (const OpenCLConfig& r) const;
86 bool operator!= (const OpenCLConfig& r) const;
87
88 static OpenCLConfig get();
89
90 void set();
91
92 bool checkImplementation(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice) const;
93};
94
95OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig& rConfig);
96OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcher& rImpl);
97OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcherSet& rSet);
98
99#endif
100
101/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void set(css::uno::UnoInterfaceReference const &value)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OPENCL_DLLPUBLIC std::ostream & operator<<(std::ostream &rStream, const OpenCLConfig &rConfig)
#define OPENCL_DLLPUBLIC
Definition: opencldllapi.h:28
ImplMatcher(OUString aOS, OUString aOSVersion, OUString aPlatformVendor, OUString aDevice, OUString aDriverVersion)
bool operator!=(const ImplMatcher &r) const
bool operator==(const ImplMatcher &r) const
bool operator<(const ImplMatcher &r) const
std::set< ImplMatcher > ImplMatcherSet
ImplMatcherSet maDenyList
ImplMatcherSet maAllowList
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)