Send data from global memory to an array

I have a stored in global memory of the GPU a image, this was the result of a previous process, now I need to do bilinear interpolation and want to use texture memory because it is very easy to use.

Usually when I have the image on the CPU I use the cudaMemcpyToArray function, but for this case I do not know what function to use

Can anyone help?


If the data is already on the GPU, there is no need to copy it. You just need to pass a pointer to that data to the CUDA kernel that processes it. If the image you are referring to is the output of a graphics pipeline, you would have to look into the documentation for DX or OpenGL interop.

You might be using cudaMemcpyToArray if your corresponding bind function is cudaBindTextureToArray

can you use cudaBindTexture instead (which can take an ordinary device pointer)?

are you using texture objects or texture references?