1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_OPENCL_OPENCLCONFIG_HXX
11 #define INCLUDED_OPENCL_OPENCLCONFIG_HXX
16 #include <opencl/opencldllapi.h>
17 #include <rtl/ustring.hxx>
20 struct OpenCLDeviceInfo
;
21 struct OpenCLPlatformInfo
;
23 struct OPENCL_DLLPUBLIC OpenCLConfig
29 OUString maPlatformVendor
;
31 OUString maDriverVersion
;
37 ImplMatcher(OUString aOS
,
39 OUString aPlatformVendor
,
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
||
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
)))))))));
78 typedef std::set
<ImplMatcher
> ImplMatcherSet
;
80 ImplMatcherSet maDenyList
;
81 ImplMatcherSet maAllowList
;
85 bool operator== (const OpenCLConfig
& r
) const;
86 bool operator!= (const OpenCLConfig
& r
) const;
88 static OpenCLConfig
get();
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
);
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */