what looks like a boolean expression bug

what looks like a boolean expression bug

I am running the latest sdk, targetting the CPU. ( core i7 Q720)

My work group X-dimension  is 128.

I have an expression

    bool doWrite = (get_local_id(0) >= 0) && (get_local_id(0) < 128);

which should always equal true. However, when I run my kernel this is not true.

I see this because my results differ when I simply set doWrite equal to true.

Any ideas?




3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Update: you can find a reproducer here:


checkout branch simple_bdy, and run the x64 configuration.

Note: you will need OpenCV installed.


The sample image is that of a baboon. If you run it, you can see aliasing effects

in the image, particularly around the eyes and bridge of nose.


Look for a comment discussing "aliasing effects". If you uncomment the next line ( which should be equivalent to 

leaving it commented) then the aliasing effects go away.

never mind, I found a bug in my kernel. Problem solved.

Leave a Comment

Please sign in to add a comment. Not a member? Join today