13 extern "C" __fp16 __hc_acos_half(__fp16 x) restrict(amp);
14 extern "C" float __hc_acos(
float x) restrict(amp);
15 extern "C" double __hc_acos_double(
double x) restrict(amp);
17 extern "C" __fp16 __hc_acosh_half(__fp16 x) restrict(amp);
18 extern "C" float __hc_acosh(
float x) restrict(amp);
19 extern "C" double __hc_acosh_double(
double x) restrict(amp);
21 extern "C" __fp16 __hc_asin_half(__fp16 x) restrict(amp);
22 extern "C" float __hc_asin(
float x) restrict(amp);
23 extern "C" double __hc_asin_double(
double x) restrict(amp);
25 extern "C" __fp16 __hc_asinh_half(__fp16 x) restrict(amp);
26 extern "C" float __hc_asinh(
float x) restrict(amp);
27 extern "C" double __hc_asinh_double(
double x) restrict(amp);
29 extern "C" __fp16 __hc_atan_half(__fp16 x) restrict(amp);
30 extern "C" float __hc_atan(
float x) restrict(amp);
31 extern "C" double __hc_atan_double(
double x) restrict(amp);
33 extern "C" __fp16 __hc_atanh_half(__fp16 x) restrict(amp);
34 extern "C" float __hc_atanh(
float x) restrict(amp);
35 extern "C" double __hc_atanh_double(
double x) restrict(amp);
37 extern "C" __fp16 __hc_atan2_half(__fp16 y, __fp16 x) restrict(amp);
38 extern "C" float __hc_atan2(
float y,
float x) restrict(amp);
39 extern "C" double __hc_atan2_double(
double y,
double x) restrict(amp);
41 extern "C" __fp16 __hc_cbrt_half(__fp16 x) restrict(amp);
42 extern "C" float __hc_cbrt(
float x) restrict(amp);
43 extern "C" double __hc_cbrt_double(
double x) restrict(amp);
45 extern "C" __fp16 __hc_ceil_half(__fp16 x) restrict(amp);
46 extern "C" float __hc_ceil(
float x) restrict(amp);
47 extern "C" double __hc_ceil_double(
double x) restrict(amp);
49 extern "C" __fp16 __hc_copysign_half(__fp16 x, __fp16 y) restrict(amp);
50 extern "C" float __hc_copysign(
float x,
float y) restrict(amp);
51 extern "C" double __hc_copysign_double(
double x,
double y) restrict(amp);
53 extern "C" __fp16 __hc_cos_half(__fp16 x) restrict(amp);
54 extern "C" __fp16 __hc_cos_native_half(__fp16 x) restrict(amp);
55 extern "C" float __hc_cos(
float x) restrict(amp);
56 extern "C" float __hc_cos_native(
float x) restrict(amp);
57 extern "C" double __hc_cos_double(
double x) restrict(amp);
59 extern "C" __fp16 __hc_cosh_half(__fp16 x) restrict(amp);
60 extern "C" float __hc_cosh(
float x) restrict(amp);
61 extern "C" double __hc_cosh_double(
double x) restrict(amp);
63 extern "C" __fp16 __hc_cospi_half(__fp16 x) restrict(amp);
64 extern "C" float __hc_cospi(
float x) restrict(amp);
65 extern "C" double __hc_cospi_double(
double x) restrict(amp);
67 extern "C" __fp16 __hc_erf_half(__fp16 x) restrict(amp);
68 extern "C" float __hc_erf(
float x) restrict(amp);
69 extern "C" double __hc_erf_double(
double x) restrict(amp);
71 extern "C" __fp16 __hc_erfc_half(__fp16 x) restrict(amp);
72 extern "C" float __hc_erfc(
float x) restrict(amp);
73 extern "C" double __hc_erfc_double(
double x) restrict(amp);
75 extern "C" __fp16 __hc_erfcinv_half(__fp16 x) restrict(amp);
76 extern "C" float __hc_erfcinv(
float x) restrict(amp);
77 extern "C" double __hc_erfcinv_double(
double x) restrict(amp);
79 extern "C" __fp16 __hc_erfinv_half(__fp16 x) restrict(amp);
80 extern "C" float __hc_erfinv(
float x) restrict(amp);
81 extern "C" double __hc_erfinv_double(
double x) restrict(amp);
83 extern "C" __fp16 __hc_exp_half(__fp16 x) restrict(amp);
84 extern "C" float __hc_exp(
float x) restrict(amp);
85 extern "C" double __hc_exp_double(
double x) restrict(amp);
87 extern "C" __fp16 __hc_exp10_half(__fp16 x) restrict(amp);
88 extern "C" float __hc_exp10(
float x) restrict(amp);
89 extern "C" double __hc_exp10_double(
double x) restrict(amp);
91 extern "C" __fp16 __hc_exp2_native_half(__fp16 x) restrict(amp);
92 extern "C" __fp16 __hc_exp2_half(__fp16 x) restrict(amp);
93 extern "C" float __hc_exp2(
float x) restrict(amp);
94 extern "C" float __hc_exp2_native(
float x) restrict(amp);
95 extern "C" double __hc_exp2_double(
double x) restrict(amp);
97 extern "C" __fp16 __hc_expm1_half(__fp16 x) restrict(amp);
98 extern "C" float __hc_expm1(
float x) restrict(amp);
99 extern "C" double __hc_expm1_double(
double x) restrict(amp);
101 extern "C" __fp16 __hc_fabs_half(__fp16 x) restrict(amp);
102 extern "C" float __hc_fabs(
float x) restrict(amp);
103 extern "C" double __hc_fabs_double(
double x) restrict(amp);
105 extern "C" __fp16 __hc_fdim_half(__fp16 x, __fp16 y) restrict(amp);
106 extern "C" float __hc_fdim(
float x,
float y) restrict(amp);
107 extern "C" double __hc_fdim_double(
double x,
double y) restrict(amp);
109 extern "C" __fp16 __hc_floor_half(__fp16 x) restrict(amp);
110 extern "C" float __hc_floor(
float x) restrict(amp);
111 extern "C" double __hc_floor_double(
double x) restrict(amp);
113 extern "C" __fp16 __hc_fma_half(__fp16 x, __fp16 y, __fp16 z) restrict(amp);
114 extern "C" float __hc_fma(
float x,
float y,
float z) restrict(amp);
115 extern "C" double __hc_fma_double(
double x,
double y,
double z) restrict(amp);
117 extern "C" __fp16 __hc_fmax_half(__fp16 x, __fp16 y) restrict(amp);
118 extern "C" float __hc_fmax(
float x,
float y) restrict(amp);
119 extern "C" double __hc_fmax_double(
double x,
double y) restrict(amp);
121 extern "C" __fp16 __hc_fmin_half(__fp16 x, __fp16 y) restrict(amp);
122 extern "C" float __hc_fmin(
float x,
float y) restrict(amp);
123 extern "C" double __hc_fmin_double(
double x,
double y) restrict(amp);
125 extern "C" __fp16 __hc_fmod_half(__fp16 x, __fp16 y) restrict(amp);
126 extern "C" float __hc_fmod(
float x,
float y) restrict(amp);
127 extern "C" double __hc_fmod_double(
double x,
double y) restrict(amp);
129 extern "C" int __hc_fpclassify_half(__fp16 x) restrict(amp);
130 extern "C" int __hc_fpclassify(
float x) restrict(amp);
131 extern "C" int __hc_fpclassify_double(
double x) restrict(amp);
133 extern "C" __fp16 __hc_frexp_half(__fp16 x,
int *exp) restrict(amp);
134 extern "C" float __hc_frexp(
float x,
int *exp) restrict(amp);
135 extern "C" double __hc_frexp_double(
double x,
int *exp) restrict(amp);
137 extern "C" __fp16 __hc_hypot_half(__fp16 x, __fp16 y) restrict(amp);
138 extern "C" float __hc_hypot(
float x,
float y) restrict(amp);
139 extern "C" double __hc_hypot_double(
double x,
double y) restrict(amp);
141 extern "C" int __hc_ilogb_half(__fp16 x) restrict(amp);
142 extern "C" int __hc_ilogb(
float x) restrict(amp);
143 extern "C" int __hc_ilogb_double(
double x) restrict(amp);
145 extern "C" int __hc_isfinite_half(__fp16 x) restrict(amp);
146 extern "C" int __hc_isfinite(
float x) restrict(amp);
147 extern "C" int __hc_isfinite_double(
double x) restrict(amp);
149 extern "C" int __hc_isinf_half(__fp16 x) restrict(amp);
150 extern "C" int __hc_isinf(
float x) restrict(amp);
151 extern "C" int __hc_isinf_double(
double x) restrict(amp);
153 extern "C" int __hc_isnan_half(__fp16 x) restrict(amp);
154 extern "C" int __hc_isnan(
float x) restrict(amp);
155 extern "C" int __hc_isnan_double(
double x) restrict(amp);
157 extern "C" int __hc_isnormal_half(__fp16 x) restrict(amp);
158 extern "C" int __hc_isnormal(
float x) restrict(amp);
159 extern "C" int __hc_isnormal_double(
double x) restrict(amp);
161 extern "C" __fp16 __hc_ldexp_half(__fp16 x, std::int16_t exp) [[
hc]];
162 extern "C" float __hc_ldexp(
float x,
int exp) restrict(amp);
163 extern "C" double __hc_ldexp_double(
double x,
int exp) restrict(amp);
165 extern "C" __fp16 __hc_lgamma_half(__fp16 x) restrict(amp);
166 extern "C" float __hc_lgamma(
float x) restrict(amp);
167 extern "C" double __hc_lgamma_double(
double x) restrict(amp);
169 extern "C" __fp16 __hc_log_half(__fp16 x) restrict(amp);
170 extern "C" float __hc_log(
float x) restrict(amp);
171 extern "C" float __hc_log_native(
float x) restrict(amp);
172 extern "C" double __hc_log_double(
double x) restrict(amp);
174 extern "C" __fp16 __hc_log10_half(__fp16 x) restrict(amp);
175 extern "C" float __hc_log10(
float x) restrict(amp);
176 extern "C" double __hc_log10_double(
double x) restrict(amp);
178 extern "C" __fp16 __hc_log2_half(__fp16 x) restrict(amp);
179 extern "C" __fp16 __hc_log2_native_half(__fp16 x) restrict(amp);
180 extern "C" float __hc_log2(
float x) restrict(amp);
181 extern "C" float __hc_log2_native(
float x) restrict(amp);
182 extern "C" double __hc_log2_double(
double x) restrict(amp);
184 extern "C" __fp16 __hc_log1p_half(__fp16 x) restrict(amp);
185 extern "C" float __hc_log1p(
float x) restrict(amp);
186 extern "C" double __hc_log1p_double(
double x) restrict(amp);
188 extern "C" __fp16 __hc_logb_half(__fp16 x) restrict(amp);
189 extern "C" float __hc_logb(
float x) restrict(amp);
190 extern "C" double __hc_logb_double(
double x) restrict(amp);
192 extern "C" __fp16 __hc_modf_half(__fp16 x, __fp16 *iptr) restrict(amp);
193 extern "C" float __hc_modf(
float x,
float *iptr) restrict(amp);
194 extern "C" double __hc_modf_double(
double x,
double *iptr) restrict(amp);
196 extern "C" __fp16 __hc_nan_half(
int tagp) restrict(amp);
197 extern "C" float __hc_nan(
int tagp) restrict(amp);
198 extern "C" double __hc_nan_double(
unsigned long tagp) restrict(amp);
200 extern "C" __fp16 __hc_nearbyint_half(__fp16 x) restrict(amp);
201 extern "C" float __hc_nearbyint(
float x) restrict(amp);
202 extern "C" double __hc_nearbyint_double(
double x) restrict(amp);
204 extern "C" __fp16 __hc_nextafter_half(__fp16 x, __fp16 y) restrict(amp);
205 extern "C" float __hc_nextafter(
float x,
float y) restrict(amp);
206 extern "C" double __hc_nextafter_double(
double x,
double y) restrict(amp);
208 extern "C" __fp16 __hc_pow_half(__fp16 x, __fp16 y) restrict(amp);
209 extern "C" float __hc_pow(
float x,
float y) restrict(amp);
210 extern "C" double __hc_pow_double(
double x,
double y) restrict(amp);
212 extern "C" __fp16 __hc_rcbrt_half(__fp16 x) restrict(amp);
213 extern "C" float __hc_rcbrt(
float x) restrict(amp);
214 extern "C" double __hc_rcbrt_double(
double x) restrict(amp);
217 extern "C" __fp16 __hc_rcp_native_half(__fp16 x) restrict(amp);
218 extern "C" float __hc_rcp_native(
float x) restrict(amp);
220 extern "C" __fp16 __hc_remainder_half(__fp16 x, __fp16 y) restrict(amp);
221 extern "C" float __hc_remainder(
float x,
float y) restrict(amp);
222 extern "C" double __hc_remainder_double(
double x,
double y) restrict(amp);
224 extern "C" __fp16 __hc_remquo_half(__fp16 x, __fp16 y,
int *quo) restrict(amp);
225 extern "C" float __hc_remquo(
float x,
float y,
int *quo) restrict(amp);
226 extern "C" double __hc_remquo_double(
double x,
double y,
int *quo) restrict(amp);
228 extern "C" __fp16 __hc_round_half(__fp16 x) restrict(amp);
229 extern "C" float __hc_round(
float x) restrict(amp);
230 extern "C" double __hc_round_double(
double x) restrict(amp);
232 extern "C" __fp16 __hc_rsqrt_half(__fp16 x) restrict(amp);
233 extern "C" __fp16 __hc_rsqrt_native_half(__fp16 x) restrict(amp);
234 extern "C" float __hc_rsqrt(
float x) restrict(amp);
235 extern "C" float __hc_rsqrt_native(
float x) restrict(amp);
236 extern "C" double __hc_rsqrt_double(
double x) restrict(amp);
238 extern "C" __fp16 __hc_scalb_half(__fp16 x, __fp16 exp) restrict(amp);
239 extern "C" float __hc_scalb(
float x,
float exp) restrict(amp);
240 extern "C" double __hc_scalb_double(
double x,
double exp) restrict(amp);
242 extern "C" __fp16 __hc_scalbn_half(__fp16 x,
int exp) restrict(amp);
243 extern "C" float __hc_scalbn(
float x,
int exp) restrict(amp);
244 extern "C" double __hc_scalbn_double(
double x,
int exp) restrict(amp);
246 extern "C" __fp16 __hc_sinpi_half(__fp16 x) restrict(amp);
247 extern "C" float __hc_sinpi(
float x) restrict(amp);
248 extern "C" double __hc_sinpi_double(
double x) restrict(amp);
250 extern "C" int __hc_signbit_half(__fp16 x) restrict(amp);
251 extern "C" int __hc_signbit(
float x) restrict(amp);
252 extern "C" int __hc_signbit_double(
double x) restrict(amp);
254 extern "C" __fp16 __hc_sin_half(__fp16 x) restrict(amp);
255 extern "C" __fp16 __hc_sin_native_half(__fp16 x) restrict(amp);
256 extern "C" float __hc_sin(
float x) restrict(amp);
257 extern "C" float __hc_sin_native(
float x) restrict(amp);
258 extern "C" double __hc_sin_double(
double x) restrict(amp);
260 extern "C" __fp16 __hc_sincos_half(__fp16 x, __fp16 *c) restrict(amp);
261 extern "C" float __hc_sincos(
float x,
float *c) restrict(amp);
262 extern "C" double __hc_sincos_double(
double x,
double *c) restrict(amp);
264 extern "C" __fp16 __hc_sinh_half(__fp16 x) restrict(amp);
265 extern "C" float __hc_sinh(
float x) restrict(amp);
266 extern "C" double __hc_sinh_double(
double x) restrict(amp);
268 extern "C" __fp16 __hc_sqrt_half(__fp16 x) restrict(amp);
269 extern "C" __fp16 __hc_sqrt_native_half(__fp16 x) restrict(amp);
270 extern "C" float __hc_sqrt(
float x) restrict(amp);
271 extern "C" float __hc_sqrt_native(
float x) restrict(amp);
272 extern "C" double __hc_sqrt_double(
double x) restrict(amp);
274 extern "C" __fp16 __hc_tgamma_half(__fp16 x) restrict(amp);
275 extern "C" float __hc_tgamma(
float x) restrict(amp);
276 extern "C" double __hc_tgamma_double(
double x) restrict(amp);
278 extern "C" __fp16 __hc_tan_half(__fp16 x) restrict(amp);
279 extern "C" float __hc_tan(
float x) restrict(amp);
280 extern "C" double __hc_tan_double(
double x) restrict(amp);
282 extern "C" __fp16 __hc_tanh_half(__fp16 x) restrict(amp);
283 extern "C" float __hc_tanh(
float x) restrict(amp);
284 extern "C" double __hc_tanh_double(
double x) restrict(amp);
286 extern "C" __fp16 __hc_tanpi_half(__fp16 x) restrict(amp);
287 extern "C" float __hc_tanpi(
float x) restrict(amp);
288 extern "C" double __hc_tanpi_double(
double x) restrict(amp);
290 extern "C" __fp16 __hc_trunc_half(__fp16 x) restrict(amp);
291 extern "C" float __hc_trunc(
float x) restrict(amp);
292 extern "C" double __hc_trunc_double(
double x) restrict(amp);
294 #define HCC_MATH_LIB_FN inline __attribute__((used, hc)) 364 float acosf(
float x) {
return __hc_acos(x); }
367 __fp16 acos(__fp16 x) {
return __hc_acos_half(x); }
370 float acos(
float x) {
return fast_math::acosf(x); }
373 float asinf(
float x) {
return __hc_asin(x); }
376 __fp16 asin(__fp16 x) {
return __hc_asin_half(x); }
379 float asin(
float x) {
return fast_math::asinf(x); }
382 float atanf(
float x) {
return __hc_atan(x); }
385 __fp16 atan(__fp16 x) {
return __hc_atan_half(x); }
388 float atan(
float x) {
return fast_math::atanf(x); }
391 float atan2f(
float y,
float x) {
return __hc_atan2(y, x); }
394 __fp16 atan2(__fp16 y, __fp16 x) {
return __hc_atan2_half(y, x); }
397 float atan2(
float y,
float x) {
return fast_math::atan2f(y, x); }
400 float ceilf(
float x) {
return __hc_ceil(x); }
403 __fp16 ceil(__fp16 x) {
return __hc_ceil_half(x); }
406 float ceil(
float x) {
return fast_math::ceilf(x); }
409 float cosf(
float x) {
return __hc_cos_native(x); }
412 __fp16 cos(__fp16 x) {
return __hc_cos_native_half(x); }
415 float cos(
float x) {
return fast_math::cosf(x); }
418 float coshf(
float x) {
return __hc_cosh(x); }
421 __fp16 cosh(__fp16 x) {
return __hc_cosh_half(x); }
424 float cosh(
float x) {
return fast_math::coshf(x); }
427 float expf(
float x) {
return __hc_exp2_native(M_LOG2E * x); }
430 __fp16 exp(__fp16 x) {
return __hc_exp2_native_half(M_LOG2E * x); }
433 float exp(
float x) {
return fast_math::expf(x); }
436 float exp2f(
float x) {
return __hc_exp2_native(x); }
439 __fp16 exp2(__fp16 x) {
return __hc_exp2_native_half(x); }
442 float exp2(
float x) {
return fast_math::exp2f(x); }
445 float fabsf(
float x) {
return __hc_fabs(x); }
448 __fp16 fabs(__fp16 x) {
return __hc_fabs_half(x); }
451 float fabs(
float x) {
return fast_math::fabsf(x); }
454 float floorf(
float x) {
return __hc_floor(x); }
457 __fp16 floor(__fp16 x) {
return __hc_floor_half(x); }
460 float floor(
float x) {
return fast_math::floorf(x); }
463 float fmaxf(
float x,
float y) {
return __hc_fmax(x, y); }
466 __fp16 fmax(__fp16 x, __fp16 y) {
return __hc_fmax_half(x, y); }
469 float fmax(
float x,
float y) {
return fast_math::fmaxf(x, y); }
472 float fminf(
float x,
float y) {
return __hc_fmin(x, y); }
475 __fp16 fmin(__fp16 x, __fp16 y) {
return __hc_fmin_half(x, y); }
478 float fmin(
float x,
float y) {
return fast_math::fminf(x, y); }
481 float fmodf(
float x,
float y) {
return __hc_fmod(x, y); }
484 __fp16 fmod(__fp16 x, __fp16 y) {
return __hc_fmod_half(x, y); }
487 float fmod(
float x,
float y) {
return fast_math::fmodf(x, y); }
490 float frexpf(
float x,
int *exp) {
return __hc_frexp(x, exp); }
493 __fp16 frexp(__fp16 x,
int *exp) {
return __hc_frexp_half(x, exp); }
496 float frexp(
float x,
int *exp) {
return fast_math::frexpf(x, exp); }
499 int isfinite(__fp16 x) {
return __hc_isfinite_half(x); }
502 int isfinite(
float x) {
return __hc_isfinite(x); }
505 int isinf(__fp16 x) {
return __hc_isinf_half(x); }
508 int isinf(
float x) {
return __hc_isinf(x); }
511 int isnan(__fp16 x) {
return __hc_isnan_half(x); }
514 int isnan(
float x) {
return __hc_isnan(x); }
517 float ldexpf(
float x,
int exp) {
return __hc_ldexp(x,exp); }
520 __fp16 ldexp(__fp16 x, std::uint16_t exp)
522 return __hc_ldexp_half(x, exp);
526 float ldexp(
float x,
int exp) {
return fast_math::ldexpf(x, exp); }
531 #define M_LOG2_10_F 0x1.a934f0p+1f 533 #define M_RLOG2_10_F 0x1.344136p-2f 535 #define M_RLOG2_E_F 0x1.62e430p-1f 539 float logf(
float x) {
return __hc_log2_native(x) * M_RLOG2_E_F; }
544 return __hc_log2_native_half(x) *
static_cast<__fp16
>(M_RLOG2_E_F);
548 float log(
float x) {
return fast_math::logf(x); }
551 float log10f(
float x) {
return __hc_log2_native(x) * M_RLOG2_10_F; }
554 __fp16 log10(__fp16 x)
556 return __hc_log2_native_half(x) *
static_cast<__fp16
>(M_RLOG2_10_F);
560 float log10(
float x) {
return fast_math::log10f(x); }
563 float log2f(
float x) {
return __hc_log2_native(x); }
566 __fp16 log2(__fp16 x) {
return __hc_log2_native_half(x); }
569 float log2(
float x) {
return fast_math::log2f(x); }
572 float modff(
float x,
float *iptr) {
return __hc_modf(x, iptr); }
575 __fp16 modf(__fp16 x, __fp16 *iptr) {
return __hc_modf_half(x, iptr); }
579 float modf(
float x,
float *iptr) {
return fast_math::modff(x, iptr); }
582 float powf(
float x,
float y) {
return __hc_pow(x, y); }
585 __fp16 pow(__fp16 x, __fp16 y) {
return __hc_pow_half(x, y); }
588 float pow(
float x,
float y) {
return fast_math::powf(x, y); }
591 float roundf(
float x) {
return __hc_round(x); }
594 __fp16 round(__fp16 x) {
return __hc_round_half(x); }
597 float round(
float x) {
return fast_math::roundf(x); }
600 float rsqrtf(
float x) {
return __hc_rsqrt_native(x); }
603 __fp16 rsqrt(__fp16 x) {
return __hc_rsqrt_native_half(x); }
606 float rsqrt(
float x) {
return fast_math::rsqrtf(x); }
609 int signbitf(
float x) {
return __hc_signbit(x); }
612 int signbit(__fp16 x) {
return __hc_signbit_half(x); }
615 int signbit(
float x) {
return fast_math::signbitf(x); }
618 float sinf(
float x) {
return __hc_sin_native(x); }
621 __fp16 sin(__fp16 x) {
return __hc_sin_native_half(x); }
624 float sin(
float x) {
return fast_math::sinf(x); }
627 void sincosf(
float x,
float *s,
float *c) { *s = __hc_sincos(x, c); }
630 void sincos(__fp16 x, __fp16 *s, __fp16 *c)
632 *s = __hc_sincos_half(x, c);
636 void sincos(
float x,
float *s,
float *c)
638 fast_math::sincosf(x, s, c);
642 float sinhf(
float x) {
return __hc_sinh(x); }
645 __fp16 sinh(__fp16 x) {
return __hc_sinh_half(x); }
648 float sinh(
float x) {
return fast_math::sinhf(x); }
651 float sqrtf(
float x) {
return __hc_sqrt_native(x); }
654 __fp16 sqrt(__fp16 x) {
return __hc_sqrt_native_half(x); }
657 float sqrt(
float x) {
return fast_math::sqrtf(x); }
660 float tanf(
float x) {
return __hc_tan(x); }
665 return __hc_sin_native_half(x) *
666 __hc_rcp_native_half(__hc_cos_native_half(x));
670 float tan(
float x) {
return fast_math::tanf(x); }
673 float tanhf(
float x) {
return __hc_tanh(x); }
676 __fp16 tanh(__fp16 x) {
return __hc_tanh_half(x); }
679 float tanh(
float x) {
return fast_math::tanhf(x); }
682 float truncf(
float x) {
return __hc_trunc(x); }
685 __fp16 trunc(__fp16 x) {
return __hc_trunc_half(x); }
688 float trunc(
float x) {
return fast_math::truncf(x); }
767 using std::nearbyint;
769 using std::nextafter;
773 using std::remainder;
798 float acosf(
float x) {
return __hc_acos(x); }
801 __fp16 acos(__fp16 x) {
return __hc_acos_half(x); }
804 float acos(
float x) {
return precise_math::acosf(x); }
807 double acos(
double x) {
return __hc_acos_double(x); }
810 float acoshf(
float x) {
return __hc_acosh(x); }
813 __fp16 acosh(__fp16 x) {
return __hc_acosh_half(x); }
816 float acosh(
float x) {
return precise_math::acoshf(x); }
819 double acosh(
double x) {
return __hc_acosh_double(x); }
822 float asinf(
float x) {
return __hc_asin(x); }
825 __fp16 asin(__fp16 x) {
return __hc_asin_half(x); }
828 float asin(
float x) {
return precise_math::asinf(x); }
831 double asin(
double x) {
return __hc_asin_double(x); }
834 float asinhf(
float x) {
return __hc_asinh(x); }
837 __fp16 asinh(__fp16 x) {
return __hc_asinh_half(x); }
840 float asinh(
float x) {
return precise_math::asinhf(x); }
843 double asinh(
double x) {
return __hc_asinh_double(x); }
846 float atanf(
float x) {
return __hc_atan(x); }
849 __fp16 atan(__fp16 x) {
return __hc_atan_half(x); }
852 float atan(
float x) {
return precise_math::atanf(x); }
855 double atan(
double x) {
return __hc_atan_double(x); }
858 float atanhf(
float x) {
return __hc_atanh(x); }
861 __fp16 atanh(__fp16 x) {
return __hc_atanh_half(x); }
864 float atanh(
float x) {
return precise_math::atanhf(x); }
867 double atanh(
double x) {
return __hc_atanh_double(x); }
870 float atan2f(
float y,
float x) {
return __hc_atan2(y, x); }
873 __fp16 atan2(__fp16 x, __fp16 y) {
return __hc_atan2_half(x, y); }
876 float atan2(
float y,
float x) {
return precise_math::atan2f(y, x); }
879 double atan2(
double y,
double x) {
return __hc_atan2_double(y, x); }
882 float cbrtf(
float x) {
return __hc_cbrt(x); }
885 __fp16 cbrt(__fp16 x) {
return __hc_cbrt_half(x); }
888 float cbrt(
float x) {
return precise_math::cbrtf(x); }
891 double cbrt(
double x) {
return __hc_cbrt_double(x); }
894 float ceilf(
float x) {
return __hc_ceil(x); }
897 __fp16 ceil(__fp16 x) {
return __hc_ceil_half(x); }
900 float ceil(
float x) {
return precise_math::ceilf(x); }
903 double ceil(
double x) {
return __hc_ceil_double(x); }
906 float copysignf(
float x,
float y) {
return __hc_copysign(x, y); }
909 __fp16 copysign(__fp16 x, __fp16 y) {
return __hc_copysign_half(x, y); }
912 float copysign(
float x,
float y)
914 return precise_math::copysignf(x, y);
918 double copysign(
double x,
double y)
920 return __hc_copysign_double(x, y);
924 float cosf(
float x) {
return __hc_cos(x); }
927 __fp16 cos(__fp16 x) {
return __hc_cos_half(x); }
930 float cos(
float x) {
return precise_math::cosf(x); }
933 double cos(
double x) {
return __hc_cos_double(x); }
936 float coshf(
float x) {
return __hc_cosh(x); }
939 __fp16 cosh(__fp16 x) {
return __hc_cosh_half(x); }
942 float cosh(
float x) {
return precise_math::coshf(x); }
945 double cosh(
double x) {
return __hc_cosh_double(x); }
948 float cospif(
float x) {
return __hc_cospi(x); }
951 __fp16 cospi(__fp16 x) {
return __hc_cospi_half(x); }
954 float cospi(
float x) {
return precise_math::cospif(x); }
957 double cospi(
double x) {
return __hc_cospi_double(x); }
960 float erff(
float x) {
return __hc_erf(x); }
963 __fp16 erf(__fp16 x) {
return __hc_erf_half(x); }
966 float erf(
float x) {
return precise_math::erff(x); }
969 double erf(
double x) {
return __hc_erf_double(x); }
972 float erfcf(
float x) {
return __hc_erfc(x); }
975 __fp16 erfc(__fp16 x) {
return __hc_erfc_half(x); }
978 float erfc(
float x) {
return precise_math::erfcf(x); }
981 double erfc(
double x) {
return __hc_erfc_double(x); }
984 float erfcinvf(
float x) {
return __hc_erfcinv(x); }
987 __fp16 erfcinv(__fp16 x) {
return __hc_erfcinv_half(x); }
990 float erfcinv(
float x) {
return precise_math::erfcinvf(x); }
993 double erfcinv(
double x) {
return __hc_erfcinv_double(x); }
996 float erfinvf(
float x) {
return __hc_erfinv(x); }
999 __fp16 erfinv(__fp16 x) {
return __hc_erfinv_half(x); }
1002 float erfinv(
float x) {
return precise_math::erfinvf(x); }
1005 double erfinv(
double x) {
return __hc_erfinv_double(x); }
1008 float expf(
float x) {
return __hc_exp(x); }
1011 __fp16 exp(__fp16 x) {
return __hc_exp_half(x); }
1014 float exp(
float x) {
return precise_math::expf(x); }
1017 double exp(
double x) {
return __hc_exp_double(x); }
1020 float exp2f(
float x) {
return __hc_exp2(x); }
1023 __fp16 exp2(__fp16 x) {
return __hc_exp2_half(x); }
1026 float exp2(
float x) {
return precise_math::exp2f(x); }
1029 double exp2(
double x) {
return __hc_exp2_double(x); }
1032 float exp10f(
float x) {
return __hc_exp10(x); }
1035 __fp16 exp10(__fp16 x) {
return __hc_exp10_half(x); }
1038 float exp10(
float x) {
return precise_math::exp10f(x); }
1041 double exp10(
double x) {
return __hc_exp10_double(x); }
1044 float expm1f(
float x) {
return __hc_expm1(x); }
1047 __fp16 expm1(__fp16 x) {
return __hc_expm1_half(x); }
1050 float expm1(
float x) {
return precise_math::expm1f(x); }
1053 double expm1(
double x) {
return __hc_expm1_double(x); }
1056 float fabsf(
float x) {
return __hc_fabs(x); }
1059 __fp16 fabs(__fp16 x) {
return __hc_fabs_half(x); }
1062 float fabs(
float x) {
return precise_math::fabsf(x); }
1065 double fabs(
double x) {
return __hc_fabs_double(x); }
1068 float fdimf(
float x,
float y) {
return __hc_fdim(x, y); }
1071 __fp16 fdim(__fp16 x, __fp16 y) {
return __hc_fdim_half(x, y); }
1074 float fdim(
float x,
float y) {
return precise_math::fdimf(x, y); }
1077 double fdim(
double x,
double y) {
return __hc_fdim_double(x, y); }
1080 float floorf(
float x) {
return __hc_floor(x); }
1083 __fp16 floor(__fp16 x) {
return __hc_floor_half(x); }
1086 float floor(
float x) {
return precise_math::floorf(x); }
1089 double floor(
double x) {
return __hc_floor_double(x); }
1092 float fmaf(
float x,
float y,
float z) {
return __hc_fma(x, y, z); }
1095 __fp16 fma(__fp16 x, __fp16 y, __fp16 z)
1097 return __hc_fma_half(x, y, z);
1101 float fma(
float x,
float y,
float z)
1103 return precise_math::fmaf(x, y, z);
1107 double fma(
double x,
double y,
double z)
1109 return __hc_fma_double(x, y, z);
1113 float fmaxf(
float x,
float y) {
return __hc_fmax(x, y); }
1116 __fp16 fmax(__fp16 x, __fp16 y) {
return __hc_fmax_half(x, y); }
1119 float fmax(
float x,
float y) {
return precise_math::fmaxf(x, y); }
1122 double fmax(
double x,
double y) {
return __hc_fmax_double(x, y); }
1125 float fminf(
float x,
float y) {
return __hc_fmin(x, y); }
1128 __fp16 fmin(__fp16 x, __fp16 y) {
return __hc_fmin_half(x, y); }
1131 float fmin(
float x,
float y) {
return precise_math::fminf(x, y); }
1134 double fmin(
double x,
double y) {
return __hc_fmin_double(x, y); }
1137 float fmodf(
float x,
float y) {
return __hc_fmod(x, y); }
1140 __fp16 fmod(__fp16 x, __fp16 y) {
return __hc_fmod_half(x, y); }
1143 float fmod(
float x,
float y) {
return precise_math::fmodf(x, y); }
1146 double fmod(
double x,
double y) {
return __hc_fmod_double(x, y); }
1149 int fpclassify(__fp16 x) {
return __hc_fpclassify_half(x); }
1152 int fpclassify(
float x) {
return __hc_fpclassify(x); }
1155 int fpclassify(
double x) {
return __hc_fpclassify_double(x); }
1158 float frexpf(
float x,
int *exp) {
return __hc_frexp(x, exp); }
1161 __fp16 frexp(__fp16 x,
int* exp) {
return __hc_frexp_half(x, exp); }
1164 float frexp(
float x,
int *exp) {
return precise_math::frexpf(x, exp); }
1167 double frexp(
double x,
int *exp) {
return __hc_frexp_double(x, exp); }
1170 float hypotf(
float x,
float y) {
return __hc_hypot(x, y); }
1173 __fp16 hypot(__fp16 x, __fp16 y) {
return __hc_hypot_half(x, y); }
1176 float hypot(
float x,
float y) {
return precise_math::hypotf(x, y); }
1179 double hypot(
double x,
double y) {
return __hc_hypot_double(x, y); }
1182 int ilogbf(
float x) {
return __hc_ilogb(x); }
1185 int ilogb(__fp16 x) {
return __hc_ilogb_half(x); }
1188 int ilogb(
float x) {
return precise_math::ilogbf(x); }
1191 int ilogb(
double x) {
return __hc_ilogb_double(x); }
1194 int isfinite(__fp16 x) {
return __hc_isfinite_half(x); }
1197 int isfinite(
float x) {
return __hc_isfinite(x); }
1200 int isfinite(
double x) {
return __hc_isfinite_double(x); }
1203 int isinf(__fp16 x) {
return __hc_isinf_half(x); }
1206 int isinf(
float x) {
return __hc_isinf(x); }
1209 int isinf(
double x) {
return __hc_isinf_double(x); }
1212 int isnan(__fp16 x) {
return __hc_isnan_half(x); }
1215 int isnan(
float x) {
return __hc_isnan(x); }
1218 int isnan(
double x) {
return __hc_isnan_double(x); }
1221 int isnormal(__fp16 x) {
return __hc_isnormal_half(x); }
1224 int isnormal(
float x) {
return __hc_isnormal(x); }
1227 int isnormal(
double x) {
return __hc_isnormal_double(x); }
1230 float ldexpf(
float x,
int exp) {
return __hc_ldexp(x, exp); }
1233 __fp16 ldexp(__fp16 x, std::int16_t e) {
return __hc_ldexp_half(x, e); }
1236 float ldexp(
float x,
int exp) {
return precise_math::ldexpf(x, exp); }
1239 double ldexp(
double x,
int exp) {
return __hc_ldexp_double(x,exp); }
1242 float lgammaf(
float x) {
return __hc_lgamma(x); }
1245 __fp16 lgamma(__fp16 x) {
return __hc_lgamma_half(x); }
1248 float lgamma(
float x) {
return precise_math::lgammaf(x); }
1251 double lgamma(
double x) {
return __hc_lgamma_double(x); }
1254 float logf(
float x) {
return __hc_log(x); }
1257 __fp16 log(__fp16 x) {
return __hc_log_half(x); }
1260 float log(
float x) {
return precise_math::logf(x); }
1263 double log(
double x) {
return __hc_log_double(x); }
1266 float log10f(
float x) {
return __hc_log10(x); }
1269 __fp16 log10(__fp16 x) {
return __hc_log10_half(x); }
1272 float log10(
float x) {
return precise_math::log10f(x); }
1275 double log10(
double x) {
return __hc_log10_double(x); }
1278 float log2f(
float x) {
return __hc_log2(x); }
1281 __fp16 log2(__fp16 x) {
return __hc_log2_half(x); }
1284 float log2(
float x) {
return precise_math::log2f(x); }
1287 double log2(
double x) {
return __hc_log2_double(x); }
1290 float log1pf(
float x) {
return __hc_log1p(x); }
1293 __fp16 log1p(__fp16 x) {
return __hc_log1p_half(x); }
1296 float log1p(
float x) {
return precise_math::log1pf(x); }
1299 double log1p(
double x) {
return __hc_log1p(x); }
1302 float logbf(
float x) {
return __hc_logb(x); }
1305 __fp16 logb(__fp16 x) {
return __hc_logb_half(x); }
1308 float logb(
float x) {
return precise_math::logbf(x); }
1311 double logb(
double x) {
return __hc_logb_double(x); }
1314 float modff(
float x,
float *iptr) {
return __hc_modf(x, iptr); }
1317 __fp16 modf(__fp16 x, __fp16* p) {
return __hc_modf_half(x, p); }
1320 float modf(
float x,
float* p) {
return precise_math::modff(x, p); }
1323 double modf(
double x,
double* p) {
return __hc_modf_double(x, p); }
1326 __fp16 nanh(
int x) {
return __hc_nan_half(x); }
1329 float nanf(
int tagp) {
return __hc_nan(tagp); }
1332 double nan(
int tagp)
1334 return __hc_nan_double(static_cast<unsigned long>(tagp));
1338 float nearbyintf(
float x) {
return __hc_nearbyint(x); }
1341 __fp16 nearbyint(__fp16 x) {
return __hc_nearbyint_half(x); }
1344 float nearbyint(
float x) {
return precise_math::nearbyintf(x); }
1347 double nearbyint(
double x) {
return __hc_nearbyint_double(x); }
1350 float nextafterf(
float x,
float y) {
return __hc_nextafter(x, y); }
1353 __fp16 nextafter(__fp16 x, __fp16 y)
1355 return __hc_nextafter_half(x, y);
1359 float nextafter(
float x,
float y)
1361 return precise_math::nextafterf(x, y);
1365 double nextafter(
double x,
double y)
1367 return __hc_nextafter_double(x, y);
1371 float powf(
float x,
float y) {
return __hc_pow(x, y); }
1374 __fp16 pow(__fp16 x, __fp16 y) {
return __hc_pow_half(x, y); }
1377 float pow(
float x,
float y) {
return precise_math::powf(x, y); }
1380 double pow(
double x,
double y) {
return __hc_pow_double(x, y); }
1383 float rcbrtf(
float x) {
return __hc_rcbrt(x); }
1386 __fp16 rcbrt(__fp16 x) {
return __hc_rcbrt_half(x); }
1389 float rcbrt(
float x) {
return precise_math::rcbrtf(x); }
1392 double rcbrt(
double x) {
return __hc_rcbrt_double(x); }
1395 float remainderf(
float x,
float y) {
return __hc_remainder(x, y); }
1398 __fp16 remainder(__fp16 x, __fp16 y)
1400 return __hc_remainder_half(x, y);
1404 float remainder(
float x,
float y)
1406 return precise_math::remainderf(x, y);
1410 double remainder(
double x,
double y)
1412 return __hc_remainder_double(x, y);
1416 float remquof(
float x,
float y,
int *quo)
1418 return __hc_remquo(x, y, quo);
1422 __fp16 remquo(__fp16 x, __fp16 y,
int* q)
1424 return __hc_remquo_half(x, y, q);
1428 float remquo(
float x,
float y,
int *quo)
1430 return precise_math::remquof(x, y, quo);
1434 double remquo(
double x,
double y,
int *quo)
1436 return __hc_remquo_double(x, y, quo);
1440 float roundf(
float x) {
return __hc_round(x); }
1443 __fp16 round(__fp16 x) {
return __hc_round_half(x); }
1446 float round(
float x) {
return precise_math::roundf(x); }
1449 double round(
double x) {
return __hc_round_double(x); }
1452 float rsqrtf(
float x) {
return __hc_rsqrt(x); }
1455 __fp16 rsqrt(__fp16 x) {
return __hc_rsqrt_half(x); }
1458 float rsqrt(
float x) {
return precise_math::rsqrtf(x); }
1461 double rsqrt(
double x) {
return __hc_rsqrt_double(x); }
1464 float sinpif(
float x) {
return __hc_sinpi(x); }
1467 __fp16 sinpi(__fp16 x) {
return __hc_sinpi_half(x); }
1470 float sinpi(
float x) {
return precise_math::sinpif(x); }
1473 double sinpi(
double x) {
return __hc_sinpi_double(x); }
1476 float scalbf(
float x,
float exp) {
return __hc_scalb(x, exp); }
1479 __fp16 scalb(__fp16 x, __fp16 y) {
return __hc_scalb_half(x, y); }
1482 float scalb(
float x,
float exp) {
return precise_math::scalbf(x, exp); }
1485 double scalb(
double x,
double exp) {
return __hc_scalb_double(x, exp); }
1488 float scalbnf(
float x,
int exp) {
return __hc_scalbn(x, exp); }
1491 __fp16 scalbn(__fp16 x,
int e) {
return __hc_scalbn_half(x, e); }
1494 float scalbn(
float x,
int exp) {
return precise_math::scalbnf(x, exp); }
1497 double scalbn(
double x,
int exp) {
return __hc_scalbn_double(x, exp); }
1500 int signbitf(
float x) {
return __hc_signbit(x); }
1503 int signbit(__fp16 x) {
return __hc_signbit_half(x); }
1506 int signbit(
float x) {
return precise_math::signbitf(x); }
1509 int signbit(
double x) {
return __hc_signbit_double(x); }
1512 float sinf(
float x) {
return __hc_sin(x); }
1515 __fp16 sin(__fp16 x) {
return __hc_sin_half(x); }
1518 float sin(
float x) {
return precise_math::sinf(x); }
1521 double sin(
double x) {
return __hc_sin_double(x); }
1524 void sincosf(
float x,
float *s,
float *c) { *s = __hc_sincos(x, c); }
1527 void sincos(__fp16 x, __fp16* s, __fp16* c)
1529 *s = __hc_sincos_half(x, c);
1533 void sincos(
float x,
float *s,
float *c)
1535 precise_math::sincosf(x, s, c);
1539 void sincos(
double x,
double *s,
double *c)
1541 *s = __hc_sincos_double(x, c);
1545 float sinhf(
float x) {
return __hc_sinh(x); }
1548 __fp16 sinh(__fp16 x) {
return __hc_sinh_half(x); }
1551 float sinh(
float x) {
return precise_math::sinhf(x); }
1554 double sinh(
double x) {
return __hc_sinh_double(x); }
1557 float sqrtf(
float x) {
return __hc_sqrt(x); }
1560 __fp16 sqrt(__fp16 x) {
return __hc_sqrt_half(x); }
1563 float sqrt(
float x) {
return precise_math::sqrtf(x); }
1566 double sqrt(
double x) {
return __hc_sqrt_double(x); }
1569 float tgammaf(
float x) {
return __hc_tgamma(x); }
1572 __fp16 tgamma(__fp16 x) {
return __hc_tgamma_half(x); }
1575 float tgamma(
float x) {
return precise_math::tgammaf(x); }
1578 double tgamma(
double x) {
return __hc_tgamma_double(x); }
1581 float tanf(
float x) {
return __hc_tan(x); }
1584 __fp16 tan(__fp16 x) {
return __hc_tan_half(x); }
1587 float tan(
float x) {
return precise_math::tanf(x); }
1590 double tan(
double x) {
return __hc_tan_double(x); }
1593 float tanhf(
float x) {
return __hc_tanh(x); }
1596 __fp16 tanh(__fp16 x) {
return __hc_tanh_half(x); }
1599 float tanh(
float x) {
return precise_math::tanhf(x); }
1602 double tanh(
double x) {
return __hc_tanh(x); }
1605 float tanpif(
float x) {
return __hc_tanpi(x); }
1608 __fp16 tanpi(__fp16 x) {
return __hc_tanpi_half(x); }
1611 float tanpi(
float x) {
return precise_math::tanpif(x); }
1614 double tanpi(
double x) {
return __hc_tanpi_double(x); }
1617 float truncf(
float x) {
return __hc_trunc(x); }
1620 __fp16 trunc(__fp16 x) {
return __hc_trunc_half(x); }
1623 float trunc(
float x) {
return precise_math::truncf(x); }
1626 double trunc(
double x) {
return __hc_trunc_double(x); }
namespace for internal classes of Kalmar compiler / runtime
Definition: hc.hpp:42
Definition: kalmar_math.h:691
Heterogeneous C++ (HC) namespace.
Definition: grid_launch.h:10
Definition: kalmar_math.h:297