JayBeams  0.1
Another project to have fun coding.
show_device.cpp
Go to the documentation of this file.
1 #include <jb/opencl/config.hpp>
3 
4 #include <iostream>
5 
6 int main(int argc, char* argv[]) try {
8  cfg.process_cmdline(argc, argv);
9  auto dev = jb::opencl::device_selector(cfg);
10 
11  std::cout << "jb::opencl::device_selector picked " << dev.name() << std::endl;
12  return 0;
13 } catch (jb::usage const& ex) {
14  std::cerr << "usage: " << ex.what() << std::endl;
15  return ex.exit_status();
16 } catch (std::exception const& ex) {
17  std::cerr << "standard exception raised: " << ex.what() << std::endl;
18  return 1;
19 } catch (...) {
20  std::cerr << "unknown exception raised" << std::endl;
21  return 1;
22 }
Configure the OpenCL device / context options.
Definition: config.hpp:12
int exit_status() const
Definition: usage.hpp:21
boost::compute::device device_selector(config const &cfg)
Select an OpenCL device matching the current configuration.
int main(int argc, char *argv[])
Definition: show_device.cpp:6
A simple class to communicate the result of parsing the options.
Definition: usage.hpp:11
void process_cmdline(int &argc, char *argv[])
Process the command line.