42 typedef std::vector< viennacl::ocl::platform > platforms_type;
45 bool is_first_element =
true;
46 for (platforms_type::iterator platform_iter = platforms.begin();
47 platform_iter != platforms.end();
50 typedef std::vector<viennacl::ocl::device> devices_type;
51 devices_type devices = platform_iter->devices(CL_DEVICE_TYPE_ALL);
56 std::cout <<
"# =========================================" << std::endl;
57 std::cout <<
"# Platform Information " << std::endl;
58 std::cout <<
"# =========================================" << std::endl;
60 std::cout <<
"#" << std::endl;
61 std::cout <<
"# Vendor and version: " << platform_iter->info() << std::endl;
62 std::cout <<
"#" << std::endl;
66 std::cout <<
"# ViennaCL uses this OpenCL platform by default." << std::endl;
67 is_first_element =
false;
74 std::cout <<
"# " << std::endl;
75 std::cout <<
"# Available Devices: " << std::endl;
76 std::cout <<
"# " << std::endl;
77 for (devices_type::iterator iter = devices.begin(); iter != devices.end(); iter++)
79 std::cout << std::endl;
81 std::cout <<
" -----------------------------------------" << std::endl;
82 std::cout << iter->full_info();
83 std::cout <<
" -----------------------------------------" << std::endl;
85 std::cout << std::endl;
86 std::cout <<
"###########################################" << std::endl;
87 std::cout << std::endl;
std::vector< platform > get_platforms()
Represents an OpenCL device within ViennaCL.