- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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?
Steve
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?
Steve
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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."
"g. The logical operators and (&&), or (||) operate on all scalar and vector built-in types except
the built-in scalar and vector float types."
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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."
"g. The logical operators and (&&), or (||) operate on all scalar and vector built-in types except
the built-in scalar and vector float types."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the clarification Romain. I'll redirect my bug report to AMD for allowing it!
Steve.
Steve.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page