Intel is correct here. Section 6.3, item g states that “The logical operators and (&&), or (||) operate on all scalar and vector built-in types except the built-in scalar and vector float types”.
I would suggest the following change:
if (as_int(a.s0) && as_int(a.s1) && as_int(a.s2))
{
…
}
I’ve modified it to treat the float components as integers and then you can use the logical operators. This is supported and should work.
Just a quick update for anyone that reads this going forwards:
I’ve had ongoing discussion with AMD on this issue and they have said
“After further discussing this internally, this will not be fixed. The reason is that OpenCL inherits from C and C defines this interaction very well and it is viewed as a cut&paste typo to include this restriction on the logical operators that wasn’t fixed in time before the OpenCL 1.1 spec was ratified. We view this as a spec error and will see about correcting it in future versions of the spec.”
Let’s hope there are no issues with this and the spec is changed accordingly.