Khronos Public Bugzilla
Bug 490 - C++ Binding Enhancements
Summary: C++ Binding Enhancements
Alias: None
Product: OpenCL
Classification: Unclassified
Component: Header Files (show other bugs)
Version: 1.1
Hardware: PC All
: P3 enhancement
Target Milestone: ---
Assignee: Benedict Gaster
QA Contact: OpenCL Working Group
Depends on:
Reported: 2011-07-06 07:44 PDT by Steve Youngs
Modified: 2011-08-30 13:09 PDT (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Steve Youngs 2011-07-06 07:44:32 PDT
Currently there are several member functions that take a vector of devices. For example:

Context(const VECTOR_CLASS<Device>& devices, ...)

To use the above constructor with a single device, it is first necessary to make a vector containing the single device. I'd like to suggest adding matching functions that take a single device (where this makes sense), thereby avoiding the construction of a temporary vector in client code.

So using the above example, add the constructor

Context(const Device& device, ...)

Client code can then change from

cl::Context context(std::vector<cl::Device>(1, device));


cl::Context context(device);
Comment 1 Benedict Gaster 2011-08-30 13:09:28 PDT
I've added support for this request. This is tied in with some new work on default s that will appear in new version of cl.hpp that will be published in September 2011.