I do not understand:
with n in [0…255] but n !=1 the following code
if( tid == 0) lastVal[0] = make_uchar4( 0, 0, 0, n);
behaves correctly like this (in emudebug):
lastVal[0].w = n
lastVal[1].w = 0
lastVal[2].w = 0
lastVal[3].w = 0
lastVal[4].w = 0
...
lastVal was previously initialized in this way:
lastVal[tid] = make_uchar4( 0, 0, 0, 0);
But if n == 1, then the output is the following:
lastVal[0].w = 1
lastVal[1].w = 1
lastVal[2].w = 1
lastVal[3].w = 1
lastVal[4].w = 1
...
I am really confused. Could someone explain why a different value can change so deeply the program behaviour?
Regards.