1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
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
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_DETAIL_VENDOR_HPP
12 #define BOOST_COMPUTE_DETAIL_VENDOR_HPP
14 #include <boost/compute/device.hpp>
15 #include <boost/compute/platform.hpp>
21 // returns true if the device is an nvidia gpu
22 inline bool is_nvidia_device(const device &device)
24 std::string nvidia("NVIDIA");
25 return device.vendor().compare(0, nvidia.size(), nvidia) == 0;
28 // returns true if the device is an amd cpu or gpu
29 inline bool is_amd_device(const device &device)
31 return device.platform().vendor() == "Advanced Micro Devices, Inc.";
34 // returns true if the platform is Apple OpenCL platform
35 inline bool is_apple_platform(const platform &platform)
37 return platform.name() == "Apple";
40 // returns true if the device is from Apple OpenCL Platform
41 inline bool is_apple_platform_device(const device &device)
43 return is_apple_platform(device.platform());
46 } // end detail namespace
47 } // end compute namespace
48 } // end boost namespace
50 #endif // BOOST_COMPUTE_DETAIL_VENDOR_HPP