简体   繁体   中英

OpenCL enqueueWriteImage no const void* ptr in C++ wrapper but in C function

In cl2.hpp enqueueWriteImage takes a void* ptr but calls the C function clEnqueueWriteImage which takes a const void* ptr . Why is that?

cl_int enqueueWriteImage(
    const Image& image,
    cl_bool blocking,
    const array<size_type, 3>& origin,
    const array<size_type, 3>& region,
    size_type row_pitch,
    size_type slice_pitch,
    void* ptr,
    const vector<Event>* events = NULL,
    Event* event = NULL) const
{
    cl_event tmp;
    cl_int err = detail::errHandler(
        ::clEnqueueWriteImage(//... here the const void* ptr appears

Is this intended or a typo? Because it is only calling a function that accepts a const void* ptr so it could be const, too.

You are correct; this is a bug in the OpenCL C++ bindings. There were a few other enqueueWrite* functions with this same issue. I've pushed a fix to the Khronos GitHub repository for these headers - it will be included in the next release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM