I am trying to debug a very annoying problem in a rather large program,
which has all the symptoms of a memory problem: I think that it is caused
by my overwriting memory that I did not intend to overwrite in the GPU. (I
did run cuda-memcheck by the way, and it did not see anything, nor does
valgrind on the host side, but moving on to my real questions…)
But the symptom is that the tex2d reference always returns 0. Now, I
happen to think that the reason it might be doing this is that I may have
clobbered the 2D array I created to hold the values, but I wonder:
Other than the array for the texture map having values of zero, is there
any other reason why a tex2D would return 0 ?
What happens if the texture has not been set up properly ? what does
it return in that case ?
Is there any way from the GPU or host side to detect when a kernel tries
to use an improperly set up texture map ? Is there an error bit somewhere,
or a value that it could return ?
Hopefully this makes sense to somebody and can advise me.
Thank you again for your help …