如果我尝试将数据上传到图像缓冲区,则函数clEnqueueWriteImage
返回-5
. OpenCL 规范中未指定该错误。问题是什么?命令队列、内存对象和数据看起来很棒。阻止设置为true
。
我的 C++ 代码如下所示:
m_NativeImage = clCreateImage2D(_rContext, _MemoryFlag, &m_NativeImageFormat, m_Width, m_Height, 0, NULL, &Error);
size_t Origin[] = {0,0,0};
size_t Region[] = {m_Width, m_Height, 1}; // Size of object to be transferred
Error = clEnqueueWriteImage(m_NativeCommandQueue, m_NativeImage, _Blocking, Origin, Region, 0, 0, _pData, 0, 0, 0);