The problem of using texture

[codebox]host code:

texture<int, 1, cudaReadModeElementType>texRef

int *d_ind2;

cudaMalloc((void**)&d_ind2,patind->sz_ind2);

cudaMemcpy(d_ind2,patind->m_pind2,patind->sz_ind2,cudaMemcpyHostToDevice);

cudaBindTexture(0, texRef, d_ind2);

device code:

d_value = tex1Dfetch(texRef, index);

[/codebox]

the question is why d_value is not equal to the corresponding value in d_ind2.