Before you can use Boost Compute, we need to initialize a device, context, and a command queue. We will be passing the context and the command queue as mutable references to all our examples with Boost Compute.
The most simple way to initialize the context and the command queue is to use the system default device, like this:
#include <boost/compute.hpp> auto main() -> int { // Initialize Boost Compute and OpenCL namespace bc = boost::compute; auto device = bc::system::default_device(); auto context = bc::context(device); auto command_queue = bc::command_queue(context, device); }