diff --git a/include/boost/compute/context.hpp b/include/boost/compute/context.hpp index 13154a968..03279b178 100644 --- a/include/boost/compute/context.hpp +++ b/include/boost/compute/context.hpp @@ -187,7 +187,15 @@ class context /// Returns a vector of devices for the context. std::vector get_devices() const { - return get_info >(CL_CONTEXT_DEVICES); + std::vector device_ids = + get_info >(CL_CONTEXT_DEVICES); + + std::vector devices; + for(size_t i = 0; i < device_ids.size(); i++) { + devices.push_back(device(device_ids[i])); + } + + return devices; } /// Returns information about the context.