Sunday 15 July 2012

How to bind a __device__ array (not cudaArray) to a 3D texture in CUDA -


I have an array:

  __iplication__ float4data [64];   

Now I am expecting this array to be built in 3D texture, how can I do this?

How do I just tie the curved arrow to 3D texture? Should I copy the data [64] table to host memory, then copy that memory to a quad array? Or is there any way to copy this array directly into a quaderoire?

Thanks in advance.

No, you can only bind 3D-cudaArrays to 3D texture. You can copy the normal device memory into a cudaArray using cudaMemcpy3D (const struct cudaMemcpy3DParms * p); without needing to go directly to the host. But on the other hand, why do you use the normal flat array? If you have to type in your array, then you can look at Kuda surfaces and avoid copying.

No comments:

Post a Comment