1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
|
#include "sleef_cl.h"
_CL_OVERLOADABLE
float
_cl_exp (float x)
{
return Sleef_expf_u10 (x);
}
_CL_OVERLOADABLE
float2
_cl_exp (float2 x)
{
float lo = _cl_exp (x.lo);
float hi = _cl_exp (x.hi);
return (float2) (lo, hi);
}
_CL_OVERLOADABLE
float4 _cl_exp (float4);
_CL_OVERLOADABLE
float3
_cl_exp (float3 x)
{
float4 x_3to4 = (float4) (x, (float)0);
float4 r = _cl_exp (x_3to4);
return r.xyz;
}
_CL_OVERLOADABLE
float4
_cl_exp (float4 x)
{
#if defined(SLEEF_VEC_128_AVAILABLE)
return Sleef_expf4_u10 (x);
#else
float2 lo = _cl_exp (x.lo);
float2 hi = _cl_exp (x.hi);
return (float4) (lo, hi);
#endif
}
_CL_OVERLOADABLE
float8
_cl_exp (float8 x)
{
#if defined(SLEEF_VEC_256_AVAILABLE)
return Sleef_expf8_u10 (x);
#else
float4 lo = _cl_exp (x.lo);
float4 hi = _cl_exp (x.hi);
return (float8) (lo, hi);
#endif
}
_CL_OVERLOADABLE
float16
_cl_exp (float16 x)
{
#if defined(SLEEF_VEC_512_AVAILABLE)
return Sleef_expf16_u10 (x);
#else
float8 lo = _cl_exp (x.lo);
float8 hi = _cl_exp (x.hi);
return (float16) (lo, hi);
#endif
}
#ifdef cl_khr_fp64
_CL_OVERLOADABLE
double
_cl_exp (double x)
{
return Sleef_exp_u10 (x);
}
#endif /* cl_khr_fp64 */
#ifdef cl_khr_fp64
_CL_OVERLOADABLE
double2
_cl_exp (double2 x)
{
#if defined(SLEEF_VEC_128_AVAILABLE) && defined(SLEEF_DOUBLE_VEC_AVAILABLE)
return Sleef_expd2_u10 (x);
#else
double lo = _cl_exp (x.lo);
double hi = _cl_exp (x.hi);
return (double2) (lo, hi);
#endif
}
#endif /* cl_khr_fp64 */
#ifdef cl_khr_fp64
_CL_OVERLOADABLE
double4 _cl_exp (double4);
_CL_OVERLOADABLE
double3
_cl_exp (double3 x)
{
double4 x_3to4 = (double4) (x, (double)0);
double4 r = _cl_exp (x_3to4);
return r.xyz;
}
#endif /* cl_khr_fp64 */
#ifdef cl_khr_fp64
_CL_OVERLOADABLE
double4
_cl_exp (double4 x)
{
#if defined(SLEEF_VEC_256_AVAILABLE) && defined(SLEEF_DOUBLE_VEC_AVAILABLE)
return Sleef_expd4_u10 (x);
#else
double2 lo = _cl_exp (x.lo);
double2 hi = _cl_exp (x.hi);
return (double4) (lo, hi);
#endif
}
#endif /* cl_khr_fp64 */
#ifdef cl_khr_fp64
_CL_OVERLOADABLE
double8
_cl_exp (double8 x)
{
#if defined(SLEEF_VEC_512_AVAILABLE) && defined(SLEEF_DOUBLE_VEC_AVAILABLE)
return Sleef_expd8_u10 (x);
#else
double4 lo = _cl_exp (x.lo);
double4 hi = _cl_exp (x.hi);
return (double8) (lo, hi);
#endif
}
#endif /* cl_khr_fp64 */
#ifdef cl_khr_fp64
_CL_OVERLOADABLE
double16
_cl_exp (double16 x)
{
double8 lo = _cl_exp (x.lo);
double8 hi = _cl_exp (x.hi);
return (double16) (lo, hi);
}
#endif /* cl_khr_fp64 */
|