43 typedef std::vector< viennacl::ocl::platform > platforms_type;
46 bool is_first_element =
true;
47 for (platforms_type::iterator platform_iter = platforms.begin();
48 platform_iter != platforms.end();
51 typedef std::vector<viennacl::ocl::device> devices_type;
52 devices_type devices = platform_iter->devices(CL_DEVICE_TYPE_ALL);
57 std::cout <<
"# =========================================" << std::endl;
58 std::cout <<
"# Platform Information " << std::endl;
59 std::cout <<
"# =========================================" << std::endl;
61 std::cout <<
"#" << std::endl;
62 std::cout <<
"# Vendor and version: " << platform_iter->info() << std::endl;
63 std::cout <<
"#" << std::endl;
67 std::cout <<
"# ViennaCL uses this OpenCL platform by default." << std::endl;
68 is_first_element =
false;
75 std::cout <<
"# " << std::endl;
76 std::cout <<
"# Available Devices: " << std::endl;
77 std::cout <<
"# " << std::endl;
78 for (devices_type::iterator iter = devices.begin(); iter != devices.end(); iter++)
80 std::cout << std::endl;
82 std::cout <<
" -----------------------------------------" << std::endl;
83 std::cout << iter->full_info();
84 std::cout <<
"ViennaCL Device Architecture: " << iter->architecture_family() << std::endl;
86 std::cout <<
" -----------------------------------------" << std::endl;
88 std::cout << std::endl;
89 std::cout <<
"###########################################" << std::endl;
90 std::cout << std::endl;
std::vector< platform > get_platforms()
Represents an OpenCL device within ViennaCL.
StringT get_mapped_device_name(StringT const &device_name, vendor_id_type vendor_id)