1#include <clc/clc.h> 2#include "relational.h" 3 4//Note: It would be nice to use __builtin_isgreater 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, isgreater, __builtin_isgreater, float, float) 8 9#ifdef cl_khr_fp64 10 11#pragma OPENCL EXTENSION cl_khr_fp64 : enable 12 13// The scalar version of isgreater(double, double) returns an int, but the vector versions 14// return long. 15 16_CLC_DEF _CLC_OVERLOAD int isgreater(double x, double y){ 17 return __builtin_isgreater(x, y); 18} 19 20_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, isgreater, double, double) 21 22#endif 23 24#ifdef cl_khr_fp16 25 26#pragma OPENCL EXTENSION cl_khr_fp16 : enable 27 28// The scalar version of isgreater(half, half) returns an int, but the vector versions 29// return short. 30 31_CLC_DEF _CLC_OVERLOAD int isgreater(half x, half y){ 32 return __builtin_isgreater(x, y); 33} 34 35_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(short, isgreater, half, half) 36 37#endif 38