Steveyoungs

Compiler Misses Error in Code

Discussion created by Steveyoungs on Jun 3, 2011
Latest reply on Jun 9, 2011 by Steveyoungs
Compiler does not detect invalid OpenCL code

Hi,
The compiler is succesfully compiling the following kernel, but I don't think the code is valid because of OpenCL 1.1 rev 36, section 6.3 clause g

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

Here is the example kernel:


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

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

Steve

Outcomes