AnsweredAssumed Answered

Behavior of any() function containing a scalar expression

Question asked by settle on Oct 11, 2012
Latest reply on Oct 12, 2012 by drallan

I found a line in my kernel code that works fine for int2 or int3, but not for int.  In the following code the "Do something" expression is never executed when using type int as shown, even when it should.

int dfdx;

...

if ( any(dfdx !=0) )

    ; // Do something

else

    ; // Do something else

I'm wondering if this is a bug or not.  I checked the specification and seems to me that it is.  I'm using APP SDK 2.7 and Catalyst 12.8 under Windows 7 64-bit.  I ran the program on both my FX 8120 and HD Radeon 7950; both devices exhibited the same problem.  When I changed "any(dfdx != 0)" to just "dfdx != 0" it worked as expected for int, but then I can't use my normal templates.

 

Has anyone else encountered this behavior?

 

Thanks!

Outcomes