[/quote:g2mg0dsh][/quote:g2mg0dsh]If cl::Wrapper was an implementation of shared_ptr it would not be the parent of all the class of OpenCL or is there something I don't get? Also the constructor and destructor of Image2D are using the function retain/release (indirectly by calling the constructor/destructor of Wrapper) so I don't see how shared_ptr could be faster than using cl::Wrapper since anyway the functions of cl::Wrapper will be called by shared_ptr.Originally Posted by coleb
Premature optimization is the root of all evil. I have a production multi-threaded database server application that makes heavy use of the getInfo methods and have never seen a performance issue. If there is one the vendor should be notified.
There are good reasons to keep the objects as lightweight as possible, i.e., sizeof(cl::Context) == sizeof(cl_context). When passing the objects to an argument handler they are very easy to translate into what OpenCL C needs. Also, the interface is very easy to update when new properties are added to the various OpenCL C objects (it's a single table within the header file).
You convinced me on this one .
Thanks for the feedback, I hope you find the bindings useful enough to suit your needs.
Thanks for your time answering my questions!