<div dir="ltr"><div><div>What is the correct behaviour when comparing vector type values in OpenCL?<br><br></div><div>e.g.<br><br>__kernel void<br>compiler_int4_comp(__global int4 *src, __global int4 *dst)<br>{<br>  int4 v1=(int4)(0,1,1,0);<br>

</div><div>  int4 v2=(int4)(1,0,0,0);<br></div><div>  int4 mask;<br> ...<br> ...<br></div><div>  mask = v1 < v2;<br></div><div>  ...<br>  ...<br>}<br></div><div><br></div><div>Using Beignet OpenCL, the value in mask after executing the mask=v1<v2 statement,  is (0x1, 0x0, 0x0, 0x1).<br>

<br></div><div>However, using Intel OpenCL SDK 2012 and 2013, the result is (0xffffffff,0x0, 0x0, 0xffffffff).<br><br></div><div>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.<br>
<br></div><div>/Ed<br></div><div><br><br></div></div></div>