hi.

I’m working on MT19937 RNG in CUDA.

In RNGs, they use bit operation with integer. the most important operation is

compute x*A (x is 0 or 1 bit vector) and (A is 32 bit integer represents of matrix)

to compute this,

original code of Mersenne Twister is below

```
#define A 0x9908b0dfUL;
unsigned long mag01[2]={0x0UL, A};
x = mag01[ y & 0x1UL];
```

CUDA SDK example in Mersenne Twister is below

```
#define A 0x9908b0dfUL;
x = ( (y & 1) ? A : 0 );
```

original code use “&” operation on integer and use memory.

in my cuda application, I’ll save mag01 on register or constant or shared memory.

in CUDA sdk, they use only “?” operation. I think the developer of CUDA SDK want to save # of registers.

Do you have any opnions which one is good? in aspects of speed and memory control in CUDA environment. I guess ? operation is heavier than & operation. am I right?