I defined a texture reference in one file, let’s say in file A, as global variable
//File: A.cu texture<float, 1, cudaReadModeElementType> texRef;
I bind the texRef to a cudaArray. I was trying to use this reference in file B by defining a external variable to texRef by
//File: B.cu extern texture<float, 1, cudaReadModeElementType> texRef;
It turns out that in file B, the texRef is not the texRef I defined in file A anymore, or at least I did not the right result. But I put the exactly the same code which use the texRef in file B into file A, it give me correct result. Any thing I did wrong here?