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?