Jan Vesely | 12c6608 | 2014-08-01 21:50:59 +0000 | [diff] [blame] | 1 | #include <clc/clc.h> |
| 2 | #include "relational.h" |
| 3 | |
| 4 | //Note: It would be nice to use __builtin_islessequal with vector inputs, but it seems to only take scalar values as |
| 5 | // input, which will produce incorrect output for vector input types. |
| 6 | |
| 7 | _CLC_DEFINE_RELATIONAL_BINARY(int, islessequal, __builtin_islessequal, float, float) |
| 8 | |
| 9 | #ifdef cl_khr_fp64 |
| 10 | |
| 11 | #pragma OPENCL EXTENSION cl_khr_fp64 : enable |
| 12 | |
| 13 | // The scalar version of islessequal(double, double) returns an int, but the vector versions |
| 14 | // return long. |
| 15 | |
| 16 | _CLC_DEF _CLC_OVERLOAD int islessequal(double x, double y){ |
| 17 | return __builtin_islessequal(x, y); |
| 18 | } |
| 19 | |
| 20 | _CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, islessequal, double, double) |
| 21 | |
| 22 | #endif |