]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/compute/include/boost/compute/detail/vendor.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / compute / include / boost / compute / detail / vendor.hpp
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
10
11 #ifndef BOOST_COMPUTE_DETAIL_VENDOR_HPP
12 #define BOOST_COMPUTE_DETAIL_VENDOR_HPP
13
14 #include <boost/compute/device.hpp>
15 #include <boost/compute/platform.hpp>
16
17 namespace boost {
18 namespace compute {
19 namespace detail {
20
21 // returns true if the device is an nvidia gpu
22 inline bool is_nvidia_device(const device &device)
23 {
24 std::string nvidia("NVIDIA");
25 return device.vendor().compare(0, nvidia.size(), nvidia) == 0;
26 }
27
28 // returns true if the device is an amd cpu or gpu
29 inline bool is_amd_device(const device &device)
30 {
31 return device.platform().vendor() == "Advanced Micro Devices, Inc.";
32 }
33
34 // returns true if the platform is Apple OpenCL platform
35 inline bool is_apple_platform(const platform &platform)
36 {
37 return platform.name() == "Apple";
38 }
39
40 // returns true if the device is from Apple OpenCL Platform
41 inline bool is_apple_platform_device(const device &device)
42 {
43 return is_apple_platform(device.platform());
44 }
45
46 } // end detail namespace
47 } // end compute namespace
48 } // end boost namespace
49
50 #endif // BOOST_COMPUTE_DETAIL_VENDOR_HPP