I am confused about the difference between the intended use of device pointers and cudaArray
structures. Could someone please explain why I would use one versus the other? My basic problem is that after looking through documentation and reading the book "CUDA by Example," I do not understand the intent of the API designers.
From what I have seen, it seems that cudaArray
should be used for textures and pointers should be used for directly accessing memory. It also seems that 3D textures can only be created using a cudaArray
. Should all textures be allocated using cudaArray
? Numerous examples seem not to. Also, why is there a function cudaMallocArray
and cudaMallocArray3D
, but no equivalent for cudaMallocArray2D
? Conversely, there is a cudaBindTexture
and cudaBindTexture2D
, but no cudaBindTexture3D
?