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 <opencl/platforminfo.hxx>
18 #include <rtl/ustring.hxx>
20 struct OPENCL_DLLPUBLIC OpenCLConfig
26 OUString maPlatformVendor
;
28 OUString maDriverVersion
;
34 ImplMatcher(const OUString
& rOS
,
35 const OUString
& rOSVersion
,
36 const OUString
& rPlatformVendor
,
37 const OUString
& rDevice
,
38 const OUString
& rDriverVersion
)
40 maOSVersion(rOSVersion
),
41 maPlatformVendor(rPlatformVendor
),
43 maDriverVersion(rDriverVersion
)
47 bool operator==(const ImplMatcher
& r
) const
49 return maOS
== r
.maOS
&&
50 maOSVersion
== r
.maOSVersion
&&
51 maPlatformVendor
== r
.maPlatformVendor
&&
52 maDevice
== r
.maDevice
&&
53 maDriverVersion
== r
.maDriverVersion
;
55 bool operator!=(const ImplMatcher
& r
) const
57 return !operator==(r
);
59 bool operator<(const ImplMatcher
& r
) const
61 return (maOS
< r
.maOS
||
63 (maOSVersion
< r
.maOSVersion
||
64 (maOSVersion
== r
.maOSVersion
&&
65 (maPlatformVendor
< r
.maPlatformVendor
||
66 (maPlatformVendor
== r
.maPlatformVendor
&&
67 (maDevice
< r
.maDevice
||
68 (maDevice
== r
.maDevice
&&
69 (maDriverVersion
< r
.maDriverVersion
)))))))));
75 typedef std::set
<ImplMatcher
> ImplMatcherSet
;
77 ImplMatcherSet maBlackList
;
78 ImplMatcherSet maWhiteList
;
82 bool operator== (const OpenCLConfig
& r
) const;
83 bool operator!= (const OpenCLConfig
& r
) const;
85 static OpenCLConfig
get();
89 bool checkImplementation(const OpenCLPlatformInfo
& rPlatform
, const OpenCLDeviceInfo
& rDevice
) const;
92 OPENCL_DLLPUBLIC
std::ostream
& operator<<(std::ostream
& rStream
, const OpenCLConfig
& rConfig
);
93 OPENCL_DLLPUBLIC
std::ostream
& operator<<(std::ostream
& rStream
, const OpenCLConfig::ImplMatcher
& rImpl
);
94 OPENCL_DLLPUBLIC
std::ostream
& operator<<(std::ostream
& rStream
, const OpenCLConfig::ImplMatcherSet
& rSet
);
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */