|
6 | 6 | // |
7 | 7 | //===----------------------------------------------------------------------===// |
8 | 8 |
|
| 9 | +#include <clc/clc.h> |
| 10 | +#include <clc/common/clc_degrees.h> |
9 | 11 | #include <libspirv/spirv.h> |
10 | 12 |
|
11 | | -#include <clc/clcmacro.h> |
12 | | - |
13 | | -_CLC_OVERLOAD _CLC_DEF float __spirv_ocl_degrees(float radians) { |
14 | | - // 180/pi = ~57.29577951308232087685 or 0x1.ca5dc1a63c1f8p+5 or 0x1.ca5dc2p+5F |
15 | | - return 0x1.ca5dc2p+5F * radians; |
16 | | -} |
17 | | - |
18 | | -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, __spirv_ocl_degrees, float); |
19 | | - |
20 | | - |
21 | | -#ifdef cl_khr_fp64 |
22 | | -#pragma OPENCL EXTENSION cl_khr_fp64 : enable |
23 | | - |
24 | | -_CLC_OVERLOAD _CLC_DEF double __spirv_ocl_degrees(double radians) { |
25 | | - // 180/pi = ~57.29577951308232087685 or 0x1.ca5dc1a63c1f8p+5 or 0x1.ca5dc2p+5F |
26 | | - return 0x1.ca5dc1a63c1f8p+5 * radians; |
27 | | -} |
28 | | - |
29 | | -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, __spirv_ocl_degrees, |
30 | | - double); |
31 | | - |
32 | | -#endif |
33 | | - |
34 | | -#ifdef cl_khr_fp16 |
35 | | -#pragma OPENCL EXTENSION cl_khr_fp16 : enable |
36 | | - |
37 | | -_CLC_OVERLOAD _CLC_DEF half __spirv_ocl_degrees(half radians) { |
38 | | - return __spirv_ocl_degrees((float)radians); |
39 | | -} |
40 | | - |
41 | | -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, __spirv_ocl_degrees, half); |
42 | | - |
43 | | -#endif |
| 13 | +#define FUNCTION __spirv_ocl_degrees |
| 14 | +#define __CLC_FUNCTION(x) __clc_degrees |
| 15 | +#define __CLC_BODY <clc/common/unary_def.inc> |
| 16 | +#include <clc/math/gentype.inc> |
0 commit comments