I am trying to use this function but it always segfaults for me. If I use the same memory pointers and call clEnqueueWriteBuffer then it doesn't seg fault so I think that I have allocated memory OK, I can only assume it is the values I have in region that are somehow wrong (I am copying from/to the start of the host array / memory buffer so all entries in buffer_origin and host_origin are 0).
When I read the docs for region at
"The (width, height, depth) in bytes of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the
depth value given by
region should be 1."
but I don't understand how to describe the rectangle width, height and depth "in bytes", surely it should be in terms of numbers of entries ? I can just about think about describing one of the dimension in bytes, but surely not all three?
Later in the doc for "buffer_slice_pitch" it says
"The length of each 2D slice in bytes to be used for the memory region associated with
buffer_slice_pitch is 0,
buffer_slice_pitch is computed as
which means that it may compute the buffer_slice_pitch as width(in bytes)*height(in bytes) which surely is wrong ?