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) { return std::cos(M_PI * x); }
40 
41 template <typename T> T inline __fract(T x, T *iptr) {
42  T f = std::floor(x);
43  *(iptr) = f;
44  return std::fmin(x - f, std::nextafter(T(1.0), T(0.0)));
45 }
46 
47 template <typename T> inline T __lgamma_r(T x, s::cl_int *signp) {
48  T g = std::tgamma(x);
49  *signp = std::signbit(d::cast_if_host_half(g)) ? -1 : 1;
50  return std::log(std::abs(g));
51 }
52 
53 template <typename T> inline T __mad(T a, T b, T c) { return (a * b) + c; }
54 
55 template <typename T> inline T __maxmag(T x, T y) {
56  if (std::fabs(x) > std::fabs(y))
57  return x;
58  if (std::fabs(y) > std::fabs(x))
59  return y;
60  return std::fmax(x, y);
61 }
62 
63 template <typename T> inline T __minmag(T x, T y) {
64  if (std::fabs(x) < std::fabs(y))
65  return x;
66  if (std::fabs(y) < std::fabs(x))
67  return y;
68  return std::fmin(x, y);
69 }
70 
71 template <typename T> inline T __powr(T x, T y) {
72  return (x >= T(0)) ? T(std::pow(x, y)) : x;
73 }
74 
75 template <typename T> inline T __rootn(T x, s::cl_int y) {
76  return std::pow(x, T(1.0) / y);
77 }
78 
79 template <typename T> inline T __rsqrt(T x) { return T(1.0) / std::sqrt(x); }
80 
81 template <typename T> inline T __sincos(T x, T *cosval) {
82  (*cosval) = std::cos(x);
83  return std::sin(x);
84 }
85 
86 template <typename T> inline T __sinpi(T x) { return std::sin(M_PI * x); }
87 
88 template <typename T> inline T __tanpi(T x) { return std::tan(M_PI * x); }
89 
90 } // namespace
91 
92 // ----------------- 4.13.3 Math functions. Host implementations ---------------
93 // acos
95  return std::acos(x);
96 }
98  return std::acos(x);
99 }
101  return std::acos(x);
102 }
106 
107 // acosh
109  return std::acosh(x);
110 }
112  return std::acosh(x);
113 }
115  return std::acosh(x);
116 }
120 
121 // acospi
123  return __acospi(x);
124 }
126  return __acospi(x);
127 }
129  return __acospi(x);
130 }
134 
135 // asin
137  return std::asin(x);
138 }
140  return std::asin(x);
141 }
143  return std::asin(x);
144 }
148 
149 // asinh
151  return std::asinh(x);
152 }
154  return std::asinh(x);
155 }
157  return std::asinh(x);
158 }
162 
163 // asinpi
165  return __asinpi(x);
166 }
168  return __asinpi(x);
169 }
171  return __asinpi(x);
172 }
176 
177 // atan
179  return std::atan(x);
180 }
182  return std::atan(x);
183 }
185  return std::atan(x);
186 }
190 
191 // atan2
192 __SYCL_EXPORT s::cl_float sycl_host_atan2(s::cl_float x,
193  s::cl_float y) __NOEXC {
194  return std::atan2(x, y);
195 }
197  s::cl_double y) __NOEXC {
198  return std::atan2(x, y);
199 }
201  return std::atan2(x, y);
202 }
206 
207 // atanh
209  return std::atanh(x);
210 }
212  return std::atanh(x);
213 }
215  return std::atanh(x);
216 }
220 
221 // atanpi
223  return __atanpi(x);
224 }
226  return __atanpi(x);
227 }
229  return __atanpi(x);
230 }
234 
235 // atan2pi
237  s::cl_float y) __NOEXC {
238  return __atan2pi(x, y);
239 }
241  s::cl_double y) __NOEXC {
242  return __atan2pi(x, y);
243 }
245  return __atan2pi(x, y);
246 }
250 
251 // cbrt
253  return std::cbrt(x);
254 }
256  return std::cbrt(x);
257 }
259  return std::cbrt(x);
260 }
264 
265 // ceil
267  return std::ceil(x);
268 }
270  return std::ceil(x);
271 }
273  return std::ceil(x);
274 }
278 
279 // copysign
281  s::cl_float y) __NOEXC {
282  return std::copysign(x, y);
283 }
285  s::cl_double y) __NOEXC {
286  return std::copysign(x, y);
287 }
289  s::cl_half y) __NOEXC {
290  return std::copysign(x, y);
291 }
295 
296 // cos
297 __SYCL_EXPORT s::cl_float sycl_host_cos(s::cl_float x) __NOEXC {
298  return std::cos(x);
299 }
301  return std::cos(x);
302 }
304  return std::cos(x);
305 }
309 
310 // cosh
312  return std::cosh(x);
313 }
315  return std::cosh(x);
316 }
318  return std::cosh(x);
319 }
323 
324 // cospi
326  return __cospi(x);
327 }
329  return __cospi(x);
330 }
332  return __cospi(x);
333 }
337 
338 // erfc
340  return std::erfc(x);
341 }
343  return std::erfc(x);
344 }
346  return std::erfc(x);
347 }
351 
352 // erf
353 __SYCL_EXPORT s::cl_float sycl_host_erf(s::cl_float x) __NOEXC {
354  return std::erf(x);
355 }
357  return std::erf(x);
358 }
360  return std::erf(x);
361 }
365 
366 // exp
367 __SYCL_EXPORT s::cl_float sycl_host_exp(s::cl_float x) __NOEXC {
368  return std::exp(x);
369 }
371  return std::exp(x);
372 }
374  return std::exp(x);
375 }
379 
380 // exp2
382  return std::exp2(x);
383 }
385  return std::exp2(x);
386 }
388  return std::exp2(x);
389 }
393 
394 // exp10
396  return std::pow(10, x);
397 }
399  return std::pow(10, x);
400 }
402  return std::pow(10, x);
403 }
407 
408 // expm1
410  return std::expm1(x);
411 }
413  return std::expm1(x);
414 }
416  return std::expm1(x);
417 }
421 
422 // fabs
424  return std::fabs(x);
425 }
427  return std::fabs(x);
428 }
430  return std::fabs(x);
431 }
435 
436 // fdim
438  return std::fdim(x, y);
439 }
441  s::cl_double y) __NOEXC {
442  return std::fdim(x, y);
443 }
445  return std::fdim(x, y);
446 }
450 
451 // floor
453  return std::floor(x);
454 }
456  return std::floor(x);
457 }
459  return std::floor(x);
460 }
464 
465 // fma
466 __SYCL_EXPORT s::cl_float sycl_host_fma(s::cl_float a, s::cl_float b,
467  s::cl_float c) __NOEXC {
468  return std::fma(a, b, c);
469 }
471  s::cl_double c) __NOEXC {
472  return std::fma(a, b, c);
473 }
475  s::cl_half c) __NOEXC {
476  return std::fma(a, b, c);
477 }
480  s::cl_double)
482 
483 // fmax
484 __SYCL_EXPORT s::cl_float sycl_host_fmax(s::cl_float x, s::cl_float y) __NOEXC {
485  return std::fmax(x, y);
486 }
487 __SYCL_EXPORT s::cl_double sycl_host_fmax(s::cl_double x,
488  s::cl_double y) __NOEXC {
489  return std::fmax(x, y);
490 }
491 __SYCL_EXPORT s::cl_half sycl_host_fmax(s::cl_half x, s::cl_half y) __NOEXC {
492  return std::fmax(x, y);
493 }
496 MAKE_1V_2V(sycl_host_fmax, s::cl_half, s::cl_half, s::cl_half)
497 
498 // fmin
499 __SYCL_EXPORT s::cl_float sycl_host_fmin(s::cl_float x, s::cl_float y) __NOEXC {
500  return std::fmin(x, y);
501 }
502 __SYCL_EXPORT s::cl_double sycl_host_fmin(s::cl_double x,
503  s::cl_double y) __NOEXC {
504  return std::fmin(x, y);
505 }
506 __SYCL_EXPORT s::cl_half sycl_host_fmin(s::cl_half x, s::cl_half y) __NOEXC {
507  return std::fmin(x, y);
508 }
511 MAKE_1V_2V(sycl_host_fmin, s::cl_half, s::cl_half, s::cl_half)
512 
513 // fmod
514 __SYCL_EXPORT s::cl_float sycl_host_fmod(s::cl_float x, s::cl_float y) __NOEXC {
515  return std::fmod(x, y);
516 }
517 __SYCL_EXPORT s::cl_double sycl_host_fmod(s::cl_double x,
518  s::cl_double y) __NOEXC {
519  return std::fmod(x, y);
520 }
521 __SYCL_EXPORT s::cl_half sycl_host_fmod(s::cl_half x, s::cl_half y) __NOEXC {
522  return std::fmod(x, y);
523 }
526 MAKE_1V_2V(sycl_host_fmod, s::cl_half, s::cl_half, s::cl_half)
527 
528 // nextafter
529 __SYCL_EXPORT s::cl_float sycl_host_nextafter(s::cl_float x,
530  s::cl_float y) __NOEXC {
531  return std::nextafter(x, y);
532 }
533 __SYCL_EXPORT s::cl_double sycl_host_nextafter(s::cl_double x,
534  s::cl_double y) __NOEXC {
535  return std::nextafter(x, y);
536 }
537 __SYCL_EXPORT s::cl_half sycl_host_nextafter(s::cl_half x,
538  s::cl_half y) __NOEXC {
539  return std::nextafter(x, y);
540 }
541 MAKE_1V_2V(sycl_host_nextafter, s::cl_float, s::cl_float, s::cl_float)
542 MAKE_1V_2V(sycl_host_nextafter, s::cl_double, s::cl_double, s::cl_double)
543 MAKE_1V_2V(sycl_host_nextafter, s::cl_half, s::cl_half, s::cl_half)
544 
545 // fract
546 __SYCL_EXPORT s::cl_float sycl_host_fract(s::cl_float x,
547  s::cl_float *iptr) __NOEXC {
548  return __fract(x, iptr);
549 }
550 __SYCL_EXPORT s::cl_double sycl_host_fract(s::cl_double x,
551  s::cl_double *iptr) __NOEXC {
552  return __fract(x, iptr);
553 }
554 __SYCL_EXPORT s::cl_half sycl_host_fract(s::cl_half x,
555  s::cl_half *iptr) __NOEXC {
556  return __fract(x, iptr);
557 }
558 MAKE_1V_2P(sycl_host_fract, s::cl_float, s::cl_float, s::cl_float)
560 MAKE_1V_2P(sycl_host_fract, s::cl_half, s::cl_half, s::cl_half)
561 
562 // frexp
563 __SYCL_EXPORT s::cl_float sycl_host_frexp(s::cl_float x,
564  s::cl_int *exp) __NOEXC {
565  return std::frexp(x, exp);
566 }
567 __SYCL_EXPORT s::cl_double sycl_host_frexp(s::cl_double x,
568  s::cl_int *exp) __NOEXC {
569  return std::frexp(x, exp);
570 }
571 __SYCL_EXPORT s::cl_half sycl_host_frexp(s::cl_half x, s::cl_int *exp) __NOEXC {
572  return std::frexp(x, exp);
573 }
574 MAKE_1V_2P(sycl_host_frexp, s::cl_float, s::cl_float, s::cl_int)
575 MAKE_1V_2P(sycl_host_frexp, s::cl_double, s::cl_double, s::cl_int)
576 MAKE_1V_2P(sycl_host_frexp, s::cl_half, s::cl_half, s::cl_int)
577 
578 // hypot
579 __SYCL_EXPORT s::cl_float sycl_host_hypot(s::cl_float x,
580  s::cl_float y) __NOEXC {
581  return std::hypot(x, y);
582 }
583 __SYCL_EXPORT s::cl_double sycl_host_hypot(s::cl_double x,
584  s::cl_double y) __NOEXC {
585  return std::hypot(x, y);
586 }
587 __SYCL_EXPORT s::cl_half sycl_host_hypot(s::cl_half x, s::cl_half y) __NOEXC {
588  return std::hypot(x, y);
589 }
590 MAKE_1V_2V(sycl_host_hypot, s::cl_float, s::cl_float, s::cl_float)
592 MAKE_1V_2V(sycl_host_hypot, s::cl_half, s::cl_half, s::cl_half)
593 
594 // ilogb
595 __SYCL_EXPORT s::cl_int sycl_host_ilogb(s::cl_float x) __NOEXC {
596  return std::ilogb(x);
597 }
598 __SYCL_EXPORT s::cl_int sycl_host_ilogb(s::cl_double x) __NOEXC {
599  return std::ilogb(x);
600 }
601 __SYCL_EXPORT s::cl_int sycl_host_ilogb(s::cl_half x) __NOEXC {
602  return std::ilogb(x);
603 }
604 MAKE_1V(sycl_host_ilogb, s::cl_int, s::cl_float)
605 MAKE_1V(sycl_host_ilogb, s::cl_int, s::cl_double)
606 MAKE_1V(sycl_host_ilogb, s::cl_int, s::cl_half)
607 
608 // ldexp
609 __SYCL_EXPORT s::cl_float sycl_host_ldexp(s::cl_float x, s::cl_int k) __NOEXC {
610  return std::ldexp(x, k);
611 }
612 __SYCL_EXPORT s::cl_double sycl_host_ldexp(s::cl_double x,
613  s::cl_int k) __NOEXC {
614  return std::ldexp(x, k);
615 }
616 __SYCL_EXPORT s::cl_half sycl_host_ldexp(s::cl_half x, s::cl_int k) __NOEXC {
617  return std::ldexp(x, k);
618 }
619 MAKE_1V_2V(sycl_host_ldexp, s::cl_float, s::cl_float, s::cl_int)
620 MAKE_1V_2V(sycl_host_ldexp, s::cl_double, s::cl_double, s::cl_int)
621 MAKE_1V_2V(sycl_host_ldexp, s::cl_half, s::cl_half, s::cl_int)
622 
623 // lgamma
624 __SYCL_EXPORT s::cl_float sycl_host_lgamma(s::cl_float x) __NOEXC {
625  return std::lgamma(x);
626 }
627 __SYCL_EXPORT s::cl_double sycl_host_lgamma(s::cl_double x) __NOEXC {
628  return std::lgamma(x);
629 }
630 __SYCL_EXPORT s::cl_half sycl_host_lgamma(s::cl_half x) __NOEXC {
631  return std::lgamma(x);
632 }
633 MAKE_1V(sycl_host_lgamma, s::cl_float, s::cl_float)
634 MAKE_1V(sycl_host_lgamma, s::cl_double, s::cl_double)
635 MAKE_1V(sycl_host_lgamma, s::cl_half, s::cl_half)
636 
637 // lgamma_r
638 __SYCL_EXPORT s::cl_float sycl_host_lgamma_r(s::cl_float x,
639  s::cl_int *signp) __NOEXC {
640  return __lgamma_r(x, signp);
641 }
642 __SYCL_EXPORT s::cl_double sycl_host_lgamma_r(s::cl_double x,
643  s::cl_int *signp) __NOEXC {
644  return __lgamma_r(x, signp);
645 }
646 __SYCL_EXPORT s::cl_half sycl_host_lgamma_r(s::cl_half x,
647  s::cl_int *signp) __NOEXC {
648  return __lgamma_r(x, signp);
649 }
650 MAKE_1V_2P(sycl_host_lgamma_r, s::cl_float, s::cl_float, s::cl_int)
651 MAKE_1V_2P(sycl_host_lgamma_r, s::cl_double, s::cl_double, s::cl_int)
652 MAKE_1V_2P(sycl_host_lgamma_r, s::cl_half, s::cl_half, s::cl_int)
653 
654 // log
655 __SYCL_EXPORT s::cl_float sycl_host_log(s::cl_float x) __NOEXC {
656  return std::log(x);
657 }
658 __SYCL_EXPORT s::cl_double sycl_host_log(s::cl_double x) __NOEXC {
659  return std::log(x);
660 }
661 __SYCL_EXPORT s::cl_half sycl_host_log(s::cl_half x) __NOEXC {
662  return std::log(x);
663 }
664 MAKE_1V(sycl_host_log, s::cl_float, s::cl_float)
665 MAKE_1V(sycl_host_log, s::cl_double, s::cl_double)
666 MAKE_1V(sycl_host_log, s::cl_half, s::cl_half)
667 
668 // log2
669 __SYCL_EXPORT s::cl_float sycl_host_log2(s::cl_float x) __NOEXC {
670  return std::log2(x);
671 }
672 __SYCL_EXPORT s::cl_double sycl_host_log2(s::cl_double x) __NOEXC {
673  return std::log2(x);
674 }
675 __SYCL_EXPORT s::cl_half sycl_host_log2(s::cl_half x) __NOEXC {
676  return std::log2(x);
677 }
678 MAKE_1V(sycl_host_log2, s::cl_float, s::cl_float)
679 MAKE_1V(sycl_host_log2, s::cl_double, s::cl_double)
680 MAKE_1V(sycl_host_log2, s::cl_half, s::cl_half)
681 
682 // log10
683 __SYCL_EXPORT s::cl_float sycl_host_log10(s::cl_float x) __NOEXC {
684  return std::log10(x);
685 }
686 __SYCL_EXPORT s::cl_double sycl_host_log10(s::cl_double x) __NOEXC {
687  return std::log10(x);
688 }
689 __SYCL_EXPORT s::cl_half sycl_host_log10(s::cl_half x) __NOEXC {
690  return std::log10(x);
691 }
692 MAKE_1V(sycl_host_log10, s::cl_float, s::cl_float)
693 MAKE_1V(sycl_host_log10, s::cl_double, s::cl_double)
694 MAKE_1V(sycl_host_log10, s::cl_half, s::cl_half)
695 
696 // log1p
697 __SYCL_EXPORT s::cl_float sycl_host_log1p(s::cl_float x) __NOEXC {
698  return std::log1p(x);
699 }
700 __SYCL_EXPORT s::cl_double sycl_host_log1p(s::cl_double x) __NOEXC {
701  return std::log1p(x);
702 }
703 __SYCL_EXPORT s::cl_half sycl_host_log1p(s::cl_half x) __NOEXC {
704  return std::log1p(x);
705 }
706 MAKE_1V(sycl_host_log1p, s::cl_float, s::cl_float)
707 MAKE_1V(sycl_host_log1p, s::cl_double, s::cl_double)
708 MAKE_1V(sycl_host_log1p, s::cl_half, s::cl_half)
709 
710 // logb
711 __SYCL_EXPORT s::cl_float sycl_host_logb(s::cl_float x) __NOEXC {
712  return std::logb(x);
713 }
714 __SYCL_EXPORT s::cl_double sycl_host_logb(s::cl_double x) __NOEXC {
715  return std::logb(x);
716 }
717 __SYCL_EXPORT s::cl_half sycl_host_logb(s::cl_half x) __NOEXC {
718  return std::logb(x);
719 }
720 MAKE_1V(sycl_host_logb, s::cl_float, s::cl_float)
721 MAKE_1V(sycl_host_logb, s::cl_double, s::cl_double)
722 MAKE_1V(sycl_host_logb, s::cl_half, s::cl_half)
723 
724 // mad
725 __SYCL_EXPORT s::cl_float sycl_host_mad(s::cl_float a, s::cl_float b,
726  s::cl_float c) __NOEXC {
727  return __mad(a, b, c);
728 }
729 __SYCL_EXPORT s::cl_double sycl_host_mad(s::cl_double a, s::cl_double b,
730  s::cl_double c) __NOEXC {
731  return __mad(a, b, c);
732 }
733 __SYCL_EXPORT s::cl_half sycl_host_mad(s::cl_half a, s::cl_half b,
734  s::cl_half c) __NOEXC {
735  return __mad(a, b, c);
736 }
739  s::cl_double)
741 
742 // maxmag
743 __SYCL_EXPORT s::cl_float sycl_host_maxmag(s::cl_float x,
744  s::cl_float y) __NOEXC {
745  return __maxmag(x, y);
746 }
747 __SYCL_EXPORT s::cl_double sycl_host_maxmag(s::cl_double x,
748  s::cl_double y) __NOEXC {
749  return __maxmag(x, y);
750 }
751 __SYCL_EXPORT s::cl_half sycl_host_maxmag(s::cl_half x, s::cl_half y) __NOEXC {
752  return __maxmag(x, y);
753 }
754 MAKE_1V_2V(sycl_host_maxmag, s::cl_float, s::cl_float, s::cl_float)
756 MAKE_1V_2V(sycl_host_maxmag, s::cl_half, s::cl_half, s::cl_half)
757 
758 // minmag
759 __SYCL_EXPORT s::cl_float sycl_host_minmag(s::cl_float x,
760  s::cl_float y) __NOEXC {
761  return __minmag(x, y);
762 }
763 __SYCL_EXPORT s::cl_double sycl_host_minmag(s::cl_double x,
764  s::cl_double y) __NOEXC {
765  return __minmag(x, y);
766 }
767 __SYCL_EXPORT s::cl_half sycl_host_minmag(s::cl_half x, s::cl_half y) __NOEXC {
768  return __minmag(x, y);
769 }
770 MAKE_1V_2V(sycl_host_minmag, s::cl_float, s::cl_float, s::cl_float)
772 MAKE_1V_2V(sycl_host_minmag, s::cl_half, s::cl_half, s::cl_half)
773 
774 // modf
775 __SYCL_EXPORT s::cl_float sycl_host_modf(s::cl_float x,
776  s::cl_float *iptr) __NOEXC {
777  return std::modf(x, iptr);
778 }
779 __SYCL_EXPORT s::cl_double sycl_host_modf(s::cl_double x,
780  s::cl_double *iptr) __NOEXC {
781  return std::modf(x, iptr);
782 }
783 __SYCL_EXPORT s::cl_half sycl_host_modf(s::cl_half x,
784  s::cl_half *iptr) __NOEXC {
785  return std::modf(x, reinterpret_cast<s::cl_float *>(iptr));
786 }
789 MAKE_1V_2P(sycl_host_modf, s::cl_half, s::cl_half, s::cl_half)
790 
791 // nan
792 __SYCL_EXPORT s::cl_float sycl_host_nan(s::cl_uint nancode) __NOEXC {
793  (void)nancode;
794  return d::quiet_NaN<s::cl_float>();
795 }
796 __SYCL_EXPORT s::cl_double sycl_host_nan(s::cl_ulong nancode) __NOEXC {
797  (void)nancode;
798  return d::quiet_NaN<s::cl_double>();
799 }
800 __SYCL_EXPORT s::cl_half sycl_host_nan(s::cl_ushort nancode) __NOEXC {
801  (void)nancode;
802  return s::cl_half(d::quiet_NaN<s::cl_float>());
803 }
804 MAKE_1V(sycl_host_nan, s::cl_float, s::cl_uint)
805 MAKE_1V(sycl_host_nan, s::cl_double, s::cl_ulong)
806 MAKE_1V(sycl_host_nan, s::cl_half, s::cl_ushort)
807 
808 // pow
809 __SYCL_EXPORT s::cl_float sycl_host_pow(s::cl_float x, s::cl_float y) __NOEXC {
810  return std::pow(x, y);
811 }
812 __SYCL_EXPORT s::cl_double sycl_host_pow(s::cl_double x,
813  s::cl_double y) __NOEXC {
814  return std::pow(x, y);
815 }
816 __SYCL_EXPORT s::cl_half sycl_host_pow(s::cl_half x, s::cl_half y) __NOEXC {
817  return std::pow(x, y);
818 }
821 MAKE_1V_2V(sycl_host_pow, s::cl_half, s::cl_half, s::cl_half)
822 
823 // pown
824 __SYCL_EXPORT s::cl_float sycl_host_pown(s::cl_float x, s::cl_int y) __NOEXC {
825  return std::pow(x, y);
826 }
827 __SYCL_EXPORT s::cl_double sycl_host_pown(s::cl_double x, s::cl_int y) __NOEXC {
828  return std::pow(x, y);
829 }
830 __SYCL_EXPORT s::cl_half sycl_host_pown(s::cl_half x, s::cl_int y) __NOEXC {
831  return std::pow(x, y);
832 }
833 MAKE_1V_2V(sycl_host_pown, s::cl_float, s::cl_float, s::cl_int)
835 MAKE_1V_2V(sycl_host_pown, s::cl_half, s::cl_half, s::cl_int)
836 
837 // powr
838 __SYCL_EXPORT s::cl_float sycl_host_powr(s::cl_float x, s::cl_float y) __NOEXC {
839  return __powr(x, y);
840 }
841 __SYCL_EXPORT s::cl_double sycl_host_powr(s::cl_double x,
842  s::cl_double y) __NOEXC {
843  return __powr(x, y);
844 }
845 __SYCL_EXPORT s::cl_half sycl_host_powr(s::cl_half x, s::cl_half y) __NOEXC {
846  return __powr(x, y);
847 }
850 MAKE_1V_2V(sycl_host_powr, s::cl_half, s::cl_half, s::cl_half)
851 
852 // remainder
853 __SYCL_EXPORT s::cl_float sycl_host_remainder(s::cl_float x,
854  s::cl_float y) __NOEXC {
855  return std::remainder(x, y);
856 }
857 __SYCL_EXPORT s::cl_double sycl_host_remainder(s::cl_double x,
858  s::cl_double y) __NOEXC {
859  return std::remainder(x, y);
860 }
861 __SYCL_EXPORT s::cl_half sycl_host_remainder(s::cl_half x,
862  s::cl_half y) __NOEXC {
863  return std::remainder(x, y);
864 }
865 MAKE_1V_2V(sycl_host_remainder, s::cl_float, s::cl_float, s::cl_float)
866 MAKE_1V_2V(sycl_host_remainder, s::cl_double, s::cl_double, s::cl_double)
867 MAKE_1V_2V(sycl_host_remainder, s::cl_half, s::cl_half, s::cl_half)
868 
869 // remquo
870 __SYCL_EXPORT s::cl_float sycl_host_remquo(s::cl_float x, s::cl_float y,
871  s::cl_int *quo) __NOEXC {
872  return std::remquo(x, y, quo);
873 }
874 __SYCL_EXPORT s::cl_double sycl_host_remquo(s::cl_double x, s::cl_double y,
875  s::cl_int *quo) __NOEXC {
876  return std::remquo(x, y, quo);
877 }
878 __SYCL_EXPORT s::cl_half sycl_host_remquo(s::cl_half x, s::cl_half y,
879  s::cl_int *quo) __NOEXC {
880  return std::remquo(x, y, quo);
881 }
883  s::cl_int)
885  s::cl_int)
887 
888 // rint
889 __SYCL_EXPORT s::cl_float sycl_host_rint(s::cl_float x) __NOEXC {
890  return std::rint(x);
891 }
892 __SYCL_EXPORT s::cl_double sycl_host_rint(s::cl_double x) __NOEXC {
893  return std::rint(x);
894 }
895 __SYCL_EXPORT s::cl_half sycl_host_rint(s::cl_half x) __NOEXC {
896  return std::rint(x);
897 }
898 MAKE_1V(sycl_host_rint, s::cl_float, s::cl_float)
899 MAKE_1V(sycl_host_rint, s::cl_double, s::cl_double)
900 MAKE_1V(sycl_host_rint, s::cl_half, s::cl_half)
901 
902 // rootn
903 __SYCL_EXPORT s::cl_float sycl_host_rootn(s::cl_float x, s::cl_int y) __NOEXC {
904  return __rootn(x, y);
905 }
906 __SYCL_EXPORT s::cl_double sycl_host_rootn(s::cl_double x,
907  s::cl_int y) __NOEXC {
908  return __rootn(x, y);
909 }
910 __SYCL_EXPORT s::cl_half sycl_host_rootn(s::cl_half x, s::cl_int y) __NOEXC {
911  return __rootn(x, y);
912 }
913 MAKE_1V_2V(sycl_host_rootn, s::cl_float, s::cl_float, s::cl_int)
914 MAKE_1V_2V(sycl_host_rootn, s::cl_double, s::cl_double, s::cl_int)
915 MAKE_1V_2V(sycl_host_rootn, s::cl_half, s::cl_half, s::cl_int)
916 
917 // round
918 __SYCL_EXPORT s::cl_float sycl_host_round(s::cl_float x) __NOEXC {
919  return std::round(x);
920 }
921 __SYCL_EXPORT s::cl_double sycl_host_round(s::cl_double x) __NOEXC {
922  return std::round(x);
923 }
924 __SYCL_EXPORT s::cl_half sycl_host_round(s::cl_half x) __NOEXC {
925  return std::round(x);
926 }
927 MAKE_1V(sycl_host_round, s::cl_float, s::cl_float)
928 MAKE_1V(sycl_host_round, s::cl_double, s::cl_double)
929 MAKE_1V(sycl_host_round, s::cl_half, s::cl_half)
930 
931 // rsqrt
932 __SYCL_EXPORT s::cl_float sycl_host_rsqrt(s::cl_float x) __NOEXC {
933  return __rsqrt(x);
934 }
935 __SYCL_EXPORT s::cl_double sycl_host_rsqrt(s::cl_double x) __NOEXC {
936  return __rsqrt(x);
937 }
938 __SYCL_EXPORT s::cl_half sycl_host_rsqrt(s::cl_half x) __NOEXC {
939  return __rsqrt(x);
940 }
941 MAKE_1V(sycl_host_rsqrt, s::cl_float, s::cl_float)
942 MAKE_1V(sycl_host_rsqrt, s::cl_double, s::cl_double)
943 MAKE_1V(sycl_host_rsqrt, s::cl_half, s::cl_half)
944 
945 // sin
946 __SYCL_EXPORT s::cl_float sycl_host_sin(s::cl_float x) __NOEXC {
947  return std::sin(x);
948 }
949 __SYCL_EXPORT s::cl_double sycl_host_sin(s::cl_double x) __NOEXC {
950  return std::sin(x);
951 }
952 __SYCL_EXPORT s::cl_half sycl_host_sin(s::cl_half x) __NOEXC {
953  return std::sin(x);
954 }
955 MAKE_1V(sycl_host_sin, s::cl_float, s::cl_float)
956 MAKE_1V(sycl_host_sin, s::cl_double, s::cl_double)
957 MAKE_1V(sycl_host_sin, s::cl_half, s::cl_half)
958 
959 // sincos
960 __SYCL_EXPORT s::cl_float sycl_host_sincos(s::cl_float x,
961  s::cl_float *cosval) __NOEXC {
962  return __sincos(x, cosval);
963 }
964 __SYCL_EXPORT s::cl_double sycl_host_sincos(s::cl_double x,
965  s::cl_double *cosval) __NOEXC {
966  return __sincos(x, cosval);
967 }
968 __SYCL_EXPORT s::cl_half sycl_host_sincos(s::cl_half x,
969  s::cl_half *cosval) __NOEXC {
970  return __sincos(x, cosval);
971 }
972 MAKE_1V_2P(sycl_host_sincos, s::cl_float, s::cl_float, s::cl_float)
974 MAKE_1V_2P(sycl_host_sincos, s::cl_half, s::cl_half, s::cl_half)
975 
976 // sinh
977 __SYCL_EXPORT s::cl_float sycl_host_sinh(s::cl_float x) __NOEXC {
978  return std::sinh(x);
979 }
980 __SYCL_EXPORT s::cl_double sycl_host_sinh(s::cl_double x) __NOEXC {
981  return std::sinh(x);
982 }
983 __SYCL_EXPORT s::cl_half sycl_host_sinh(s::cl_half x) __NOEXC {
984  return std::sinh(x);
985 }
986 MAKE_1V(sycl_host_sinh, s::cl_float, s::cl_float)
987 MAKE_1V(sycl_host_sinh, s::cl_double, s::cl_double)
988 MAKE_1V(sycl_host_sinh, s::cl_half, s::cl_half)
989 
990 // sinpi
991 __SYCL_EXPORT s::cl_float sycl_host_sinpi(s::cl_float x) __NOEXC {
992  return __sinpi(x);
993 }
994 __SYCL_EXPORT s::cl_double sycl_host_sinpi(s::cl_double x) __NOEXC {
995  return __sinpi(x);
996 }
997 __SYCL_EXPORT s::cl_half sycl_host_sinpi(s::cl_half x) __NOEXC {
998  return __sinpi(x);
999 }
1000 MAKE_1V(sycl_host_sinpi, s::cl_float, s::cl_float)
1001 MAKE_1V(sycl_host_sinpi, s::cl_double, s::cl_double)
1002 MAKE_1V(sycl_host_sinpi, s::cl_half, s::cl_half)
1003 
1004 // sqrt
1005 __SYCL_EXPORT s::cl_float sycl_host_sqrt(s::cl_float x) __NOEXC {
1006  return std::sqrt(x);
1007 }
1008 __SYCL_EXPORT s::cl_double sycl_host_sqrt(s::cl_double x) __NOEXC {
1009  return std::sqrt(x);
1010 }
1011 __SYCL_EXPORT s::cl_half sycl_host_sqrt(s::cl_half x) __NOEXC {
1012  return std::sqrt(x);
1013 }
1014 MAKE_1V(sycl_host_sqrt, s::cl_float, s::cl_float)
1015 MAKE_1V(sycl_host_sqrt, s::cl_double, s::cl_double)
1016 MAKE_1V(sycl_host_sqrt, s::cl_half, s::cl_half)
1017 
1018 // tan
1019 __SYCL_EXPORT s::cl_float sycl_host_tan(s::cl_float x) __NOEXC {
1020  return std::tan(x);
1021 }
1022 __SYCL_EXPORT s::cl_double sycl_host_tan(s::cl_double x) __NOEXC {
1023  return std::tan(x);
1024 }
1025 __SYCL_EXPORT s::cl_half sycl_host_tan(s::cl_half x) __NOEXC {
1026  return std::tan(x);
1027 }
1028 MAKE_1V(sycl_host_tan, s::cl_float, s::cl_float)
1029 MAKE_1V(sycl_host_tan, s::cl_double, s::cl_double)
1030 MAKE_1V(sycl_host_tan, s::cl_half, s::cl_half)
1031 
1032 // tanh
1033 __SYCL_EXPORT s::cl_float sycl_host_tanh(s::cl_float x) __NOEXC {
1034  return std::tanh(x);
1035 }
1036 __SYCL_EXPORT s::cl_double sycl_host_tanh(s::cl_double x) __NOEXC {
1037  return std::tanh(x);
1038 }
1039 __SYCL_EXPORT s::cl_half sycl_host_tanh(s::cl_half x) __NOEXC {
1040  return std::tanh(x);
1041 }
1042 MAKE_1V(sycl_host_tanh, s::cl_float, s::cl_float)
1043 MAKE_1V(sycl_host_tanh, s::cl_double, s::cl_double)
1044 MAKE_1V(sycl_host_tanh, s::cl_half, s::cl_half)
1045 
1046 // tanpi
1047 __SYCL_EXPORT s::cl_float sycl_host_tanpi(s::cl_float x) __NOEXC {
1048  return __tanpi(x);
1049 }
1050 __SYCL_EXPORT s::cl_double sycl_host_tanpi(s::cl_double x) __NOEXC {
1051  return __tanpi(x);
1052 }
1053 __SYCL_EXPORT s::cl_half sycl_host_tanpi(s::cl_half x) __NOEXC {
1054  return __tanpi(x);
1055 }
1056 MAKE_1V(sycl_host_tanpi, s::cl_float, s::cl_float)
1057 MAKE_1V(sycl_host_tanpi, s::cl_double, s::cl_double)
1058 MAKE_1V(sycl_host_tanpi, s::cl_half, s::cl_half)
1059 
1060 // tgamma
1061 __SYCL_EXPORT s::cl_float sycl_host_tgamma(s::cl_float x) __NOEXC {
1062  return std::tgamma(x);
1063 }
1064 __SYCL_EXPORT s::cl_double sycl_host_tgamma(s::cl_double x) __NOEXC {
1065  return std::tgamma(x);
1066 }
1067 __SYCL_EXPORT s::cl_half sycl_host_tgamma(s::cl_half x) __NOEXC {
1068  return std::tgamma(x);
1069 }
1070 MAKE_1V(sycl_host_tgamma, s::cl_float, s::cl_float)
1071 MAKE_1V(sycl_host_tgamma, s::cl_double, s::cl_double)
1072 MAKE_1V(sycl_host_tgamma, s::cl_half, s::cl_half)
1073 
1074 // trunc
1075 __SYCL_EXPORT s::cl_float sycl_host_trunc(s::cl_float x) __NOEXC {
1076  return std::trunc(x);
1077 }
1078 __SYCL_EXPORT s::cl_double sycl_host_trunc(s::cl_double x) __NOEXC {
1079  return std::trunc(x);
1080 }
1081 __SYCL_EXPORT s::cl_half sycl_host_trunc(s::cl_half x) __NOEXC {
1082  return std::trunc(x);
1083 }
1084 MAKE_1V(sycl_host_trunc, s::cl_float, s::cl_float)
1085 MAKE_1V(sycl_host_trunc, s::cl_double, s::cl_double)
1086 MAKE_1V(sycl_host_trunc, s::cl_half, s::cl_half)
1087 
1088 // --------------- 4.13.3 Native Math functions. Host implementations. ---------
1089 // native_cos
1090 __SYCL_EXPORT s::cl_float sycl_host_native_cos(s::cl_float x) __NOEXC {
1091  return std::cos(x);
1092 }
1093 MAKE_1V(sycl_host_native_cos, s::cl_float, s::cl_float)
1094 
1095 // native_divide
1096 __SYCL_EXPORT s::cl_float sycl_host_native_divide(s::cl_float x,
1097  s::cl_float y) __NOEXC {
1098  return x / y;
1099 }
1100 MAKE_1V_2V(sycl_host_native_divide, s::cl_float, s::cl_float, s::cl_float)
1101 
1102 // native_exp
1103 __SYCL_EXPORT s::cl_float sycl_host_native_exp(s::cl_float x) __NOEXC {
1104  return std::exp(x);
1105 }
1106 MAKE_1V(sycl_host_native_exp, s::cl_float, s::cl_float)
1107 
1108 // native_exp2
1109 __SYCL_EXPORT s::cl_float sycl_host_native_exp2(s::cl_float x) __NOEXC {
1110  return std::exp2(x);
1111 }
1112 MAKE_1V(sycl_host_native_exp2, s::cl_float, s::cl_float)
1113 
1114 // native_exp10
1115 __SYCL_EXPORT s::cl_float sycl_host_native_exp10(s::cl_float x) __NOEXC {
1116  return std::pow(10, x);
1117 }
1118 MAKE_1V(sycl_host_native_exp10, s::cl_float, s::cl_float)
1119 
1120 // native_log
1121 __SYCL_EXPORT s::cl_float sycl_host_native_log(s::cl_float x) __NOEXC {
1122  return std::log(x);
1123 }
1124 MAKE_1V(sycl_host_native_log, s::cl_float, s::cl_float)
1125 
1126 // native_log2
1127 __SYCL_EXPORT s::cl_float sycl_host_native_log2(s::cl_float x) __NOEXC {
1128  return std::log2(x);
1129 }
1130 MAKE_1V(sycl_host_native_log2, s::cl_float, s::cl_float)
1131 
1132 // native_log10
1133 __SYCL_EXPORT s::cl_float sycl_host_native_log10(s::cl_float x) __NOEXC {
1134  return std::log10(x);
1135 }
1136 MAKE_1V(sycl_host_native_log10, s::cl_float, s::cl_float)
1137 
1138 // native_powr
1139 __SYCL_EXPORT s::cl_float sycl_host_native_powr(s::cl_float x,
1140  s::cl_float y) __NOEXC {
1141  return (x >= 0 ? std::pow(x, y) : x);
1142 }
1143 MAKE_1V_2V(sycl_host_native_powr, s::cl_float, s::cl_float, s::cl_float)
1144 
1145 // native_recip
1146 __SYCL_EXPORT s::cl_float sycl_host_native_recip(s::cl_float x) __NOEXC {
1147  return 1.0 / x;
1148 }
1149 MAKE_1V(sycl_host_native_recip, s::cl_float, s::cl_float)
1150 
1151 // native_rsqrt
1152 __SYCL_EXPORT s::cl_float sycl_host_native_rsqrt(s::cl_float x) __NOEXC {
1153  return 1.0 / std::sqrt(x);
1154 }
1155 MAKE_1V(sycl_host_native_rsqrt, s::cl_float, s::cl_float)
1156 
1157 // native_sin
1158 __SYCL_EXPORT s::cl_float sycl_host_native_sin(s::cl_float x) __NOEXC {
1159  return std::sin(x);
1160 }
1161 MAKE_1V(sycl_host_native_sin, s::cl_float, s::cl_float)
1162 
1163 // native_sqrt
1164 __SYCL_EXPORT s::cl_float sycl_host_native_sqrt(s::cl_float x) __NOEXC {
1165  return std::sqrt(x);
1166 }
1167 MAKE_1V(sycl_host_native_sqrt, s::cl_float, s::cl_float)
1168 
1169 // native_tan
1170 __SYCL_EXPORT s::cl_float sycl_host_native_tan(s::cl_float x) __NOEXC {
1171  return std::tan(x);
1172 }
1173 MAKE_1V(sycl_host_native_tan, s::cl_float, s::cl_float)
1174 
1175 // ---------- 4.13.3 Half Precision Math functions. Host implementations. ------
1176 // half_cos
1177 __SYCL_EXPORT s::cl_float sycl_host_half_cos(s::cl_float x) __NOEXC {
1178  return std::cos(x);
1179 }
1180 MAKE_1V(sycl_host_half_cos, s::cl_float, s::cl_float)
1181 
1182 // half_divide
1183 __SYCL_EXPORT s::cl_float sycl_host_half_divide(s::cl_float x,
1184  s::cl_float y) __NOEXC {
1185  return x / y;
1186 }
1187 MAKE_1V_2V(sycl_host_half_divide, s::cl_float, s::cl_float, s::cl_float)
1188 
1189 // half_exp
1190 __SYCL_EXPORT s::cl_float sycl_host_half_exp(s::cl_float x) __NOEXC {
1191  return std::exp(x);
1192 }
1193 MAKE_1V(sycl_host_half_exp, s::cl_float, s::cl_float)
1194 // half_exp2
1195 __SYCL_EXPORT s::cl_float sycl_host_half_exp2(s::cl_float x) __NOEXC {
1196  return std::exp2(x);
1197 }
1198 MAKE_1V(sycl_host_half_exp2, s::cl_float, s::cl_float)
1199 
1200 // half_exp10
1201 __SYCL_EXPORT s::cl_float sycl_host_half_exp10(s::cl_float x) __NOEXC {
1202  return std::pow(10, x);
1203 }
1204 MAKE_1V(sycl_host_half_exp10, s::cl_float, s::cl_float)
1205 // half_log
1206 __SYCL_EXPORT s::cl_float sycl_host_half_log(s::cl_float x) __NOEXC {
1207  return std::log(x);
1208 }
1209 MAKE_1V(sycl_host_half_log, s::cl_float, s::cl_float)
1210 
1211 // half_log2
1212 __SYCL_EXPORT s::cl_float sycl_host_half_log2(s::cl_float x) __NOEXC {
1213  return std::log2(x);
1214 }
1215 MAKE_1V(sycl_host_half_log2, s::cl_float, s::cl_float)
1216 
1217 // half_log10
1218 __SYCL_EXPORT s::cl_float sycl_host_half_log10(s::cl_float x) __NOEXC {
1219  return std::log10(x);
1220 }
1221 MAKE_1V(sycl_host_half_log10, s::cl_float, s::cl_float)
1222 
1223 // half_powr
1224 __SYCL_EXPORT s::cl_float sycl_host_half_powr(s::cl_float x,
1225  s::cl_float y) __NOEXC {
1226  return (x >= 0 ? std::pow(x, y) : x);
1227 }
1228 MAKE_1V_2V(sycl_host_half_powr, s::cl_float, s::cl_float, s::cl_float)
1229 
1230 // half_recip
1231 __SYCL_EXPORT s::cl_float sycl_host_half_recip(s::cl_float x) __NOEXC {
1232  return 1.0 / x;
1233 }
1234 MAKE_1V(sycl_host_half_recip, s::cl_float, s::cl_float)
1235 
1236 // half_rsqrt
1237 __SYCL_EXPORT s::cl_float sycl_host_half_rsqrt(s::cl_float x) __NOEXC {
1238  return 1.0 / std::sqrt(x);
1239 }
1240 MAKE_1V(sycl_host_half_rsqrt, s::cl_float, s::cl_float)
1241 
1242 // half_sin
1243 __SYCL_EXPORT s::cl_float sycl_host_half_sin(s::cl_float x) __NOEXC {
1244  return std::sin(x);
1245 }
1246 MAKE_1V(sycl_host_half_sin, s::cl_float, s::cl_float)
1247 
1248 // half_sqrt
1249 __SYCL_EXPORT s::cl_float sycl_host_half_sqrt(s::cl_float x) __NOEXC {
1250  return std::sqrt(x);
1251 }
1252 MAKE_1V(sycl_host_half_sqrt, s::cl_float, s::cl_float)
1253 
1254 // half_tan
1255 __SYCL_EXPORT s::cl_float sycl_host_half_tan(s::cl_float x) __NOEXC {
1256  return std::tan(x);
1257 }
1258 MAKE_1V(sycl_host_half_tan, s::cl_float, s::cl_float)
1259 
1260 } // namespace __host_std
sycl::_V1::opencl::cl_int
std::int32_t cl_int
Definition: aliases.hpp:136
sycl::_V1::opencl::cl_uint
std::uint32_t cl_uint
Definition: aliases.hpp:137
__host_std::sycl_host_fabs
s::cl_float sycl_host_fabs(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:423
sycl::_V1::ext::oneapi::fabs
std::enable_if_t< detail::is_bf16_storage_type< T >::value, T > fabs(T x)
Definition: bf16_storage_builtins.hpp:39
__NOEXC
#define __NOEXC
Definition: builtins.hpp:18
sycl::_V1::ext::intel::esimd::exp2
__ESIMD_API simd< T, N > exp2(simd< T, N > src, Sat sat={})
Exponent base 2.
Definition: math.hpp:385
__host_std::sycl_host_atanh
s::cl_float sycl_host_atanh(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:208
sycl::_V1::opencl::cl_ushort
std::uint16_t cl_ushort
Definition: aliases.hpp:135
sycl::_V1::opencl::cl_ulong
std::uint64_t cl_ulong
Definition: aliases.hpp:139
sycl::_V1::ilogb
__SYCL_ALWAYS_INLINE std::enable_if_t< detail::is_sgenfloat< T >::value, marray< int, N > > ilogb(marray< T, N > x) __NOEXC
Definition: builtins.hpp:133
sycl::_V1::ext::intel::experimental::esimd::atan2
sycl::ext::intel::esimd::simd< float, N > atan2(sycl::ext::intel::esimd::simd< float, N > y, sycl::ext::intel::esimd::simd< float, N > x)
Definition: math.hpp:1365
__host_std::sycl_host_cos
s::cl_float sycl_host_cos(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:297
__host_std
Definition: builtins.hpp:106
sycl::_V1::cos
ESIMD_NODEBUG ESIMD_INLINE sycl::ext::intel::esimd::simd< float, SZ > cos(sycl::ext::intel::esimd::simd< float, SZ > x) __NOEXC
Definition: builtins_esimd.hpp:27
sycl::_V1::exp
ESIMD_NODEBUG ESIMD_INLINE sycl::ext::intel::esimd::simd< float, SZ > exp(sycl::ext::intel::esimd::simd< float, SZ > x) __NOEXC
Definition: builtins_esimd.hpp:49
sycl
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
__host_std::sycl_host_atan2pi
s::cl_float sycl_host_atan2pi(s::cl_float x, s::cl_float y) __NOEXC
Definition: builtins_math.cpp:236
__host_std::sycl_host_acos
s::cl_float sycl_host_acos(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:94
MAKE_1V_2V
#define MAKE_1V_2V(Fun, Ret, Arg1, Arg2)
Definition: builtins_helper.hpp:125
__host_std::sycl_host_fdim
s::cl_float sycl_host_fdim(s::cl_float x, s::cl_float y) __NOEXC
Definition: builtins_math.cpp:437
__host_std::sycl_host_expm1
s::cl_float sycl_host_expm1(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:409
__host_std::sycl_host_atan
s::cl_float sycl_host_atan(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:178
sycl::_V1::ext::intel::esimd::sqrt
__ESIMD_API simd< T, N > sqrt(simd< T, N > src, Sat sat={})
Square root.
Definition: math.hpp:389
sycl::_V1::sin
ESIMD_NODEBUG ESIMD_INLINE sycl::ext::intel::esimd::simd< float, SZ > sin(sycl::ext::intel::esimd::simd< float, SZ > x) __NOEXC
Definition: builtins_esimd.hpp:38
__host_std::sycl_host_exp10
s::cl_float sycl_host_exp10(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:395
export.hpp
sycl::_V1::ext::intel::experimental::esimd::bfn_t::x
@ x
__host_std::sycl_host_asin
s::cl_float sycl_host_asin(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:136
__host_std::sycl_host_ceil
s::cl_float sycl_host_ceil(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:266
__host_std::sycl_host_acospi
s::cl_float sycl_host_acospi(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:122
MAKE_1V_2P
#define MAKE_1V_2P(Fun, Ret, Arg1, Arg2)
Definition: builtins_helper.hpp:192
sycl::_V1::ext::intel::experimental::esimd::acos
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > acos(sycl::ext::intel::esimd::simd< T, SZ > src0)
Definition: math.hpp:1217
__host_std::sycl_host_exp2
s::cl_float sycl_host_exp2(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:381
__host_std::MAKE_1V_2V_3V
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
__host_std::sycl_host_atan2
s::cl_float sycl_host_atan2(s::cl_float x, s::cl_float y) __NOEXC
Definition: builtins_math.cpp:192
builtins_helper.hpp
sycl::_V1::opencl::cl_half
half cl_half
Definition: aliases.hpp:140
sycl::_V1::ext::intel::experimental::esimd::atan
ESIMD_DETAIL ESIMD_NODEBUG ESIMD_INLINE sycl::ext::intel::esimd::simd< T, SZ > atan(sycl::ext::intel::esimd::simd< T, SZ > src0)
Definition: math.hpp:1173
sycl::_V1::ext::intel::experimental::esimd::bfn_t::y
@ y
__host_std::sycl_host_erfc
s::cl_float sycl_host_erfc(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:339
sycl::_V1::ext::intel::esimd::abs
ESIMD_DETAIL __ESIMD_API std::enable_if_t< !std::is_same< std::remove_const_t< TRes >, std::remove_const_t< TArg > >::value, simd< TRes, SZ > > abs(simd< TArg, SZ > src0)
Get absolute value (vector version)
Definition: math.hpp:127
sycl::_V1::ext::intel::esimd::ceil
ESIMD_INLINE sycl::ext::intel::esimd::simd< RT, SZ > ceil(const sycl::ext::intel::esimd::simd< float, SZ > src0, Sat sat={})
"Ceiling" operation, vector version - alias of rndu.
Definition: math.hpp:594
sycl::_V1::ext::intel::experimental::esimd::fmod
sycl::ext::intel::esimd::simd< float, N > fmod(sycl::ext::intel::esimd::simd< float, N > y, sycl::ext::intel::esimd::simd< float, N > x)
Definition: math.hpp:1398
__host_std::sycl_host_asinpi
s::cl_float sycl_host_asinpi(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:164
sycl::_V1::ext::intel::esimd::log2
__ESIMD_API simd< T, N > log2(simd< T, N > src, Sat sat={})
Logarithm base 2.
Definition: math.hpp:381
__host_std::sycl_host_cospi
s::cl_float sycl_host_cospi(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:325
sycl::_V1::detail::cast_if_host_half
T cast_if_host_half(T val)
Definition: half_type.hpp:571
sycl::_V1::ext::intel::experimental::esimd::tanh
float tanh(float x)
Definition: math.hpp:1571
__host_std::sycl_host_copysign
s::cl_float sycl_host_copysign(s::cl_float x, s::cl_float y) __NOEXC
Definition: builtins_math.cpp:280
sycl::_V1::ext::intel::math::copysign
std::enable_if_t< std::is_same_v< Tp, float >, float > copysign(Tp x, Tp y)
Definition: math.hpp:68
__host_std::sycl_host_acosh
s::cl_float sycl_host_acosh(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:108
__host_std::sycl_host_asinh
s::cl_float sycl_host_asinh(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:150
sycl::_V1::log
ESIMD_NODEBUG ESIMD_INLINE sycl::ext::intel::esimd::simd< float, SZ > log(sycl::ext::intel::esimd::simd< float, SZ > x) __NOEXC
Definition: builtins_esimd.hpp:60
MAKE_1V
#define MAKE_1V(Fun, Ret, Arg1)
Definition: builtins_helper.hpp:115
sycl::_V1::ldexp
__SYCL_ALWAYS_INLINE std::enable_if_t< detail::is_sgenfloat< T >::value, marray< T, N > > ldexp(marray< T, N > x, marray< int, N > k) __NOEXC
Definition: builtins.hpp:217
MAKE_1V_2V_3P
#define MAKE_1V_2V_3P(Fun, Ret, Arg1, Arg2, Arg3)
Definition: builtins_helper.hpp:208
sycl::_V1::opencl::cl_double
double cl_double
Definition: aliases.hpp:142
__host_std::sycl_host_atanpi
s::cl_float sycl_host_atanpi(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:222
sycl::_V1::ext::intel::math::rint
std::enable_if_t< std::is_same_v< Tp, float >, float > rint(Tp x)
Definition: math.hpp:149
__host_std::sycl_host_floor
s::cl_float sycl_host_floor(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:452
sycl::_V1::ext::intel::esimd::pow
__ESIMD_API simd< T, N > pow(simd< T, N > src0, simd< U, N > src1, Sat sat={})
Power - calculates src0 in power of src1.
Definition: math.hpp:442
__host_std::sycl_host_erf
s::cl_float sycl_host_erf(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:353
sycl::_V1::ext::intel::experimental::esimd::asin
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > asin(sycl::ext::intel::esimd::simd< T, SZ > src0)
Definition: math.hpp:1255
__host_std::sycl_host_fma
s::cl_float sycl_host_fma(s::cl_float a, s::cl_float b, s::cl_float c) __NOEXC
Definition: builtins_math.cpp:466
__host_std::sycl_host_cosh
s::cl_float sycl_host_cosh(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:311
sycl::_V1::opencl::cl_float
float cl_float
Definition: aliases.hpp:141
__host_std::sycl_host_cbrt
s::cl_float sycl_host_cbrt(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:252
sycl::_V1::ext::intel::esimd::floor
ESIMD_INLINE sycl::ext::intel::esimd::simd< RT, SZ > floor(const sycl::ext::intel::esimd::simd< float, SZ > src0, Sat sat={})
"Floor" operation, vector version - alias of rndd.
Definition: math.hpp:581
sycl::_V1::ext::intel::esimd::trunc
__ESIMD_API sycl::ext::intel::esimd::simd< RT, SZ > trunc(const sycl::ext::intel::esimd::simd< float, SZ > &src0, Sat sat={})
Round to integral value using the round to zero rounding mode (vector version).
Definition: math.hpp:614
__host_std::sycl_host_exp
s::cl_float sycl_host_exp(s::cl_float x) __NOEXC
Definition: builtins_math.cpp:367