Thanks for such a succinct reply. I will try it out.
I have one more query. Say now I used the CL_MEM_USE_HOST_PTR in creating the 2D image, so this will copy nothing to the device, instead the GPU will take themapped memory fromclEnqueueMapBuffer, do the processing and we can writethe resultsto some other location.
On the other hand if I use the CL_MEM_COPY_HOST_PTR, it will create a copy of the data pointed to by host ptr on the device(I guess it will create a separatecopy not just caching). Now the processing will be done on the data that was copied to the device and then again the results are copied to host. I hope I am correct so far.
How about this.. Its just out of mycuriosity that I want to do it this way.I will use the CL_MEM_USE_HOST_PTR and now even though the device can access the host memory, I want the GPU kernel to create a separate copy onto the device(not using the COPY_HOST_PTR because this is again done in the host itself).How can this be done??