I have a very strange error. I am writing a program in Cuda that emulates the Conway Game of Life. I transfered the 2D array to device and there is a if-case that check for the state's thread.
if(iam==-1)
{ //i am on
iam=0;
}
else if(iam==1)
{ //i am dying
iam=-1;
}
else //i am off
{
if(counter_alive==2)//two neighboors alive
{
iam=1; //i will be on
}
// iam = -999;
}
When the last line is in comment nothing works and the var "iam" has the first value. But if i drop the //, it will work. Of course, if the flow's code execute the else, the var "iam" will take the value -999. Any ideas? Have i missed something? Thanks in advance!