[Beignet] OpenCL vector type compare behaviour

Edward Ching edward.k.ching at gmail.com
Tue Jun 25 17:57:40 PDT 2013


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/20130625/9630fdc9/attachment.html>


More information about the Beignet mailing list