Bump version to 6.4-15
[LibreOffice.git] / include / opencl / openclconfig.hxx
blobc7a188a732034ee896370f9eeef9f3add1a5fd54
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>
19 struct OpenCLDeviceInfo;
20 struct OpenCLPlatformInfo;
22 struct OPENCL_DLLPUBLIC OpenCLConfig
24 struct ImplMatcher
26 OUString maOS;
27 OUString maOSVersion;
28 OUString maPlatformVendor;
29 OUString maDevice;
30 OUString maDriverVersion;
32 ImplMatcher()
36 ImplMatcher(const OUString& rOS,
37 const OUString& rOSVersion,
38 const OUString& rPlatformVendor,
39 const OUString& rDevice,
40 const OUString& rDriverVersion)
41 : maOS(rOS),
42 maOSVersion(rOSVersion),
43 maPlatformVendor(rPlatformVendor),
44 maDevice(rDevice),
45 maDriverVersion(rDriverVersion)
49 bool operator==(const ImplMatcher& r) const
51 return maOS == r.maOS &&
52 maOSVersion == r.maOSVersion &&
53 maPlatformVendor == r.maPlatformVendor &&
54 maDevice == r.maDevice &&
55 maDriverVersion == r.maDriverVersion;
57 bool operator!=(const ImplMatcher& r) const
59 return !operator==(r);
61 bool operator<(const ImplMatcher& r) const
63 return (maOS < r.maOS ||
64 (maOS == r.maOS &&
65 (maOSVersion < r.maOSVersion ||
66 (maOSVersion == r.maOSVersion &&
67 (maPlatformVendor < r.maPlatformVendor ||
68 (maPlatformVendor == r.maPlatformVendor &&
69 (maDevice < r.maDevice ||
70 (maDevice == r.maDevice &&
71 (maDriverVersion < r.maDriverVersion)))))))));
75 bool mbUseOpenCL;
77 typedef std::set<ImplMatcher> ImplMatcherSet;
79 ImplMatcherSet maBlackList;
80 ImplMatcherSet maWhiteList;
82 OpenCLConfig();
84 bool operator== (const OpenCLConfig& r) const;
85 bool operator!= (const OpenCLConfig& r) const;
87 static OpenCLConfig get();
89 void set();
91 bool checkImplementation(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice) const;
94 OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig& rConfig);
95 OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcher& rImpl);
96 OPENCL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig::ImplMatcherSet& rSet);
98 #endif
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */