1 #include
<clc
/internal
/clc.h
>
2 #include
<clc
/relational
/relational.h
>
4 // Note
: It would be nice to use __builtin_isless with vector inputs
, but it
5 // seems to only take scalar values as input
, which will produce incorrect
6 // output for vector input types.
8 _CLC_DEFINE_RELATIONAL_BINARY
(int, __clc_isless
, __builtin_isless
, float
, float
)
12 #pragma OPENCL EXTENSION cl_khr_fp64
: enable
14 // The scalar version of __clc_isless
(double, double
) returns an int
, but the
15 // vector versions return long.
17 _CLC_DEF _CLC_OVERLOAD int __clc_isless
(double x
, double y
) {
18 return __builtin_isless
(x, y
);
21 _CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL
(long, __clc_isless
, double
, double
)
26 #pragma OPENCL EXTENSION cl_khr_fp16
: enable
28 // The scalar version of __clc_isless
(half, half
) returns an int
, but the vector
29 // versions return short.
31 _CLC_DEF _CLC_OVERLOAD int __clc_isless
(half x
, half y
) {
32 return __builtin_isless
(x, y
);
35 _CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL
(short, __clc_isless
, half
, half
)