OpenCL Compiler Bug Report

OpenCL Compiler Bug Report

The compiler is failing with the following simple kernel:

__kernel void test()
float3 a;
if (a.s0 && a.s1 && a.s2)

with an error of

Build Failed!
:4:14: error: invalid operands to binary expression ('float' and 'float')

I'd have expected this to compile OK. It fails in both offline and online compilers. Also fails with || (logical or)
Works correctly with the AMD CPU and GPU compiler.

The workaround is to change the if statement to

if (a.s0 != 0 && a.s1 != 0 && a.s2 != 0)

I'm using Intel OpenCL SDK 1.1

Can you please confirm this is a bug and report it to development?


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

It isn't a bug ; from OpenCL specifications 1.1.36, 6.3 Operators:

"g. The logical operators and (&&), or (||) operate on all scalar and vector built-in types except
the built-in scalar and vector float types."

Thanks for the clarification Romain. I'll redirect my bug report to AMD for allowing it!


Leave a Comment

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