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 #include <iostream> 12 13 #include <boost/compute/core.hpp> 14 15 namespace compute = boost::compute; 16 main()17int main() 18 { 19 // get the default device 20 compute::device device = compute::system::default_device(); 21 22 std::cout << "device: " << device.name() << std::endl; 23 std::cout << " global memory size: " 24 << device.get_info<cl_ulong>(CL_DEVICE_GLOBAL_MEM_SIZE) / 1024 / 1024 25 << " MB" 26 << std::endl; 27 std::cout << " local memory size: " 28 << device.get_info<cl_ulong>(CL_DEVICE_LOCAL_MEM_SIZE) / 1024 29 << " KB" 30 << std::endl; 31 std::cout << " constant memory size: " 32 << device.get_info<cl_ulong>(CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE) / 1024 33 << " KB" 34 << std::endl; 35 36 return 0; 37 } 38