How to do a  lot of small  memcpy for Opencl on CPU?

Discussion created by zhuzxy on Oct 14, 2011
Latest reply on Oct 18, 2011 by corry

For native C code, the memcpy() function is very efficient. But for opencl on CPU, I did not know how to copy a certain data from appointed position to another memory.

In my problem, I need copy many pieces of data from an image to an array. the copy start positions come from previous kernel calculation result. the copy length is various.  I have tried to copy it one by one, and it is extermly inefficient. And for alignment problem, I can not do the copy using vector type.

Can anyone tell me how to do it efficiently?