File tree Expand file tree Collapse file tree 7 files changed +37
-16
lines changed Expand file tree Collapse file tree 7 files changed +37
-16
lines changed Original file line number Diff line number Diff line change 1+ #ifndef __CLC_MATH_CLC_NAN_H__
2+ #define __CLC_MATH_CLC_NAN_H__
3+
4+ #define __CLC_FUNCTION __clc_nan
5+ #define __CLC_BODY <clc/math/clc_nan.inc>
6+
7+ #include <clc/math/gentype.inc>
8+
9+ #undef __CLC_BODY
10+ #undef __CLC_FUNCTION
11+
12+ #endif // __CLC_MATH_CLC_NAN_H__
Original file line number Diff line number Diff line change 1+ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_nan (__CLC_U_GENTYPE code);
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ math/clc_floor.cl
2525math/clc_frexp.cl
2626math/clc_mad.cl
2727math/clc_modf.cl
28+ math/clc_nan.cl
2829math/clc_nextafter.cl
2930math/clc_rint.cl
3031math/clc_sw_fma.cl
Original file line number Diff line number Diff line change 1+ #include <clc/internal/clc.h>
2+ #include <clc/utils.h>
3+
4+ #define __CLC_BODY <clc_nan.inc>
5+ #include <clc/math/gentype.inc>
Original file line number Diff line number Diff line change 1+ #if __CLC_FPSIZE == 64
2+ # define NAN_MASK 0x 7ff0000000000000ul
3+ # elif __CLC_FPSIZE == 32
4+ # define NAN_MASK 0x 7fc00000
5+ # elif __CLC_FPSIZE == 16
6+ # define NAN_MASK 0x 7e00
7+ #endif
8+
9+ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_nan (__CLC_U_GENTYPE code) {
10+ const __CLC_U_GENTYPE mask = NAN_MASK;
11+ const __CLC_U_GENTYPE res = code | mask;
12+ return __CLC_AS_GENTYPE (res);
13+ }
14+
15+ #undef NAN_MASK
Original file line number Diff line number Diff line change 1- #include <clc/clc .h>
2- #include <clc/utils .h>
1+ #include <clc/clcmacro .h>
2+ #include <clc/math/clc_nan .h>
33
4- #define __OPENCL_AS_GENTYPE __CLC_XCONCAT(as_, __CLC_GENTYPE)
54#define __CLC_BODY <nan.inc>
65#include <clc/math/gentype.inc>
Original file line number Diff line number Diff line change 1- #if __CLC_FPSIZE == 64
2- # define NAN_MASK 0x 7ff0000000000000ul
3- # elif __CLC_FPSIZE == 32
4- # define NAN_MASK 0x 7fc00000
5- # elif __CLC_FPSIZE == 16
6- # define NAN_MASK 0x 7e00
7- #endif
8-
91_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE nan (__CLC_U_GENTYPE code) {
10- const __CLC_U_GENTYPE mask = NAN_MASK;
11- const __CLC_U_GENTYPE res = code | mask;
12- return __OPENCL_AS_GENTYPE (res);
2+ return __clc_nan (code);
133}
14-
15- #undef NAN_MASK
You can’t perform that action at this time.
0 commit comments