Results 1 to 2 of 2

Thread: const correctness in <CL/cl.hpp>

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    2

    Lightbulb 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/s...riteImage.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
    Attached Files Attached Files

  2. #2
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •