Bit Shifting Problems

The code I had written in my kernel had no problems processing bit shifting operations like:

blockDim.x & ~1;

The above statement worked correctly; however:

NArray[Thread] = sh[blockDim.x ^ 1];

doesn’t. In fact, it produces garbage numbers.

My question is bit shifting operations in indecies of arrays in a CUDA kernel supported in any version?

Build 2833(11/04/2009 - v1.2.1) notes a change saying “BITSHIFT is now supported for GSINGLE arrays”. What does this mean? Does this have anything to do with my problem?
I’m using version 1.3.

Bit operations work perfectly.

I suspect it’s your analysis that’s wrong… for example sh[blockDim.x ^ 1] will work, but it’s constant for all threads and I’m not sure why you’d index based on block dimensions ever. blockIdx, maybe, but blockDim?

Also, you really should upgrade your toolkit. Version 1.3 is from the dark ages of CUDA! The latest is 3.1.