We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36c8913 commit 866aa11Copy full SHA for 866aa11
include/boost/compute/context.hpp
@@ -187,7 +187,15 @@ class context
187
/// Returns a vector of devices for the context.
188
std::vector<device> get_devices() const
189
{
190
- return get_info<std::vector<device> >(CL_CONTEXT_DEVICES);
+ std::vector<cl_device_id> device_ids =
191
+ get_info<std::vector<cl_device_id>>(CL_CONTEXT_DEVICES);
192
+
193
+ std::vector<device> devices;
194
+ for(size_t i = 0; i < device_ids.size(); i++) {
195
+ devices.push_back(device(device_ids[i]));
196
+ }
197
198
+ return devices;
199
}
200
201
/// Returns information about the context.
0 commit comments