简体   繁体   English

OpenCL enqueueWriteImage在C ++包装器中但在C函数中没有const void * ptr

[英]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 . cl2.hpp enqueueWriteImage接受void* ptr但调用C函数clEnqueueWriteImage接受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. 因为它仅调用接受const void* ptr函数,所以它也可以是const。

You are correct; 你是对的; this is a bug in the OpenCL C++ bindings. 这是OpenCL C ++绑定中的错误。 There were a few other enqueueWrite* functions with this same issue. 同样的问题,还有其他一些enqueueWrite*函数。 I've pushed a fix to the Khronos GitHub repository for these headers - it will be included in the next release. 我已将这些标头推送到Khronos GitHub存储库中 -该修补程序将包含在下一个版本中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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