DPC++ Runtime
Runtime libraries for oneAPI DPC++
builtins_math.cpp
Go to the documentation of this file.
1 //==----------- builtins_math.cpp - SYCL built-in math functions -----------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // This file defines the host versions of functions defined
10 // in SYCL SPEC section - 4.13.3 Math functions.
11 
12 // Define _USE_MATH_DEFINES to enforce math defines of macros like M_PI in
13 // <cmath>. _USE_MATH_DEFINES is defined here before includes of SYCL header
14 // files to avoid include of <cmath> via those SYCL headers with unset
15 // _USE_MATH_DEFINES.
16 #define _USE_MATH_DEFINES
17 
18 #include "builtins_helper.hpp"
19 #include <sycl/detail/export.hpp>
20 
21 #include <cmath>
22 
23 namespace s = sycl;
24 namespace d = s::detail;
25 
26 namespace __host_std {
27 
28 namespace {
29 template <typename T> inline T __acospi(T x) { return std::acos(x) / M_PI; }
30 
31 template <typename T> inline T __asinpi(T x) { return std::asin(x) / M_PI; }
32 
33 template <typename T> inline T __atanpi(T x) { return std::atan(x) / M_PI; }
34 
35 template <typename T> inline T __atan2pi(T x, T y) {
36  return std::atan2(x, y) / M_PI;
37 }
38 
39 template <typename T> inline T __cospi(T x) {
40  return std::sin(M_PI * (0.5 - x));
41 }
42 
43 template <typename T> T inline __fract(T x, T *iptr) {
44  T f = std::floor(x);
45  *(iptr) = f;
46  return std::fmin(x - f, std::nextafter(T(1.0), T(0.0)));
47 }
48 
49 template <typename T> inline T __lgamma_r(T x, s::cl_int *signp) {
50  T g = std::tgamma(x);
51  *signp = std::signbit(d::cast_if_host_half(g)) ? -1 : 1;
52  return std::log(std::abs(g));
53 }
54 
55 template <typename T> inline T __mad(T a, T b, T c) { return (a * b) + c; }
56 
57 template <typename T> inline T __maxmag(T x, T y) {
58  if (std::fabs(x) > std::fabs(y))
59  return x;
60  if (std::fabs(y) > std::fabs(x))
61  return y;
62  return std::fmax(x, y);
63 }
64 
65 template <typename T> inline T __minmag(T x, T y) {
66  if (std::fabs(x) < std::fabs(y))
67  return x;
68  if (std::fabs(y) < std::fabs(x))
69  return y;
70  return std::fmin(x, y);
71 }
72 
73 template <typename T> inline T __powr(T x, T y) {
74  return (x >= T(0)) ? T(std::pow(x, y)) : x;
75 }
76 
77 template <typename T> inline T __rootn(T x, s::cl_int y) {
78  return std::pow(x, T(1.0) / y);
79 }
80 
81 template <typename T> inline T __rsqrt(T x) { return T(1.0) / std::sqrt(x); }
82 
83 template <typename T> inline T __sincos(T x, T *cosval) {
84  (*cosval) = std::cos(x);
85  return std::sin(x);
86 }
87 
88 template <typename T> inline T __sinpi(T x) { return std::sin(M_PI * x); }
89 
90 template <typename T> inline T __tanpi(T x) {
91  // For uniformity, place in range [0.0, 1.0).
92  double y = x - std::floor(x);
93  // Flip for better accuracy.
94  return 1.0 / std::tan((0.5 - y) * M_PI);
95 }
96 
97 } // namespace
98 
99 // ----------------- 4.13.3 Math functions. Host implementations ---------------
100 // acos
102  return std::acos(x);
103 }
105  return std::acos(x);
106 }
108  return std::acos(x);
109 }
113 
114 // acosh
116  return std::acosh(x);
117 }
119  return std::acosh(x);
120 }
122  return std::acosh(x);
123 }
127 
128 // acospi
130  return __acospi(x);
131 }
133  return __acospi(x);
134 }
136  return __acospi(x);
137 }
141 
142 // asin
144  return std::asin(x);
145 }
147  return std::asin(x);
148 }
150  return std::asin(x);
151 }
155 
156 // asinh
158  return std::asinh(x);
159 }
161  return std::asinh(x);
162 }
164  return std::asinh(x);
165 }
169 
170 // asinpi
172  return __asinpi(x);
173 }
175  return __asinpi(x);
176 }
178  return __asinpi(x);
179 }
183 
184 // atan
186  return std::atan(x);
187 }
189  return std::atan(x);
190 }
192  return std::atan(x);
193 }
197 
198 // atan2
199 __SYCL_EXPORT s::cl_float sycl_host_atan2(s::cl_float x,
200  s::cl_float y) __NOEXC {
201  return std::atan2(x, y);
202 }
204  s::cl_double y) __NOEXC {
205  return std::atan2(x, y);
206 }
208  return std::atan2(x, y);
209 }
213 
214 // atanh
216  return std::atanh(x);
217 }
219  return std::atanh(x);
220 }
222  return std::atanh(x);
223 }
227 
228 // atanpi
230  return __atanpi(x);
231 }
233  return __atanpi(x);
234 }
236  return __atanpi(x);
237 }
241 
242 // atan2pi
244  s::cl_float y) __NOEXC {
245  return __atan2pi(x, y);
246 }
248  s::cl_double y) __NOEXC {
249  return __atan2pi(x, y);
250 }
252  return __atan2pi(x, y);
253 }
257 
258 // cbrt
260  return std::cbrt(x);
261 }
263  return std::cbrt(x);
264 }
266  return std::cbrt(x);
267 }
271 
272 // ceil
274  return std::ceil(x);
275 }
277  return std::ceil(x);
278 }
280  return std::ceil(x);
281 }
285 
286 // copysign
288  s::cl_float y) __NOEXC {
289  return std::copysign(x, y);
290 }
292  s::cl_double y) __NOEXC {
293  return std::copysign(x, y);
294 }
296  s::cl_half y) __NOEXC {
297  return std::copysign(x, y);
298 }
302 
303 // cos
304 __SYCL_EXPORT s::cl_float sycl_host_cos(s::cl_float x) __NOEXC {
305  return std::cos(x);
306 }
308  return std::cos(x);
309 }
311  return std::cos(x);
312 }
316 
317 // cosh
319  return std::cosh(x);
320 }
322  return std::cosh(x);
323 }
325  return std::cosh(x);
326 }
330 
331 // cospi
333  return __cospi(x);
334 }
336  return __cospi(x);
337 }
339  return __cospi(x);
340 }
344 
345 // erfc
347  return std::erfc(x);
348 }
350  return std::erfc(x);
351 }
353  return std::erfc(x);
354 }
358 
359 // erf
360 __SYCL_EXPORT s::cl_float sycl_host_erf(s::cl_float x) __NOEXC {
361  return std::erf(x);
362 }
364  return std::erf(x);
365 }
367  return std::erf(x);
368 }
372 
373 // exp
374 __SYCL_EXPORT s::cl_float sycl_host_exp(s::cl_float x) __NOEXC {
375  return std::exp(x);
376 }
378  return std::exp(x);
379 }
381  return std::exp(x);
382 }
386 
387 // exp2
389  return std::exp2(x);
390 }
392  return std::exp2(x);
393 }
395  return std::exp2(x);
396 }
400 
401 // exp10
403  return std::pow(10, x);
404 }
406  return std::pow(10, x);
407 }
409  return std::pow(10, x);
410 }
414 
415 // expm1
417  return std::expm1(x);
418 }
420  return std::expm1(x);
421 }
423  return std::expm1(x);
424 }
428 
429 // fabs
431  return std::fabs(x);
432 }
434  return std::fabs(x);
435 }
437  return std::fabs(x);
438 }
442 
443 // fdim
445  return std::fdim(x, y);
446 }
448  s::cl_double y) __NOEXC {
449  return std::fdim(x, y);
450 }
452  return std::fdim(x, y);
453 }
457 
458 // floor
460  return std::floor(x);
461 }
463  return std::floor(x);
464 }
466  return std::floor(x);
467 }
471 
472 // fma
473 __SYCL_EXPORT s::cl_float sycl_host_fma(s::cl_float a, s::cl_float b,
474  s::cl_float c) __NOEXC {
475  return std::fma(a, b, c);
476 }
479  return std::fma(a, b, c);
480 }
482  s::cl_half c) __NOEXC {
483  return std::fma(a, b, c);
484 }
487  s::cl_double)
489 
490 // fmax
491 __SYCL_EXPORT s::cl_float sycl_host_fmax(s::cl_float x, s::cl_float y) __NOEXC {
492  return std::fmax(x, y);
493 }
494 __SYCL_EXPORT s::cl_double sycl_host_fmax(s::cl_double x,
495  s::cl_double y) __NOEXC {
496  return std::fmax(x, y);
497 }
498 __SYCL_EXPORT s::cl_half sycl_host_fmax(s::cl_half x, s::cl_half y) __NOEXC {
499  return std::fmax(x, y);
500 }
503 MAKE_1V_2V(sycl_host_fmax, s::cl_half, s::cl_half, s::cl_half)
504 
505 // fmin
506 __SYCL_EXPORT s::cl_float sycl_host_fmin(s::cl_float x, s::cl_float y) __NOEXC {
507  return std::fmin(x, y);
508 }
509 __SYCL_EXPORT s::cl_double sycl_host_fmin(s::cl_double x,
510  s::cl_double y) __NOEXC {
511  return std::fmin(x, y);
512 }
513 __SYCL_EXPORT s::cl_half sycl_host_fmin(s::cl_half x, s::cl_half y) __NOEXC {
514  return std::fmin(x, y);
515 }
518 MAKE_1V_2V(sycl_host_fmin, s::cl_half, s::cl_half, s::cl_half)
519 
520 // fmod
521 __SYCL_EXPORT s::cl_float sycl_host_fmod(s::cl_float x, s::cl_float y) __NOEXC {
522  return std::fmod(x, y);
523 }
524 __SYCL_EXPORT s::cl_double sycl_host_fmod(s::cl_double x,
525  s::cl_double y) __NOEXC {
526  return std::fmod(x, y);
527 }
528 __SYCL_EXPORT s::cl_half sycl_host_fmod(s::cl_half x, s::cl_half y) __NOEXC {
529  return std::fmod(x, y);
530 }
533 MAKE_1V_2V(sycl_host_fmod, s::cl_half, s::cl_half, s::cl_half)
534 
535 // nextafter
536 __SYCL_EXPORT s::cl_float sycl_host_nextafter(s::cl_float x,
537  s::cl_float y) __NOEXC {
538  return std::nextafter(x, y);
539 }
540 __SYCL_EXPORT s::cl_double sycl_host_nextafter(s::cl_double x,
541  s::cl_double y) __NOEXC {
542  return std::nextafter(x, y);
543 }
544 __SYCL_EXPORT s::cl_half sycl_host_nextafter(s::cl_half x,
545  s::cl_half y) __NOEXC {
547  return x;
548  if (std::isnan(d::cast_if_host_half(y)) || x == y)
549  return y;
550 
551  uint16_t x_bits = s::bit_cast<uint16_t>(x);
552  uint16_t x_sign = x_bits & 0x8000;
553  int16_t movement = (x > y ? -1 : 1) * (x_sign ? -1 : 1);
554  if (x_bits == x_sign && movement == -1) {
555  // Special case where we underflow in the decrement, in which case we turn
556  // it around and flip the sign. The overflow case does not need special
557  // handling.
558  movement = 1;
559  x_bits ^= 0x8000;
560  }
561  x_bits += movement;
562  return s::bit_cast<s::cl_half>(x_bits);
563 }
564 MAKE_1V_2V(sycl_host_nextafter, s::cl_float, s::cl_float, s::cl_float)
565 MAKE_1V_2V(sycl_host_nextafter, s::cl_double, s::cl_double, s::cl_double)
566 MAKE_1V_2V(sycl_host_nextafter, s::cl_half, s::cl_half, s::cl_half)
567 
568 // fract
569 __SYCL_EXPORT s::cl_float sycl_host_fract(s::cl_float x,
571  return __fract(x, iptr);
572 }
573 __SYCL_EXPORT s::cl_double sycl_host_fract(s::cl_double x,
575  return __fract(x, iptr);
576 }
577 __SYCL_EXPORT s::cl_half sycl_host_fract(s::cl_half x,
579  return __fract(x, iptr);
580 }
581 MAKE_1V_2P(sycl_host_fract, s::cl_float, s::cl_float, s::cl_float)
583 MAKE_1V_2P(sycl_host_fract, s::cl_half, s::cl_half, s::cl_half)
584 
585 // frexp
586 __SYCL_EXPORT s::cl_float sycl_host_frexp(s::cl_float x,
587  s::cl_int *exp) __NOEXC {
588  return std::frexp(x, exp);
589 }
590 __SYCL_EXPORT s::cl_double sycl_host_frexp(s::cl_double x,
591  s::cl_int *exp) __NOEXC {
592  return std::frexp(x, exp);
593 }
594 __SYCL_EXPORT s::cl_half sycl_host_frexp(s::cl_half x, s::cl_int *exp) __NOEXC {
595  return std::frexp(x, exp);
596 }
597 MAKE_1V_2P(sycl_host_frexp, s::cl_float, s::cl_float, s::cl_int)
598 MAKE_1V_2P(sycl_host_frexp, s::cl_double, s::cl_double, s::cl_int)
599 MAKE_1V_2P(sycl_host_frexp, s::cl_half, s::cl_half, s::cl_int)
600 
601 // hypot
602 __SYCL_EXPORT s::cl_float sycl_host_hypot(s::cl_float x,
603  s::cl_float y) __NOEXC {
604  return std::hypot(x, y);
605 }
606 __SYCL_EXPORT s::cl_double sycl_host_hypot(s::cl_double x,
607  s::cl_double y) __NOEXC {
608  return std::hypot(x, y);
609 }
610 __SYCL_EXPORT s::cl_half sycl_host_hypot(s::cl_half x, s::cl_half y) __NOEXC {
611  return std::hypot(x, y);
612 }
613 MAKE_1V_2V(sycl_host_hypot, s::cl_float, s::cl_float, s::cl_float)
615 MAKE_1V_2V(sycl_host_hypot, s::cl_half, s::cl_half, s::cl_half)
616 
617 // ilogb
618 __SYCL_EXPORT s::cl_int sycl_host_ilogb(s::cl_float x) __NOEXC {
619  return std::ilogb(x);
620 }
621 __SYCL_EXPORT s::cl_int sycl_host_ilogb(s::cl_double x) __NOEXC {
622  return std::ilogb(x);
623 }
624 __SYCL_EXPORT s::cl_int sycl_host_ilogb(s::cl_half x) __NOEXC {
625  return std::ilogb(x);
626 }
627 MAKE_1V(sycl_host_ilogb, s::cl_int, s::cl_float)
628 MAKE_1V(sycl_host_ilogb, s::cl_int, s::cl_double)
629 MAKE_1V(sycl_host_ilogb, s::cl_int, s::cl_half)
630 
631 // ldexp
632 __SYCL_EXPORT s::cl_float sycl_host_ldexp(s::cl_float x, s::cl_int k) __NOEXC {
633  return std::ldexp(x, k);
634 }
635 __SYCL_EXPORT s::cl_double sycl_host_ldexp(s::cl_double x,
636  s::cl_int k) __NOEXC {
637  return std::ldexp(x, k);
638 }
639 __SYCL_EXPORT s::cl_half sycl_host_ldexp(s::cl_half x, s::cl_int k) __NOEXC {
640  return std::ldexp(x, k);
641 }
642 MAKE_1V_2V(sycl_host_ldexp, s::cl_float, s::cl_float, s::cl_int)
643 MAKE_1V_2V(sycl_host_ldexp, s::cl_double, s::cl_double, s::cl_int)
644 MAKE_1V_2V(sycl_host_ldexp, s::cl_half, s::cl_half, s::cl_int)
645 
646 // lgamma
647 __SYCL_EXPORT s::cl_float sycl_host_lgamma(s::cl_float x) __NOEXC {
648  return std::lgamma(x);
649 }
650 __SYCL_EXPORT s::cl_double sycl_host_lgamma(s::cl_double x) __NOEXC {
651  return std::lgamma(x);
652 }
653 __SYCL_EXPORT s::cl_half sycl_host_lgamma(s::cl_half x) __NOEXC {
654  return std::lgamma(x);
655 }
656 MAKE_1V(sycl_host_lgamma, s::cl_float, s::cl_float)
657 MAKE_1V(sycl_host_lgamma, s::cl_double, s::cl_double)
658 MAKE_1V(sycl_host_lgamma, s::cl_half, s::cl_half)
659 
660 // lgamma_r
661 __SYCL_EXPORT s::cl_float sycl_host_lgamma_r(s::cl_float x,
662  s::cl_int *signp) __NOEXC {
663  return __lgamma_r(x, signp);
664 }
665 __SYCL_EXPORT s::cl_double sycl_host_lgamma_r(s::cl_double x,
666  s::cl_int *signp) __NOEXC {
667  return __lgamma_r(x, signp);
668 }
669 __SYCL_EXPORT s::cl_half sycl_host_lgamma_r(s::cl_half x,
670  s::cl_int *signp) __NOEXC {
671  return __lgamma_r(x, signp);
672 }
673 MAKE_1V_2P(sycl_host_lgamma_r, s::cl_float, s::cl_float, s::cl_int)
674 MAKE_1V_2P(sycl_host_lgamma_r, s::cl_double, s::cl_double, s::cl_int)
675 MAKE_1V_2P(sycl_host_lgamma_r, s::cl_half, s::cl_half, s::cl_int)
676 
677 // log
678 __SYCL_EXPORT s::cl_float sycl_host_log(s::cl_float x) __NOEXC {
679  return std::log(x);
680 }
681 __SYCL_EXPORT s::cl_double sycl_host_log(s::cl_double x) __NOEXC {
682  return std::log(x);
683 }
684 __SYCL_EXPORT s::cl_half sycl_host_log(s::cl_half x) __NOEXC {
685  return std::log(x);
686 }
687 MAKE_1V(sycl_host_log, s::cl_float, s::cl_float)
688 MAKE_1V(sycl_host_log, s::cl_double, s::cl_double)
689 MAKE_1V(sycl_host_log, s::cl_half, s::cl_half)
690 
691 // log2
692 __SYCL_EXPORT s::cl_float sycl_host_log2(s::cl_float x) __NOEXC {
693  return std::log2(x);
694 }
695 __SYCL_EXPORT s::cl_double sycl_host_log2(s::cl_double x) __NOEXC {
696  return std::log2(x);
697 }
698 __SYCL_EXPORT s::cl_half sycl_host_log2(s::cl_half x) __NOEXC {
699  return std::log2(x);
700 }
701 MAKE_1V(sycl_host_log2, s::cl_float, s::cl_float)
702 MAKE_1V(sycl_host_log2, s::cl_double, s::cl_double)
703 MAKE_1V(sycl_host_log2, s::cl_half, s::cl_half)
704 
705 // log10
706 __SYCL_EXPORT s::cl_float sycl_host_log10(s::cl_float x) __NOEXC {
707  return std::log10(x);
708 }
709 __SYCL_EXPORT s::cl_double sycl_host_log10(s::cl_double x) __NOEXC {
710  return std::log10(x);
711 }
712 __SYCL_EXPORT s::cl_half sycl_host_log10(s::cl_half x) __NOEXC {
713  return std::log10(x);
714 }
715 MAKE_1V(sycl_host_log10, s::cl_float, s::cl_float)
716 MAKE_1V(sycl_host_log10, s::cl_double, s::cl_double)
717 MAKE_1V(sycl_host_log10, s::cl_half, s::cl_half)
718 
719 // log1p
720 __SYCL_EXPORT s::cl_float sycl_host_log1p(s::cl_float x) __NOEXC {
721  return std::log1p(x);
722 }
723 __SYCL_EXPORT s::cl_double sycl_host_log1p(s::cl_double x) __NOEXC {
724  return std::log1p(x);
725 }
726 __SYCL_EXPORT s::cl_half sycl_host_log1p(s::cl_half x) __NOEXC {
727  return std::log1p(x);
728 }
729 MAKE_1V(sycl_host_log1p, s::cl_float, s::cl_float)
730 MAKE_1V(sycl_host_log1p, s::cl_double, s::cl_double)
731 MAKE_1V(sycl_host_log1p, s::cl_half, s::cl_half)
732 
733 // logb
734 __SYCL_EXPORT s::cl_float sycl_host_logb(s::cl_float x) __NOEXC {
735  return std::logb(x);
736 }
737 __SYCL_EXPORT s::cl_double sycl_host_logb(s::cl_double x) __NOEXC {
738  return std::logb(x);
739 }
740 __SYCL_EXPORT s::cl_half sycl_host_logb(s::cl_half x) __NOEXC {
741  return std::logb(x);
742 }
743 MAKE_1V(sycl_host_logb, s::cl_float, s::cl_float)
744 MAKE_1V(sycl_host_logb, s::cl_double, s::cl_double)
745 MAKE_1V(sycl_host_logb, s::cl_half, s::cl_half)
746 
747 // mad
748 __SYCL_EXPORT s::cl_float sycl_host_mad(s::cl_float a, s::cl_float b,
750  return __mad(a, b, c);
751 }
752 __SYCL_EXPORT s::cl_double sycl_host_mad(s::cl_double a, s::cl_double b,
754  return __mad(a, b, c);
755 }
756 __SYCL_EXPORT s::cl_half sycl_host_mad(s::cl_half a, s::cl_half b,
757  s::cl_half c) __NOEXC {
758  return __mad(a, b, c);
759 }
762  s::cl_double)
764 
765 // maxmag
766 __SYCL_EXPORT s::cl_float sycl_host_maxmag(s::cl_float x,
767  s::cl_float y) __NOEXC {
768  return __maxmag(x, y);
769 }
770 __SYCL_EXPORT s::cl_double sycl_host_maxmag(s::cl_double x,
771  s::cl_double y) __NOEXC {
772  return __maxmag(x, y);
773 }
774 __SYCL_EXPORT s::cl_half sycl_host_maxmag(s::cl_half x, s::cl_half y) __NOEXC {
775  return __maxmag(x, y);
776 }
777 MAKE_1V_2V(sycl_host_maxmag, s::cl_float, s::cl_float, s::cl_float)
779 MAKE_1V_2V(sycl_host_maxmag, s::cl_half, s::cl_half, s::cl_half)
780 
781 // minmag
782 __SYCL_EXPORT s::cl_float sycl_host_minmag(s::cl_float x,
783  s::cl_float y) __NOEXC {
784  return __minmag(x, y);
785 }
786 __SYCL_EXPORT s::cl_double sycl_host_minmag(s::cl_double x,
787  s::cl_double y) __NOEXC {
788  return __minmag(x, y);
789 }
790 __SYCL_EXPORT s::cl_half sycl_host_minmag(s::cl_half x, s::cl_half y) __NOEXC {
791  return __minmag(x, y);
792 }
793 MAKE_1V_2V(sycl_host_minmag, s::cl_float, s::cl_float, s::cl_float)
795 MAKE_1V_2V(sycl_host_minmag, s::cl_half, s::cl_half, s::cl_half)
796 
797 // modf
798 __SYCL_EXPORT s::cl_float sycl_host_modf(s::cl_float x,
800  return std::modf(x, iptr);
801 }
802 __SYCL_EXPORT s::cl_double sycl_host_modf(s::cl_double x,
804  return std::modf(x, iptr);
805 }
806 __SYCL_EXPORT s::cl_half sycl_host_modf(s::cl_half x,
808  float ptr_val_float = *iptr;
809  auto ret = std::modf(x, &ptr_val_float);
810  *iptr = ptr_val_float;
811  return ret;
812 }
815 MAKE_1V_2P(sycl_host_modf, s::cl_half, s::cl_half, s::cl_half)
816 
817 // nan
818 __SYCL_EXPORT s::cl_float sycl_host_nan(s::cl_uint nancode) __NOEXC {
819  (void)nancode;
820  return d::quiet_NaN<s::cl_float>();
821 }
822 __SYCL_EXPORT s::cl_double sycl_host_nan(s::cl_ulong nancode) __NOEXC {
823  (void)nancode;
824  return d::quiet_NaN<s::cl_double>();
825 }
826 __SYCL_EXPORT s::cl_half sycl_host_nan(s::cl_ushort nancode) __NOEXC {
827  (void)nancode;
828  return s::cl_half(d::quiet_NaN<s::cl_float>());
829 }
830 MAKE_1V(sycl_host_nan, s::cl_float, s::cl_uint)
831 MAKE_1V(sycl_host_nan, s::cl_double, s::cl_ulong)
832 MAKE_1V(sycl_host_nan, s::cl_half, s::cl_ushort)
833 
834 // pow
835 __SYCL_EXPORT s::cl_float sycl_host_pow(s::cl_float x, s::cl_float y) __NOEXC {
836  return std::pow(x, y);
837 }
838 __SYCL_EXPORT s::cl_double sycl_host_pow(s::cl_double x,
839  s::cl_double y) __NOEXC {
840  return std::pow(x, y);
841 }
842 __SYCL_EXPORT s::cl_half sycl_host_pow(s::cl_half x, s::cl_half y) __NOEXC {
843  return std::pow(x, y);
844 }
847 MAKE_1V_2V(sycl_host_pow, s::cl_half, s::cl_half, s::cl_half)
848 
849 // pown
850 __SYCL_EXPORT s::cl_float sycl_host_pown(s::cl_float x, s::cl_int y) __NOEXC {
851  return std::pow(x, y);
852 }
853 __SYCL_EXPORT s::cl_double sycl_host_pown(s::cl_double x, s::cl_int y) __NOEXC {
854  return std::pow(x, y);
855 }
856 __SYCL_EXPORT s::cl_half sycl_host_pown(s::cl_half x, s::cl_int y) __NOEXC {
857  return std::pow(x, y);
858 }
859 MAKE_1V_2V(sycl_host_pown, s::cl_float, s::cl_float, s::cl_int)
861 MAKE_1V_2V(sycl_host_pown, s::cl_half, s::cl_half, s::cl_int)
862 
863 // powr
864 __SYCL_EXPORT s::cl_float sycl_host_powr(s::cl_float x, s::cl_float y) __NOEXC {
865  return __powr(x, y);
866 }
867 __SYCL_EXPORT s::cl_double sycl_host_powr(s::cl_double x,
868  s::cl_double y) __NOEXC {
869  return __powr(x, y);
870 }
871 __SYCL_EXPORT s::cl_half sycl_host_powr(s::cl_half x, s::cl_half y) __NOEXC {
872  return __powr(x, y);
873 }
876 MAKE_1V_2V(sycl_host_powr, s::cl_half, s::cl_half, s::cl_half)
877 
878 // remainder
879 __SYCL_EXPORT s::cl_float sycl_host_remainder(s::cl_float x,
880  s::cl_float y) __NOEXC {
881  return std::remainder(x, y);
882 }
883 __SYCL_EXPORT s::cl_double sycl_host_remainder(s::cl_double x,
884  s::cl_double y) __NOEXC {
885  return std::remainder(x, y);
886 }
887 __SYCL_EXPORT s::cl_half sycl_host_remainder(s::cl_half x,
888  s::cl_half y) __NOEXC {
889  return std::remainder(x, y);
890 }
891 MAKE_1V_2V(sycl_host_remainder, s::cl_float, s::cl_float, s::cl_float)
892 MAKE_1V_2V(sycl_host_remainder, s::cl_double, s::cl_double, s::cl_double)
893 MAKE_1V_2V(sycl_host_remainder, s::cl_half, s::cl_half, s::cl_half)
894 
895 // remquo
896 __SYCL_EXPORT s::cl_float sycl_host_remquo(s::cl_float x, s::cl_float y,
897  s::cl_int *quo) __NOEXC {
898  s::cl_float rem = std::remainder(x, y);
899  *quo = static_cast<int>(std::round((x - rem) / y));
900  return rem;
901 }
902 __SYCL_EXPORT s::cl_double sycl_host_remquo(s::cl_double x, s::cl_double y,
903  s::cl_int *quo) __NOEXC {
904  s::cl_double rem = std::remainder(x, y);
905  *quo = static_cast<int>(std::round((x - rem) / y));
906  return rem;
907 }
908 __SYCL_EXPORT s::cl_half sycl_host_remquo(s::cl_half x, s::cl_half y,
909  s::cl_int *quo) __NOEXC {
910  s::cl_half rem = std::remainder(x, y);
911  *quo = static_cast<int>(std::round((x - rem) / y));
912  return rem;
913 }
915  s::cl_int)
917  s::cl_int)
919 
920 // rint
921 __SYCL_EXPORT s::cl_float sycl_host_rint(s::cl_float x) __NOEXC {
922  return std::rint(x);
923 }
924 __SYCL_EXPORT s::cl_double sycl_host_rint(s::cl_double x) __NOEXC {
925  return std::rint(x);
926 }
927 __SYCL_EXPORT s::cl_half sycl_host_rint(s::cl_half x) __NOEXC {
928  return std::rint(x);
929 }
930 MAKE_1V(sycl_host_rint, s::cl_float, s::cl_float)
931 MAKE_1V(sycl_host_rint, s::cl_double, s::cl_double)
932 MAKE_1V(sycl_host_rint, s::cl_half, s::cl_half)
933 
934 // rootn
935 __SYCL_EXPORT s::cl_float sycl_host_rootn(s::cl_float x, s::cl_int y) __NOEXC {
936  return __rootn(x, y);
937 }
938 __SYCL_EXPORT s::cl_double sycl_host_rootn(s::cl_double x,
939  s::cl_int y) __NOEXC {
940  return __rootn(x, y);
941 }
942 __SYCL_EXPORT s::cl_half sycl_host_rootn(s::cl_half x, s::cl_int y) __NOEXC {
943  return __rootn(x, y);
944 }
945 MAKE_1V_2V(sycl_host_rootn, s::cl_float, s::cl_float, s::cl_int)
946 MAKE_1V_2V(sycl_host_rootn, s::cl_double, s::cl_double, s::cl_int)
947 MAKE_1V_2V(sycl_host_rootn, s::cl_half, s::cl_half, s::cl_int)
948 
949 // round
950 __SYCL_EXPORT s::cl_float sycl_host_round(s::cl_float x) __NOEXC {
951  return std::round(x);
952 }
953 __SYCL_EXPORT s::cl_double sycl_host_round(s::cl_double x) __NOEXC {
954  return std::round(x);
955 }
956 __SYCL_EXPORT s::cl_half sycl_host_round(s::cl_half x) __NOEXC {
957  return std::round(x);
958 }
959 MAKE_1V(sycl_host_round, s::cl_float, s::cl_float)
960 MAKE_1V(sycl_host_round, s::cl_double, s::cl_double)
961 MAKE_1V(sycl_host_round, s::cl_half, s::cl_half)
962 
963 // rsqrt
964 __SYCL_EXPORT s::cl_float sycl_host_rsqrt(s::cl_float x) __NOEXC {
965  return __rsqrt(x);
966 }
967 __SYCL_EXPORT s::cl_double sycl_host_rsqrt(s::cl_double x) __NOEXC {
968  return __rsqrt(x);
969 }
970 __SYCL_EXPORT s::cl_half sycl_host_rsqrt(s::cl_half x) __NOEXC {
971  return __rsqrt(x);
972 }
973 MAKE_1V(sycl_host_rsqrt, s::cl_float, s::cl_float)
974 MAKE_1V(sycl_host_rsqrt, s::cl_double, s::cl_double)
975 MAKE_1V(sycl_host_rsqrt, s::cl_half, s::cl_half)
976 
977 // sin
978 __SYCL_EXPORT s::cl_float sycl_host_sin(s::cl_float x) __NOEXC {
979  return std::sin(x);
980 }
981 __SYCL_EXPORT s::cl_double sycl_host_sin(s::cl_double x) __NOEXC {
982  return std::sin(x);
983 }
984 __SYCL_EXPORT s::cl_half sycl_host_sin(s::cl_half x) __NOEXC {
985  return std::sin(x);
986 }
987 MAKE_1V(sycl_host_sin, s::cl_float, s::cl_float)
988 MAKE_1V(sycl_host_sin, s::cl_double, s::cl_double)
989 MAKE_1V(sycl_host_sin, s::cl_half, s::cl_half)
990 
991 // sincos
992 __SYCL_EXPORT s::cl_float sycl_host_sincos(s::cl_float x,
993  s::cl_float *cosval) __NOEXC {
994  return __sincos(x, cosval);
995 }
996 __SYCL_EXPORT s::cl_double sycl_host_sincos(s::cl_double x,
997  s::cl_double *cosval) __NOEXC {
998  return __sincos(x, cosval);
999 }
1000 __SYCL_EXPORT s::cl_half sycl_host_sincos(s::cl_half x,
1001  s::cl_half *cosval) __NOEXC {
1002  return __sincos(x, cosval);
1003 }
1004 MAKE_1V_2P(sycl_host_sincos, s::cl_float, s::cl_float, s::cl_float)
1005 MAKE_1V_2P(sycl_host_sincos, s::cl_double, s::cl_double, s::cl_double)
1006 MAKE_1V_2P(sycl_host_sincos, s::cl_half, s::cl_half, s::cl_half)
1007 
1008 // sinh
1009 __SYCL_EXPORT s::cl_float sycl_host_sinh(s::cl_float x) __NOEXC {
1010  return std::sinh(x);
1011 }
1012 __SYCL_EXPORT s::cl_double sycl_host_sinh(s::cl_double x) __NOEXC {
1013  return std::sinh(x);
1014 }
1015 __SYCL_EXPORT s::cl_half sycl_host_sinh(s::cl_half x) __NOEXC {
1016  return std::sinh(x);
1017 }
1018 MAKE_1V(sycl_host_sinh, s::cl_float, s::cl_float)
1019 MAKE_1V(sycl_host_sinh, s::cl_double, s::cl_double)
1020 MAKE_1V(sycl_host_sinh, s::cl_half, s::cl_half)
1021 
1022 // sinpi
1023 __SYCL_EXPORT s::cl_float sycl_host_sinpi(s::cl_float x) __NOEXC {
1024  return __sinpi(x);
1025 }
1026 __SYCL_EXPORT s::cl_double sycl_host_sinpi(s::cl_double x) __NOEXC {
1027  return __sinpi(x);
1028 }
1029 __SYCL_EXPORT s::cl_half sycl_host_sinpi(s::cl_half x) __NOEXC {
1030  return __sinpi(x);
1031 }
1032 MAKE_1V(sycl_host_sinpi, s::cl_float, s::cl_float)
1033 MAKE_1V(sycl_host_sinpi, s::cl_double, s::cl_double)
1034 MAKE_1V(sycl_host_sinpi, s::cl_half, s::cl_half)
1035 
1036 // sqrt
1037 __SYCL_EXPORT s::cl_float sycl_host_sqrt(s::cl_float x) __NOEXC {
1038  return std::sqrt(x);
1039 }
1040 __SYCL_EXPORT s::cl_double sycl_host_sqrt(s::cl_double x) __NOEXC {
1041  return std::sqrt(x);
1042 }
1043 __SYCL_EXPORT s::cl_half sycl_host_sqrt(s::cl_half x) __NOEXC {
1044  return std::sqrt(x);
1045 }
1046 MAKE_1V(sycl_host_sqrt, s::cl_float, s::cl_float)
1047 MAKE_1V(sycl_host_sqrt, s::cl_double, s::cl_double)
1048 MAKE_1V(sycl_host_sqrt, s::cl_half, s::cl_half)
1049 
1050 // tan
1051 __SYCL_EXPORT s::cl_float sycl_host_tan(s::cl_float x) __NOEXC {
1052  return std::tan(x);
1053 }
1054 __SYCL_EXPORT s::cl_double sycl_host_tan(s::cl_double x) __NOEXC {
1055  return std::tan(x);
1056 }
1057 __SYCL_EXPORT s::cl_half sycl_host_tan(s::cl_half x) __NOEXC {
1058  return std::tan(x);
1059 }
1060 MAKE_1V(sycl_host_tan, s::cl_float, s::cl_float)
1061 MAKE_1V(sycl_host_tan, s::cl_double, s::cl_double)
1062 MAKE_1V(sycl_host_tan, s::cl_half, s::cl_half)
1063 
1064 // tanh
1065 __SYCL_EXPORT s::cl_float sycl_host_tanh(s::cl_float x) __NOEXC {
1066  return std::tanh(x);
1067 }
1068 __SYCL_EXPORT s::cl_double sycl_host_tanh(s::cl_double x) __NOEXC {
1069  return std::tanh(x);
1070 }
1071 __SYCL_EXPORT s::cl_half sycl_host_tanh(s::cl_half x) __NOEXC {
1072  return std::tanh(x);
1073 }
1074 MAKE_1V(sycl_host_tanh, s::cl_float, s::cl_float)
1075 MAKE_1V(sycl_host_tanh, s::cl_double, s::cl_double)
1076 MAKE_1V(sycl_host_tanh, s::cl_half, s::cl_half)
1077 
1078 // tanpi
1079 __SYCL_EXPORT s::cl_float sycl_host_tanpi(s::cl_float x) __NOEXC {
1080  return __tanpi(x);
1081 }
1082 __SYCL_EXPORT s::cl_double sycl_host_tanpi(s::cl_double x) __NOEXC {
1083  return __tanpi(x);
1084 }
1085 __SYCL_EXPORT s::cl_half sycl_host_tanpi(s::cl_half x) __NOEXC {
1086  return __tanpi<float>(x);
1087 }
1088 MAKE_1V(sycl_host_tanpi, s::cl_float, s::cl_float)
1089 MAKE_1V(sycl_host_tanpi, s::cl_double, s::cl_double)
1090 MAKE_1V(sycl_host_tanpi, s::cl_half, s::cl_half)
1091 
1092 // tgamma
1093 __SYCL_EXPORT s::cl_float sycl_host_tgamma(s::cl_float x) __NOEXC {
1094  return std::tgamma(x);
1095 }
1096 __SYCL_EXPORT s::cl_double sycl_host_tgamma(s::cl_double x) __NOEXC {
1097  return std::tgamma(x);
1098 }
1099 __SYCL_EXPORT s::cl_half sycl_host_tgamma(s::cl_half x) __NOEXC {
1100  return std::tgamma(x);
1101 }
1102 MAKE_1V(sycl_host_tgamma, s::cl_float, s::cl_float)
1103 MAKE_1V(sycl_host_tgamma, s::cl_double, s::cl_double)
1104 MAKE_1V(sycl_host_tgamma, s::cl_half, s::cl_half)
1105 
1106 // trunc
1107 __SYCL_EXPORT s::cl_float sycl_host_trunc(s::cl_float x) __NOEXC {
1108  return std::trunc(x);
1109 }
1110 __SYCL_EXPORT s::cl_double sycl_host_trunc(s::cl_double x) __NOEXC {
1111  return std::trunc(x);
1112 }
1113 __SYCL_EXPORT s::cl_half sycl_host_trunc(s::cl_half x) __NOEXC {
1114  return std::trunc(x);
1115 }
1116 MAKE_1V(sycl_host_trunc, s::cl_float, s::cl_float)
1117 MAKE_1V(sycl_host_trunc, s::cl_double, s::cl_double)
1118 MAKE_1V(sycl_host_trunc, s::cl_half, s::cl_half)
1119 
1120 // --------------- 4.13.3 Native Math functions. Host implementations. ---------
1121 // native_cos
1122 __SYCL_EXPORT s::cl_float sycl_host_native_cos(s::cl_float x) __NOEXC {
1123  return std::cos(x);
1124 }
1125 MAKE_1V(sycl_host_native_cos, s::cl_float, s::cl_float)
1126 
1127 // native_divide
1128 __SYCL_EXPORT s::cl_float sycl_host_native_divide(s::cl_float x,
1129  s::cl_float y) __NOEXC {
1130  return x / y;
1131 }
1132 MAKE_1V_2V(sycl_host_native_divide, s::cl_float, s::cl_float, s::cl_float)
1133 
1134 // native_exp
1135 __SYCL_EXPORT s::cl_float sycl_host_native_exp(s::cl_float x) __NOEXC {
1136  return std::exp(x);
1137 }
1138 MAKE_1V(sycl_host_native_exp, s::cl_float, s::cl_float)
1139 
1140 // native_exp2
1141 __SYCL_EXPORT s::cl_float sycl_host_native_exp2(s::cl_float x) __NOEXC {
1142  return std::exp2(x);
1143 }
1144 MAKE_1V(sycl_host_native_exp2, s::cl_float, s::cl_float)
1145 
1146 // native_exp10
1147 __SYCL_EXPORT s::cl_float sycl_host_native_exp10(s::cl_float x) __NOEXC {
1148  return std::pow(10, x);
1149 }
1150 MAKE_1V(sycl_host_native_exp10, s::cl_float, s::cl_float)
1151 
1152 // native_log
1153 __SYCL_EXPORT s::cl_float sycl_host_native_log(s::cl_float x) __NOEXC {
1154  return std::log(x);
1155 }
1156 MAKE_1V(sycl_host_native_log, s::cl_float, s::cl_float)
1157 
1158 // native_log2
1159 __SYCL_EXPORT s::cl_float sycl_host_native_log2(s::cl_float x) __NOEXC {
1160  return std::log2(x);
1161 }
1162 MAKE_1V(sycl_host_native_log2, s::cl_float, s::cl_float)
1163 
1164 // native_log10
1165 __SYCL_EXPORT s::cl_float sycl_host_native_log10(s::cl_float x) __NOEXC {
1166  return std::log10(x);
1167 }
1168 MAKE_1V(sycl_host_native_log10, s::cl_float, s::cl_float)
1169 
1170 // native_powr
1171 __SYCL_EXPORT s::cl_float sycl_host_native_powr(s::cl_float x,
1172  s::cl_float y) __NOEXC {
1173  return (x >= 0 ? std::pow(x, y) : x);
1174 }
1175 MAKE_1V_2V(sycl_host_native_powr, s::cl_float, s::cl_float, s::cl_float)
1176 
1177 // native_recip
1178 __SYCL_EXPORT s::cl_float sycl_host_native_recip(s::cl_float x) __NOEXC {
1179  return 1.0 / x;
1180 }
1181 MAKE_1V(sycl_host_native_recip, s::cl_float, s::cl_float)
1182 
1183 // native_rsqrt
1184 __SYCL_EXPORT s::cl_float sycl_host_native_rsqrt(s::cl_float x) __NOEXC {
1185  return 1.0 / std::sqrt(x);
1186 }
1187 MAKE_1V(sycl_host_native_rsqrt, s::cl_float, s::cl_float)
1188 
1189 // native_sin
1190 __SYCL_EXPORT s::cl_float sycl_host_native_sin(s::cl_float x) __NOEXC {
1191  return std::sin(x);
1192 }
1193 MAKE_1V(sycl_host_native_sin, s::cl_float, s::cl_float)
1194 
1195 // native_sqrt
1196 __SYCL_EXPORT s::cl_float sycl_host_native_sqrt(s::cl_float x) __NOEXC {
1197  return std::sqrt(x);
1198 }
1199 MAKE_1V(sycl_host_native_sqrt, s::cl_float, s::cl_float)
1200 
1201 // native_tan
1202 __SYCL_EXPORT s::cl_float sycl_host_native_tan(s::cl_float x) __NOEXC {
1203  return std::tan(x);
1204 }
1205 MAKE_1V(sycl_host_native_tan, s::cl_float, s::cl_float)
1206 
1207 // ---------- 4.13.3 Half Precision Math functions. Host implementations. ------
1208 // half_cos
1209 __SYCL_EXPORT s::cl_float sycl_host_half_cos(s::cl_float x) __NOEXC {
1210  return std::cos(x);
1211 }
1212 MAKE_1V(sycl_host_half_cos, s::cl_float, s::cl_float)
1213 
1214 // half_divide
1215 __SYCL_EXPORT s::cl_float sycl_host_half_divide(s::cl_float x,
1216  s::cl_float y) __NOEXC {
1217  return x / y;
1218 }
1219 MAKE_1V_2V(sycl_host_half_divide, s::cl_float, s::cl_float, s::cl_float)
1220 
1221 // half_exp
1222 __SYCL_EXPORT s::cl_float sycl_host_half_exp(s::cl_float x) __NOEXC {
1223  return std::exp(x);
1224 }
1225 MAKE_1V(sycl_host_half_exp, s::cl_float, s::cl_float)
1226 // half_exp2
1227 __SYCL_EXPORT s::cl_float sycl_host_half_exp2(s::cl_float x) __NOEXC {
1228  return std::exp2(x);
1229 }
1230 MAKE_1V(sycl_host_half_exp2, s::cl_float, s::cl_float)
1231 
1232 // half_exp10
1233 __SYCL_EXPORT s::cl_float sycl_host_half_exp10(s::cl_float x) __NOEXC {
1234  return std::pow(10, x);
1235 }
1236 MAKE_1V(sycl_host_half_exp10, s::cl_float, s::cl_float)
1237 // half_log
1238 __SYCL_EXPORT s::cl_float sycl_host_half_log(s::cl_float x) __NOEXC {
1239  return std::log(x);
1240 }
1241 MAKE_1V(sycl_host_half_log, s::cl_float, s::cl_float)
1242 
1243 // half_log2
1244 __SYCL_EXPORT s::cl_float sycl_host_half_log2(s::cl_float x) __NOEXC {
1245  return std::log2(x);
1246 }
1247 MAKE_1V(sycl_host_half_log2, s::cl_float, s::cl_float)
1248 
1249 // half_log10
1250 __SYCL_EXPORT s::cl_float sycl_host_half_log10(s::cl_float x) __NOEXC {
1251  return std::log10(x);
1252 }
1253 MAKE_1V(sycl_host_half_log10, s::cl_float, s::cl_float)
1254 
1255 // half_powr
1256 __SYCL_EXPORT s::cl_float sycl_host_half_powr(s::cl_float x,
1257  s::cl_float y) __NOEXC {
1258  return (x >= 0 ? std::pow(x, y) : x);
1259 }
1260 MAKE_1V_2V(sycl_host_half_powr, s::cl_float, s::cl_float, s::cl_float)
1261 
1262 // half_recip
1263 __SYCL_EXPORT s::cl_float sycl_host_half_recip(s::cl_float x) __NOEXC {
1264  return 1.0 / x;
1265 }
1266 MAKE_1V(sycl_host_half_recip, s::cl_float, s::cl_float)
1267 
1268 // half_rsqrt
1269 __SYCL_EXPORT s::cl_float sycl_host_half_rsqrt(s::cl_float x) __NOEXC {
1270  return 1.0 / std::sqrt(x);
1271 }
1272 MAKE_1V(sycl_host_half_rsqrt, s::cl_float, s::cl_float)
1273 
1274 // half_sin
1275 __SYCL_EXPORT s::cl_float sycl_host_half_sin(s::cl_float x) __NOEXC {
1276  return std::sin(x);
1277 }
1278 MAKE_1V(sycl_host_half_sin, s::cl_float, s::cl_float)
1279 
1280 // half_sqrt
1281 __SYCL_EXPORT s::cl_float sycl_host_half_sqrt(s::cl_float x) __NOEXC {
1282  return std::sqrt(x);
1283 }
1284 MAKE_1V(sycl_host_half_sqrt, s::cl_float, s::cl_float)
1285 
1286 // half_tan
1287 __SYCL_EXPORT s::cl_float sycl_host_half_tan(s::cl_float x) __NOEXC {
1288  return std::tan(x);
1289 }
1290 MAKE_1V(sycl_host_half_tan, s::cl_float, s::cl_float)
1291 
1292 } // namespace __host_std
#define __NOEXC
#define MAKE_1V_2P(Fun, Ret, Arg1, Arg2)
#define MAKE_1V_2V_3P(Fun, Ret, Arg1, Arg2, Arg3)
#define MAKE_1V_2V(Fun, Ret, Arg1, Arg2)
#define MAKE_1V(Fun, Ret, Arg1)
s::cl_float sycl_host_fdim(s::cl_float x, s::cl_float y) __NOEXC
MAKE_1V_2V_3V(sycl_host_fclamp, s::cl_float, s::cl_float, s::cl_float, s::cl_float) MAKE_1V_2V_3V(sycl_host_fclamp
s::cl_float sycl_host_floor(s::cl_float x) __NOEXC
s::cl_float sycl_host_asinpi(s::cl_float x) __NOEXC
s::cl_float sycl_host_cbrt(s::cl_float x) __NOEXC
s::cl_float sycl_host_exp(s::cl_float x) __NOEXC
s::cl_float sycl_host_atanh(s::cl_float x) __NOEXC
s::cl_float sycl_host_cos(s::cl_float x) __NOEXC
s::cl_float sycl_host_atan2(s::cl_float x, s::cl_float y) __NOEXC
s::cl_float sycl_host_acosh(s::cl_float x) __NOEXC
s::cl_float sycl_host_erfc(s::cl_float x) __NOEXC
s::cl_float sycl_host_asinh(s::cl_float x) __NOEXC
s::cl_float sycl_host_ceil(s::cl_float x) __NOEXC
s::cl_float sycl_host_acospi(s::cl_float x) __NOEXC
s::cl_float sycl_host_cosh(s::cl_float x) __NOEXC
s::cl_float sycl_host_copysign(s::cl_float x, s::cl_float y) __NOEXC
s::cl_float sycl_host_atanpi(s::cl_float x) __NOEXC
s::cl_float sycl_host_fabs(s::cl_float x) __NOEXC
s::cl_float sycl_host_asin(s::cl_float x) __NOEXC
s::cl_float sycl_host_exp10(s::cl_float x) __NOEXC
s::cl_float sycl_host_exp2(s::cl_float x) __NOEXC
s::cl_float sycl_host_erf(s::cl_float x) __NOEXC
s::cl_float sycl_host_atan2pi(s::cl_float x, s::cl_float y) __NOEXC
s::cl_float sycl_host_acos(s::cl_float x) __NOEXC
s::cl_float sycl_host_cospi(s::cl_float x) __NOEXC
s::cl_float sycl_host_expm1(s::cl_float x) __NOEXC
s::cl_float sycl_host_fma(s::cl_float a, s::cl_float b, s::cl_float c) __NOEXC
s::cl_float sycl_host_atan(s::cl_float x) __NOEXC
T cast_if_host_half(T val)
Definition: half_type.hpp:586
std::uint64_t cl_ulong
Definition: aliases.hpp:137
std::int32_t cl_int
Definition: aliases.hpp:134
std::uint16_t cl_ushort
Definition: aliases.hpp:133
std::uint32_t cl_uint
Definition: aliases.hpp:135
std::enable_if_t< detail::is_svgenfloat_v< T >, T > tgamma(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > cbrt(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > logb(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > acos(T x)
std::enable_if_t< __FAST_MATH_GENFLOAT(T), T > log10(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > rint(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > ceil(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > acosh(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > fdim(T x, T y)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > asin(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > lgamma(T x)
std::enable_if_t< __FAST_MATH_GENFLOAT(T), T > log2(T x)
detail::common_rel_ret_t< T > signbit(T x)
std::enable_if_t< __FAST_MATH_GENFLOAT(T), T > sqrt(T x)
std::enable_if_t< __FAST_MATH_GENFLOAT(T), T > tan(T x)
ESIMD_NODEBUG ESIMD_INLINE sycl::ext::intel::esimd::simd< float, SZ > log(sycl::ext::intel::esimd::simd< float, SZ > x) __NOEXC
__SYCL_ALWAYS_INLINE std::enable_if_t< detail::is_sgenfloat_v< T >, marray< T, N > > ldexp(marray< T, N > x, marray< int, N > k)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > expm1(T x)
detail::common_rel_ret_t< T > isnan(T x)
y y maxval[j] maxval c
std::enable_if_t< detail::is_svgenfloat_v< T >, T > pow(T x, T y)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > cosh(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > fabs(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > erf(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > erfc(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > tanh(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > floor(T x)
ESIMD_NODEBUG ESIMD_INLINE sycl::ext::intel::esimd::simd< float, SZ > sin(sycl::ext::intel::esimd::simd< float, SZ > x) __NOEXC
std::enable_if_t< detail::is_svgenfloat_v< T >, T > asinh(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > remainder(T x, T y)
ESIMD_NODEBUG ESIMD_INLINE sycl::ext::intel::esimd::simd< float, SZ > cos(sycl::ext::intel::esimd::simd< float, SZ > x) __NOEXC
std::enable_if_t< detail::is_svgenfloat_v< T >, T > atanh(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > hypot(T x, T y)
std::enable_if_t< detail::is_svgenfloat_v< T > &&detail::is_genintptr_v< T2 >, T > frexp(T x, T2 exp)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > log1p(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > sinh(T x)
std::enable_if_t< detail::is_svgenfloat_v< T > &&detail::is_genfloatptr_v< T2 >, T > modf(T x, T2 iptr)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > fmod(T x, T y)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > copysign(T x, T y)
__SYCL_ALWAYS_INLINE std::enable_if_t< detail::is_sgenfloat_v< T >, marray< int, N > > ilogb(marray< T, N > x)
std::enable_if_t< __FAST_MATH_GENFLOAT(T), T > exp2(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > atan(T y_over_x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > atan2(T y, T x)
std::enable_if_t< detail::is_ugeninteger_v< T >, T > abs(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > trunc(T x)
std::enable_if_t< detail::is_svgenfloat_v< T >, T > round(T x)
Definition: access.hpp:18