1D texture and linear interpolation

Hi,

I got a piece of code that works when I do not use interpolation:

g_table_texture.addressMode[0] = cudaAddressModeClamp;

	g_table_texture.addressMode[1] = cudaAddressModeClamp;

	g_table_texture.filterMode = cudaFilterModePoint;

	g_table_texture.normalized = false;

And I fetch a texture element using:

return tex1Dfetch(g_table_texture, int_texture_coordinate);

with 0 <= int_texture_coordinate < N

Now I change it to:

g_table_texture.addressMode[0] = cudaAddressModeClamp;

	g_table_texture.addressMode[1] = cudaAddressModeClamp;

	g_table_texture.filterMode = cudaFilterModeLinear;

	g_table_texture.normalized = true;

And I fetch a texture element using:

return tex1D(g_table_texture, float_texture_coordinate);

with float float_texture_coordinate = int_texture_coordinate;

float_texture_coordinate /= N;

so that 0 <= float_texture_coordinate <= 1

Now the return value is always 0.

Any idea what I am doing wrong?

Failing to check for error codes. If you had, it would have said invalid texture reference.

tex1D can only read textures bound to cudaArrays.

Failing to check for error codes. If you had, it would have said invalid texture reference.

tex1D can only read textures bound to cudaArrays.

I check for errors after each run of the kernel.

There is no error.

I check for errors after each run of the kernel.

There is no error.

It wasn’t a cudaArray. No runtime error, tho.

Moving from 1D to 2D worked with liner memory…

It wasn’t a cudaArray. No runtime error, tho.

Moving from 1D to 2D worked with liner memory…