13 #if __has_include(<version>)
16 #ifdef __cpp_lib_math_constants
24 #ifdef __cpp_lib_math_constants
35 inline constexpr T
e_v = std::numbers::e_v<T>;
38 inline constexpr T
log2e_v = std::numbers::log2e_v<T>;
41 inline constexpr T
log10e_v = std::numbers::log10e_v<T>;
44 inline constexpr T
pi_v = std::numbers::pi_v<T>;
47 inline constexpr T
inv_pi_v = std::numbers::inv_pi_v<T>;
50 inline constexpr T
ln2_v = std::numbers::ln2_v<T>;
53 inline constexpr T
ln10_v = std::numbers::ln10_v<T>;
56 inline constexpr T
sqrt2_v = std::numbers::sqrt2_v<T>;
58 inline constexpr
double e = M_E;
59 inline constexpr
double log2e = M_LOG2E;
60 inline constexpr
double log10e = M_LOG10E;
61 inline constexpr
double pi = M_PI;
62 inline constexpr
double inv_pi = M_1_PI;
63 inline constexpr
double ln2 = M_LN2;
64 inline constexpr
double ln10 = M_LN10;
65 inline constexpr
double sqrt2 = M_SQRT2;
68 inline constexpr T
e_v =
static_cast<T
>(
e);
77 inline constexpr T
pi_v =
static_cast<T
>(
pi);
83 inline constexpr T
ln2_v =
static_cast<T
>(
ln2);
94 inline constexpr
float e_v<float> = M_Ef;
97 # if defined(M_LOG2Ef)
99 inline constexpr
float log2e_v<float> = M_LOG2Ef;
102 # if defined(M_LOG10Ef)
104 inline constexpr
float log10e_v<float> = M_LOG10Ef;
109 inline constexpr
float pi_v<float> = M_PIf;
112 # if defined(M_1_PIf)
114 inline constexpr
float inv_pi_v<float> = M_1_PIf;
119 inline constexpr
float ln2_v<float> = M_LN2f;
122 # if defined(M_LN10f)
124 inline constexpr
float ln10_v<float> = M_LN10f;
127 # if defined(M_SQRT2f)
129 inline constexpr
float sqrt2_v<float> = M_SQRT2f;
295 template<
typename T,
typename TArg,
typename TSfinae =
void>
308 template<
typename T,
typename TArg,
typename TSfinae =
void>
321 template<
typename T,
typename TArg,
typename TSfinae =
void>
334 template<
typename T,
typename TArgument,
typename TSfinae =
void>
345 return arg(argument);
350 template<
typename T,
typename TArg,
typename TSfinae =
void>
363 template<
typename T,
typename TArg,
typename TSfinae =
void>
376 template<
typename T,
typename TArg,
typename TSfinae =
void>
389 template<
typename T,
typename TArg,
typename TSfinae =
void>
402 template<
typename T,
typename Ty,
typename Tx,
typename TSfinae =
void>
415 template<
typename T,
typename TArg,
typename TSfinae =
void>
428 template<
typename T,
typename TArg,
typename TSfinae =
void>
441 template<
typename T,
typename TArg,
typename TSfinae =
void>
454 template<
typename T,
typename TMag,
typename TSgn,
typename TSfinae =
void>
467 template<
typename T,
typename TArg,
typename TSfinae =
void>
480 template<
typename T,
typename TArg,
typename TSfinae =
void>
492 template<
typename T,
typename TArg,
typename TSfinae =
void>
505 template<
typename T,
typename TArg,
typename TSfinae =
void>
518 template<
typename T,
typename TArg,
typename TSfinae =
void>
531 template<
typename T,
typename Tx,
typename Ty,
typename Tz,
typename TSfinae =
void>
544 template<
typename T,
typename Tx,
typename Ty,
typename TSfinae =
void>
557 template<
typename T,
typename TArg,
typename TSfinae =
void>
570 template<
typename T,
typename TArg,
typename TSfinae =
void>
583 template<
typename T,
typename TArg,
typename TSfinae =
void>
596 template<
typename T,
typename TArg,
typename TSfinae =
void>
609 template<
typename T,
typename TArg,
typename TSfinae =
void>
622 template<
typename T,
typename TArg,
typename TSfinae =
void>
635 template<
typename T,
typename Tx,
typename Ty,
typename TSfinae =
void>
648 template<
typename T,
typename Tx,
typename Ty,
typename TSfinae =
void>
661 template<
typename T,
typename TBase,
typename TExp,
typename TSfinae =
void>
674 template<
typename T,
typename Tx,
typename Ty,
typename TSfinae =
void>
687 template<
typename T,
typename TArg,
typename TSfinae =
void>
700 template<
typename T,
typename TArg,
typename TSfinae =
void>
713 template<
typename T,
typename TArg,
typename TSfinae =
void>
728 template<
typename TArg>
733 return static_cast<TArg
>(1) /
sqrt(
arg);
738 template<
typename T,
typename TArg,
typename TSfinae =
void>
751 template<
typename T,
typename TArg,
typename TSfinae =
void>
764 template<
typename T,
typename TArg,
typename TSfinae =
void>
779 template<
typename TArg>
791 template<
typename T,
typename TArg,
typename TSfinae =
void>
799 return sincos(
arg, result_sin, result_cos);
804 template<
typename T,
typename TArg,
typename TSfinae =
void>
817 template<
typename T,
typename TArg,
typename TSfinae =
void>
830 template<
typename T,
typename TArg,
typename TSfinae =
void>
843 template<
typename T,
typename TArg,
typename TSfinae =
void>
863 template<
typename T,
typename TArg>
880 template<
typename T,
typename TArg>
897 template<
typename T,
typename TArg>
911 template<
typename T,
typename TArgument>
928 template<
typename T,
typename TArg>
941 template<
typename T,
typename TArg>
954 template<
typename T,
typename TArg>
971 template<
typename T,
typename TArg>
987 template<
typename T,
typename Ty,
typename Tx>
1001 template<
typename T,
typename TArg>
1015 template<
typename T,
typename TArg>
1029 template<
typename T,
typename TArg>
1045 template<
typename T,
typename TMag,
typename TSgn>
1059 template<
typename T,
typename TArg>
1073 template<
typename T,
typename TArg>
1087 template<
typename T,
typename TArg>
1101 template<
typename T,
typename TArg>
1115 template<
typename T,
typename TArg>
1133 template<
typename T,
typename Tx,
typename Ty,
typename Tz>
1149 template<
typename T,
typename Tx,
typename Ty>
1163 template<
typename T,
typename TArg>
1177 template<
typename T,
typename TArg>
1191 template<
typename T,
typename TArg>
1209 template<
typename T,
typename TArg>
1227 template<
typename T,
typename TArg>
1245 template<
typename T,
typename TArg>
1262 template<
typename T,
typename Tx,
typename Ty>
1279 template<
typename T,
typename Tx,
typename Ty>
1299 template<
typename T,
typename TBase,
typename TExp>
1315 template<
typename T,
typename Tx,
typename Ty>
1330 template<
typename T,
typename TArg>
1345 template<
typename T,
typename TArg>
1360 template<
typename T,
typename TArg>
1378 template<
typename T,
typename TArg>
1392 template<
typename T,
typename TArg>
1406 template<
typename T,
typename TArg>
1422 template<
typename T,
typename TArg>
1440 template<
typename T,
typename TArg>
1454 template<
typename T,
typename TArg>
1468 template<
typename T,
typename TArg>
1482 template<
typename T,
typename TArg>
#define ALPAKA_FN_HOST_ACC
#define ALPAKA_NO_HOST_ACC_WARNING
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_...
typename detail::ImplementationBaseType< TInterface, TDerived >::type ImplementationBase
Returns the type that implements the given interface in the inheritance hierarchy.
ALPAKA_FN_HOST_ACC auto sincos(TArg const &arg, TArg &result_sin, TArg &result_cos)
Fallback implementation when no better ADL match was found.
ALPAKA_FN_HOST_ACC auto rsqrt(TArg const &arg)
Fallback implementation when no better ADL match was found.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto tanh(T const &tanh_ctx, TArg const &arg)
Computes the hyperbolic tangent (measured in radians).
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto cosh(T const &cosh_ctx, TArg const &arg)
Computes the hyperbolic cosine (measured in radians).
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto pow(T const &pow_ctx, TBase const &base, TExp const &exp)
Computes the value of base raised to the power exp.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto max(T const &max_ctx, Tx const &x, Ty const &y)
Returns the larger of two arguments. NaNs are treated as missing data (between a NaN and a numeric va...
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto sqrt(T const &sqrt_ctx, TArg const &arg)
Computes the square root of arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto atan(T const &atan_ctx, TArg const &arg)
Computes the principal value of the arc tangent.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto floor(T const &floor_ctx, TArg const &arg)
Computes the largest integer value not greater than arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto asin(T const &asin_ctx, TArg const &arg)
Computes the principal value of the arc sine.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto exp(T const &exp_ctx, TArg const &arg)
Computes the e (Euler's number, 2.7182818) raised to the given power arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto isfinite(T const &ctx, TArg const &arg)
Checks if given value is finite.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto cos(T const &cos_ctx, TArg const &arg)
Computes the cosine (measured in radians).
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto acos(T const &acos_ctx, TArg const &arg)
Computes the principal value of the arc cosine.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto acosh(T const &acosh_ctx, TArg const &arg)
Computes the principal value of the hyperbolic arc cosine.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto log10(T const &log10_ctx, TArg const &arg)
Computes the the natural (base 10) logarithm of arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto conj(T const &conj_ctx, TArg const &arg)
Computes the complex conjugate of arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto llround(T const &llround_ctx, TArg const &arg) -> long long int
Computes the nearest integer value to arg (in integer format), rounding halfway cases away from zero,...
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto fmod(T const &fmod_ctx, Tx const &x, Ty const &y)
Computes the floating-point remainder of the division operation x/y.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto asinh(T const &asinh_ctx, TArg const &arg)
Computes the principal value of the hyperbolic arc sine.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto log2(T const &log2_ctx, TArg const &arg)
Computes the the natural (base 2) logarithm of arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto trunc(T const &trunc_ctx, TArg const &arg)
Computes the nearest integer not greater in magnitude than arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto tan(T const &tan_ctx, TArg const &arg)
Computes the tangent (measured in radians).
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto copysign(T const ©sign_ctx, TMag const &mag, TSgn const &sgn)
Creates a value with the magnitude of mag and the sign of sgn.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto isinf(T const &ctx, TArg const &arg)
Checks if given value is inf.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto atanh(T const &atanh_ctx, TArg const &arg)
Computes the principal value of the hyperbolic arc tangent.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto ceil(T const &ceil_ctx, TArg const &arg)
Computes the smallest integer value not less than arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto lround(T const &lround_ctx, TArg const &arg) -> long int
Computes the nearest integer value to arg (in integer format), rounding halfway cases away from zero,...
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto sincos(T const &sincos_ctx, TArg const &arg, TArg &result_sin, TArg &result_cos) -> void
Computes the sine and cosine (measured in radians).
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto fma(T const &fma_ctx, Tx const &x, Ty const &y, Tz const &z)
Computes x * y + z as if to infinite precision and rounded only once to fit the result type.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto remainder(T const &remainder_ctx, Tx const &x, Ty const &y)
Computes the IEEE remainder of the floating point division operation x/y.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto isnan(T const &ctx, TArg const &arg)
Checks if given value is NaN.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto cbrt(T const &cbrt_ctx, TArg const &arg)
Computes the cbrt.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto min(T const &min_ctx, Tx const &x, Ty const &y)
Returns the smaller of two arguments. NaNs are treated as missing data (between a NaN and a numeric v...
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto atan2(T const &atan2_ctx, Ty const &y, Tx const &x)
Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto sin(T const &sin_ctx, TArg const &arg)
Computes the sine (measured in radians).
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto rsqrt(T const &rsqrt_ctx, TArg const &arg)
Computes the rsqrt.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto sinh(T const &sinh_ctx, TArg const &arg)
Computes the hyperbolic sine (measured in radians).
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto abs(T const &abs_ctx, TArg const &arg)
Computes the absolute value.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto log(T const &log_ctx, TArg const &arg)
Computes the the natural (base e) logarithm of arg.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto round(T const &round_ctx, TArg const &arg)
Computes the nearest integer value to arg (in floating-point format), rounding halfway cases away fro...
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto arg(T const &arg_ctx, TArgument const &argument)
Computes the complex argument of the value.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto erf(T const &erf_ctx, TArg const &arg)
Computes the error function of arg.
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T const &, TArgument const &argument)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, Ty const &y, Tx const &x)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TMag const &mag, TSgn const &sgn)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, Tx const &x, Ty const &y, Tz const &z)
ALPAKA_FN_HOST_ACC auto operator()(T const &, Tx const &x, Ty const &y)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, Tx const &x, Ty const &y)
ALPAKA_FN_HOST_ACC auto operator()(T const &, Tx const &x, Ty const &y)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TBase const &base, TExp const &exp)
ALPAKA_FN_HOST_ACC auto operator()(T const &, Tx const &x, Ty const &y)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg, TArg &result_sin, TArg &result_cos)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)