const correctness in <CL/cl.hpp>

Hi everyone,

I’m currently doing opencl using the c++ header provided by khronos (http://www.khronos.org/registry/cl/api/1.2/cl.hpp). It seems that there is a small issue with the cl::queue::enqueueWriteImage() member function: The pointer to the source data is not beeing const. The wrapped function is const though (http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clEnqueueWriteImage.html). This pretty much breaks my code in terms of const correctness.

So the question ist basically if this is a “bug”, or do I really need to treat the source buffer as non-const (i.e. as potentially modified during the function call)?
In case it is a bug, then who could fix it?

I attached the diff just to be clear about how I think it should be.

Cheers,
Gregg

That does look like a bug. I’m not sure who is responsible for fixing it. Possibly try to get in contact with the following people: Benedict R. Gaster, Laurent Morichetti and Lee Howes (listed as authors at the top of the cl.hpp file).

Another option is to use a different C++ wrapper such as Boost.Compute which does provide a const-correct wrapper for the clEnqueueWriteImage() function with the command_queue::enqueue_write_image() method.