Hello Jimmy, I’m not using normalized coordinates, it’s just the return values that are normalised floats (my texture consists of unsigned 8-bit integers and the hardware casts them into normalized floats). I tried cudaReadModeElementType, but the outcome was the same (apart from the type that was returned).
The code in #6 above appears to use unnormalized texture addressing with cudaModeAddressWrap. Note that according to the CUDA C Programming Guide “cudaAddressModeWrap and cudaAddressModeMirror are only supported for normalized texture coordinates”
I attempted to write a very simple test app using a 2D texture to demonstrates the difference between cudaAddressModeBorder and cudaAddressModeClamp. The result is that I do not see any difference.
My understanding was that an out-of-bounds access with cudaAddressModeBorder should return the border value (which should be fixed at zero), whereas an out-of-bounds access with cudaAddressModeClamp returns the appropriate edge value in such a case. But what I am seeing is that both modes show clamp-to-edge behavior, which puzzles me.
The “wrap” address mode in that code was to demonstrate, that neither of the address modes made a change. I did not know, that cudaAddressModeWrap and cudaAddressModeMirror are only supported for normalized texture coordinates. Thank you for that!
There are indications that cudaAddressModeBorder may also apply to normalized texture coordinates only. The issue is being investigated and a bug has been filed.
+1 to this bug. Is there any actual bug report website registered developers can see? I can only find the form to submit a bug, but not to browse the tracker.
Seeing this with a Geforce 650Ti using CUDA/C++ VS2010 SP1, CUDA 5, 320.18 NVIDIA driver.
This used to work fine with non-normalized coordinates and totally caught us by surprise.
Sorry for the inconvenience. I have used BORDER mode with non-normalized addressing myself in the past and it worked just fine. The appropriate team is actively working on this issue. As far as I am aware, the bug reporting system allows customers to track only issues that they filed themselves.