tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / include / opencl / openclconfig.hxx
blob2e099bafe69e3aa3d20b03952e681ab681ce5506
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_OPENCL_OPENCLCONFIG_HXX
11 #define INCLUDED_OPENCL_OPENCLCONFIG_HXX
13 #include <ostream>
14 #include <set>
16 #include <opencl/opencldllapi.h>
17 #include <rtl/ustring.hxx>
18 #include <utility>
20 struct OpenCLDeviceInfo;
21 struct OpenCLPlatformInfo;
23 struct OPENCL_DLLPUBLIC OpenCLConfig
25 struct ImplMatcher
27 OUString maOS;
28 OUString maOSVersion;
29 OUString maPlatformVendor;
30 OUString maDevice;
31 OUString maDriverVersion;
33 ImplMatcher()
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))
50 bool operator==(const ImplMatcher& r) const
52 return maOS == r.maOS &&
53 maOSVersion == r.maOSVersion &&
54 maPlatformVendor == r.maPlatformVendor &&
55 maDevice == r.maDevice &&
56 maDriverVersion == r.maDriverVersion;
58 bool operator!=(const ImplMatcher& r) const
60 return !operator==(r);
62 bool operator<(const ImplMatcher& r) const
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)))))))));
76 bool mbUseOpenCL;
78 typedef std::set<ImplMatcher> ImplMatcherSet;
80 ImplMatcherSet maDenyList;
81 ImplMatcherSet maAllowList;
83 OpenCLConfig();
85 bool operator== (const OpenCLConfig& r) const;
86 bool operator!= (const OpenCLConfig& r) const;
88 static OpenCLConfig get();
90 void set();
92 bool checkImplementation(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice) const;
95 OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig& rConfig);
96 OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcher& rImpl);
97 OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcherSet& rSet);
99 #endif
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */