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>
19 struct OpenCLDeviceInfo
;
20 struct OpenCLPlatformInfo
;
22 struct OPENCL_DLLPUBLIC OpenCLConfig
28 OUString maPlatformVendor
;
30 OUString maDriverVersion
;
36 ImplMatcher(const OUString
& rOS
,
37 const OUString
& rOSVersion
,
38 const OUString
& rPlatformVendor
,
39 const OUString
& rDevice
,
40 const OUString
& rDriverVersion
)
42 maOSVersion(rOSVersion
),
43 maPlatformVendor(rPlatformVendor
),
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
||
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
)))))))));
77 typedef std::set
<ImplMatcher
> ImplMatcherSet
;
79 ImplMatcherSet maBlackList
;
80 ImplMatcherSet maWhiteList
;
84 bool operator== (const OpenCLConfig
& r
) const;
85 bool operator!= (const OpenCLConfig
& r
) const;
87 static OpenCLConfig
get();
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
);
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */