is 2D array writable?

From programing guide, 2D array is texture memory, so should be only ‘readable’. But cudaMemcpy2D() seems copying data from one cuda array to another.
So how to understand if cuda array is writable or not?


It is: writable by the host, read-only by the GPU

but how about cudaMemcpyDevicetoDevice? I guess this can be used for memcpy between different memory region in global memory, right?

Yes, you can memcpy to arrays from device memory.

You need to use cudaMemcpyToArray for host->device or device->device array copies. The layout of the memory in the array is different to facilitate 2D caching. Even if you could figure out what device memory pointer to use, you wouldn’t know what you were reading/writing.