Unclear about clEnqueueCopyImageToBuffer

Discussion created by wudee on Nov 3, 2010
Latest reply on Feb 16, 2011 by genaganna

Hello, guys! I have a small problem while using Image buffer in OpenCL.

When I tried to use cl::CommandQueue::enqueueCopyImageToBuffer (C++ wrap) to copy one row of an image2d object to a global buffer, I always get a CL_INVALID_VALUE(-30) error.

src_origin = [0, k, 0];
region = [width, 1, 1];
dst_offset = 0;

I'm sure that width*1*1*element_size <= buffer_size. However, I'm not sure about  "src_origin + region inside the image". How do these two varibles work together? src_origin is the start point and region is the size, right?