Description
The relational operators greater than (>), less than (<), greater than or equal (>=), and less than or equal (<=) operate on scalar and vector types ^{[1]}. All relational operators result in an integer type. After operand type conversion, the following cases are valid:

The two operands are scalars. In this case, the operation is applied, resulting in an
int
scalar. 
One operand is a scalar, and the other is a vector. In this case, the scalar may be subject to the usual arithmetic conversion to the element type used by the vector operand. The scalar type is then widened to a vector that has the same number of components as the vector operand. The operation is done componentwise resulting in the same size vector.

The two operands are vectors of the same type. In this case, the operation is done componentwise resulting in the same size vector.
All other cases of implicit conversions are illegal.
The result is a scalar signed integer of type int
if the source operands
are scalar and a vector signed integer type of the same size as the source
operands if the source operands are vector types.
Vector source operands of type charn
and ucharn
return a
charn
result; vector source operands of type shortn
and
ushortn
return a shortn
result; vector source operands of type
intn
, uintn
and floatn
return an intn
result; vector
source operands of type longn
, ulongn
and doublen
return a
longn
result.
For scalar types, the relational operators shall return 0 if the specified
relation is false and 1 if the specified relation is true.
For vector types, the relational operators shall return 0 if the specified
relation is false and 1 (i.e. all bits set) if the specified relation is
true.
The relational operators always return 0 if either argument is not a number
(NaN).
Document Notes
For more information, see the OpenCL C Specification
This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.