Is the texture correctly similated ? A emulation error

Debugging error in CUDA is quite complicated. Normally I use emulation mode
to test for the correctness of the kernel module, before make the actually performance and correctness test. Today when i try the bilinear interpolation capability of the texture memory
when i ran my kernel function in emulation mode, the error report is 0. However when i run the real test the error report is 0.04 (4%) pretty large. I try to see what happen by print out the real value error i can see a large changing in the value of point on the boundary of the texture, like

Error at [247, 0]: [Emu 178.554871, Texture 110.644806]

The absolute error is pretty large that i think there’s should be an error here. From the spec of Cuda, the fraction is stored using 9-bit fixed point with 8 bit fractional value so the abs error should be smaller than 1/256 * (Real Magnitude) that mean should be less than 1 in this case.

Can any one from NVIDIA say what happen.

Ps. I use 2D texture in linear interpolation and wrap around mode.

I think you can only use wrap mode with normalized texture coordinates. It looks to me like you’re using un-normalized coordinates (just a guess because it looks like you’re attempting to access location 247, 0). See page 24 of the guide.

You are right, i use the un-nomalized texture. The problem is solved with the normalized texture.