MCPcopy Create free account
hub / github.com/boostorg/compute / default_device

Method default_device

include/boost/compute/system.hpp:75–80  ·  view source on GitHub ↗

Returns the default compute device for the system. The default device is selected based on a set of heuristics and can be influenced using one of the following environment variables: \li \c BOOST_COMPUTE_DEFAULT_DEVICE - name of the compute device (e.g. "GTX TITAN") \li \c BOOST_COMPUTE_DEFAULT_DEVICE_TYPE type of the compute device (e.g. "GPU" or "CPU") \li \c BOOST_COMPUTE_DEFAULT_PLATFORM - n

Source from the content-addressed store, hash-verified

73 /// std::cout << "default device: " << device.name() << std::endl;
74 /// \endcode
75 static device default_device()
76 {
77 static device default_device = find_default_device();
78
79 return default_device;
80 }
81
82 /// Returns the device with \p name.
83 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected