Logic Operators

I am working on debugging an unspecified launch failure that I have tracked down to the presence of an if statement within a nested for loop.

Will code of the form:

radsqr = SQR(radsum);

steric += (dsq <= radsqr) * (radsqr - dsq);

be equivalent to

if (dsq <= radsqr)

steric += radsqr - dsq;

in terms of causing thread divergence, or will using the logic operator in the assignment keep the various threads synched?

Standard C rules apply, so the two code segments will lead to different assembly. You should check the generated .ptx files to be sure.

Paulius