Texture memory

uint32_t base = pkInfo[threadIdx.x].base;
uchar* base = packet + pkInfo[threadIdx.x].base;

size = pkInfo[threadIdx.x].size;

/* Base case */
stBase = pcreTbl[blockIdx.x];
tblSize = pcreTblSize[blockIdx.x];
st = 0;

/* TODO : LOOP unrolling */
for (uint32_t i = 0; i < size; i++) {
ch = tex1Dfetch(texRef, base + i);
ch = base[i];

This is my code for reading data. I bind texture at the packet variable. so I thought the use of USE_TEXTURES doesn’t change the result but it was not.

(cuda-gdb) print ch
$4 = 0 ‘\0’
(cuda-gdb) print packet[0]
$5 = 215 ‘â–’’

I use debugger for it. And the usage of tex1Dfetch and direct access is different.
Can you tell me why it happens? or if you want to know the more information, then plz let me know :)

Just a wild guess: is the texture properly bound (have you checked the return code for the binding call)?

You mean that the binding call occur error?

It does not.

Ok, another guess: Should it be [font=“Courier New”]ch = tex1Dfetch(texRef, i);[/font]? That would be the normal use for a texture reference.

Guessing would be a lot easier though if you posted a self-contained example.