cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

vmiura
Adept II

Bug with while(a && b) statements

Hello,

I'm getting a bug on GCN series in a statement of the following format:

int ti = (some vector var)

int cont = true;

while(ti >=0 && cont)
{

   cont = false;

   if(some conditions)

   {

      ti = (some vector var);

      cont = true;
  }

}

// If I change the code as follows then it works OK, pointing to some problem handling compound conditionals in a while() statement.

int ti = (some vector var)

int cont = true;

int tcond = (ti >= 0 && cont);

while(tcond)
{

  cont = false;

  if(some conditions)

  {

     ti = (some vector var);

     cont = true;
  }

  tcond = (ti >= 0 && cont);

}

0 Likes
2 Replies
himanshu_gautam
Grandmaster

Just to be sure -- Can you bracket your conditions... like while ((ti >= 0) && (cont))

0 Likes
himanshu_gautam
Grandmaster

Can you give information about your setup: CPU, GPU, Driver, OS, SDK.

Also attach a test case if the issue is still present.

0 Likes