tex1Dfetch on long int

Hey all,
I have this 1D array of long int on which I want to apply texture. Since I can’t use basic datatype ‘long’, I tried using ‘long1’, but it doesn’t seem to work (it says it can’t find it even though I see it in tex1Dfetch(texture<long1, 1, cudaReadModeElementType>, const int) in one of the header files)…It seems to work using uint1, but then I lose out on some numbers…Any solution similar to the sm13_double_functions.h functions?

Vandhan Ramesh

I assume you’re on a system where the long int type is a 64-bit integer? The texture hardware only supports 32-bits per component maximum, so to read a 64-bit int you will need to read a uint2 (2 32-bit ints) and then use logic ops to put them back together.