Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:04:26

0001 //---------------------------------------------------------------------------//
0002 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 // See http://boostorg.github.com/compute for more information.
0009 //---------------------------------------------------------------------------//
0010 
0011 #ifndef BOOST_COMPUTE_DETAIL_VENDOR_HPP
0012 #define BOOST_COMPUTE_DETAIL_VENDOR_HPP
0013 
0014 #include <boost/compute/device.hpp>
0015 #include <boost/compute/platform.hpp>
0016 
0017 namespace boost {
0018 namespace compute {
0019 namespace detail {
0020 
0021 // returns true if the device is an nvidia gpu
0022 inline bool is_nvidia_device(const device &device)
0023 {
0024     std::string nvidia("NVIDIA");
0025     return device.vendor().compare(0, nvidia.size(), nvidia) == 0;
0026 }
0027 
0028 // returns true if the device is an amd cpu or gpu
0029 inline bool is_amd_device(const device &device)
0030 {
0031     return device.platform().vendor() == "Advanced Micro Devices, Inc.";
0032 }
0033 
0034 // returns true if the platform is Apple OpenCL platform
0035 inline bool is_apple_platform(const platform &platform)
0036 {
0037     return platform.name() == "Apple";
0038 }
0039 
0040 // returns true if the device is from Apple OpenCL Platform
0041 inline bool is_apple_platform_device(const device &device)
0042 {
0043     return is_apple_platform(device.platform());
0044 }
0045 
0046 } // end detail namespace
0047 } // end compute namespace
0048 } // end boost namespace
0049 
0050 #endif // BOOST_COMPUTE_DETAIL_VENDOR_HPP