[Clang][Sema] Reject declaring an alias template with the same name as its template...
[llvm-project.git] / libclc / generic / lib / math / fmax.cl
blobc42fe4f54a9e672c8765eaa60b2007bd1562c8b4
1 #include <clc/clc.h>
2 #include <clc/clcmacro.h>
4 _CLC_DEFINE_BINARY_BUILTIN(float, fmax, __builtin_fmaxf, float, float);
6 #ifdef cl_khr_fp64
8 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
10 _CLC_DEFINE_BINARY_BUILTIN(double, fmax, __builtin_fmax, double, double);
12 #endif
14 #ifdef cl_khr_fp16
16 #pragma OPENCL EXTENSION cl_khr_fp16 : enable
18 _CLC_DEF _CLC_OVERLOAD half fmax(half x, half y)
20 if (isnan(x))
21 return y;
22 if (isnan(y))
23 return x;
24 return (x < y) ? y : x;
26 _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, fmax, half, half)
28 #endif
30 #define __CLC_BODY <fmax.inc>
31 #include <clc/math/gentype.inc>