explicit copy from host to device

Hi forum,

I am allocating a host memory and then i am creating a device memory buffer with the host copy pointer.

Do i have to explicitly copy the contents from host to device then?

If the host pointer is null while creating the device read & write buffer , then i think you need to copy explicitly from host to device .

What do you guys think?


If you’re passing CL_MEM_COPY_HOST_PTR when creating the buffer, the implementation will take care of doing the copy (and it will do it synchronously). In this situation you can’t pass a NULL pointer.

Alternatively you can leave out the CL_MEM_COPY_HOST_PTR, pass a NULL host pointer, and handle the copy yourself.