[Beignet] OpenCL vector type compare behaviour

Zou, Nanhai nanhai.zou at intel.com
Tue Jun 25 18:11:27 PDT 2013


Thanks for reporting this.
Intel SDK is right.
I have check the spec, OpenCL spec said if compare relation is true it should return -1 with all bit set.
We will fix that.

Thanks
Zou Nanhai

From: beignet-bounces+nanhai.zou=intel.com at lists.freedesktop.org [mailto:beignet-bounces+nanhai.zou=intel.com at lists.freedesktop.org] On Behalf Of Edward Ching
Sent: Wednesday, June 26, 2013 8:58 AM
To: beignet at lists.freedesktop.org
Subject: [Beignet] OpenCL vector type compare behaviour

What is the correct behaviour when comparing vector type values in OpenCL?
e.g.

__kernel void
compiler_int4_comp(__global int4 *src, __global int4 *dst)
{
  int4 v1=(int4)(0,1,1,0);
  int4 v2=(int4)(1,0,0,0);
  int4 mask;
 ...
 ...
  mask = v1 < v2;
  ...
  ...
}

Using Beignet OpenCL, the value in mask after executing the mask=v1<v2 statement,  is (0x1, 0x0, 0x0, 0x1).
However, using Intel OpenCL SDK 2012 and 2013, the result is (0xffffffff,0x0, 0x0, 0xffffffff).
Which one is the correct behavior? There are algorithms (such as the bitonic sort in Intel SDK) that assumes the Intel OpenCL SDK behavior, and this kind of subtlety is a pain to debug.
/Ed

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20130626/5f5b2913/attachment.html>


More information about the Beignet mailing list