alpaka
Abstraction Library for Parallel Kernel Acceleration
Traits.hpp File Reference
#include "alpaka/core/Common.hpp"
#include "alpaka/core/Concepts.hpp"
#include <cmath>
#include <complex>

Go to the source code of this file.

Classes

struct  alpaka::math::ConceptMathAbs
 
struct  alpaka::math::ConceptMathAcos
 
struct  alpaka::math::ConceptMathAcosh
 
struct  alpaka::math::ConceptMathArg
 
struct  alpaka::math::ConceptMathAsin
 
struct  alpaka::math::ConceptMathAsinh
 
struct  alpaka::math::ConceptMathAtan
 
struct  alpaka::math::ConceptMathAtan2
 
struct  alpaka::math::ConceptMathAtanh
 
struct  alpaka::math::ConceptMathCbrt
 
struct  alpaka::math::ConceptMathCeil
 
struct  alpaka::math::ConceptMathConj
 
struct  alpaka::math::ConceptMathCopysign
 
struct  alpaka::math::ConceptMathCos
 
struct  alpaka::math::ConceptMathCosh
 
struct  alpaka::math::ConceptMathErf
 
struct  alpaka::math::ConceptMathExp
 
struct  alpaka::math::ConceptMathFloor
 
struct  alpaka::math::ConceptMathFma
 
struct  alpaka::math::ConceptMathFmod
 
struct  alpaka::math::ConceptMathIsfinite
 
struct  alpaka::math::ConceptMathIsinf
 
struct  alpaka::math::ConceptMathIsnan
 
struct  alpaka::math::ConceptMathLog
 
struct  alpaka::math::ConceptMathLog10
 
struct  alpaka::math::ConceptMathLog2
 
struct  alpaka::math::ConceptMathMax
 
struct  alpaka::math::ConceptMathMin
 
struct  alpaka::math::ConceptMathPow
 
struct  alpaka::math::ConceptMathRemainder
 
struct  alpaka::math::ConceptMathRound
 
struct  alpaka::math::ConceptMathRsqrt
 
struct  alpaka::math::ConceptMathSin
 
struct  alpaka::math::ConceptMathSinCos
 
struct  alpaka::math::ConceptMathSinh
 
struct  alpaka::math::ConceptMathSqrt
 
struct  alpaka::math::ConceptMathTan
 
struct  alpaka::math::ConceptMathTanh
 
struct  alpaka::math::ConceptMathTrunc
 
struct  alpaka::math::trait::Abs< T, TArg, TSfinae >
 The abs trait. More...
 
struct  alpaka::math::trait::Acos< T, TArg, TSfinae >
 The acos trait. More...
 
struct  alpaka::math::trait::Acosh< T, TArg, TSfinae >
 The acosh trait. More...
 
struct  alpaka::math::trait::Arg< T, TArgument, TSfinae >
 The arg trait. More...
 
struct  alpaka::math::trait::Asin< T, TArg, TSfinae >
 The asin trait. More...
 
struct  alpaka::math::trait::Asinh< T, TArg, TSfinae >
 The asin trait. More...
 
struct  alpaka::math::trait::Atan< T, TArg, TSfinae >
 The atan trait. More...
 
struct  alpaka::math::trait::Atan2< T, Ty, Tx, TSfinae >
 The atan2 trait. More...
 
struct  alpaka::math::trait::Atanh< T, TArg, TSfinae >
 The atanh trait. More...
 
struct  alpaka::math::trait::Cbrt< T, TArg, TSfinae >
 The cbrt trait. More...
 
struct  alpaka::math::trait::Ceil< T, TArg, TSfinae >
 The ceil trait. More...
 
struct  alpaka::math::trait::Conj< T, TArg, TSfinae >
 The conj trait. More...
 
struct  alpaka::math::trait::Copysign< T, TMag, TSgn, TSfinae >
 The copysign trait. More...
 
struct  alpaka::math::trait::Cos< T, TArg, TSfinae >
 The cos trait. More...
 
struct  alpaka::math::trait::Cosh< T, TArg, TSfinae >
 The cosh trait. More...
 
struct  alpaka::math::trait::Erf< T, TArg, TSfinae >
 
struct  alpaka::math::trait::Exp< T, TArg, TSfinae >
 The exp trait. More...
 
struct  alpaka::math::trait::Floor< T, TArg, TSfinae >
 The floor trait. More...
 
struct  alpaka::math::trait::Fma< T, Tx, Ty, Tz, TSfinae >
 The fma trait. More...
 
struct  alpaka::math::trait::Fmod< T, Tx, Ty, TSfinae >
 The fmod trait. More...
 
struct  alpaka::math::trait::Isfinite< T, TArg, TSfinae >
 The isfinite trait. More...
 
struct  alpaka::math::trait::Isinf< T, TArg, TSfinae >
 The isinf trait. More...
 
struct  alpaka::math::trait::Isnan< T, TArg, TSfinae >
 The isnan trait. More...
 
struct  alpaka::math::trait::Llround< T, TArg, TSfinae >
 The round trait. More...
 
struct  alpaka::math::trait::Log< T, TArg, TSfinae >
 The log trait. More...
 
struct  alpaka::math::trait::Log10< T, TArg, TSfinae >
 The base 10 log trait. More...
 
struct  alpaka::math::trait::Log2< T, TArg, TSfinae >
 The bas 2 log trait. More...
 
struct  alpaka::math::trait::Lround< T, TArg, TSfinae >
 The round trait. More...
 
struct  alpaka::math::trait::Max< T, Tx, Ty, TSfinae >
 The max trait. More...
 
struct  alpaka::math::trait::Min< T, Tx, Ty, TSfinae >
 The min trait. More...
 
struct  alpaka::math::trait::Pow< T, TBase, TExp, TSfinae >
 The pow trait. More...
 
struct  alpaka::math::trait::Remainder< T, Tx, Ty, TSfinae >
 The remainder trait. More...
 
struct  alpaka::math::trait::Round< T, TArg, TSfinae >
 The round trait. More...
 
struct  alpaka::math::trait::Rsqrt< T, TArg, TSfinae >
 The rsqrt trait. More...
 
struct  alpaka::math::trait::Sin< T, TArg, TSfinae >
 The sin trait. More...
 
struct  alpaka::math::trait::SinCos< T, TArg, TSfinae >
 The sincos trait. More...
 
struct  alpaka::math::trait::Sinh< T, TArg, TSfinae >
 The sin trait. More...
 
struct  alpaka::math::trait::Sqrt< T, TArg, TSfinae >
 The sqrt trait. More...
 
struct  alpaka::math::trait::Tan< T, TArg, TSfinae >
 The tan trait. More...
 
struct  alpaka::math::trait::Tanh< T, TArg, TSfinae >
 The tanh trait. More...
 
struct  alpaka::math::trait::Trunc< T, TArg, TSfinae >
 The trunc trait. More...
 

Namespaces

 alpaka
 The alpaka accelerator library.
 
 alpaka::math
 
 alpaka::math::constants
 
 alpaka::math::trait
 The math traits.
 
 alpaka::math::trait::detail
 

Functions

template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::abs (T const &abs_ctx, TArg const &arg)
 Computes the absolute value. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::acos (T const &acos_ctx, TArg const &arg)
 Computes the principal value of the arc cosine. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::acosh (T const &acosh_ctx, TArg const &arg)
 Computes the principal value of the hyperbolic arc cosine. More...
 
template<typename T , typename TArgument >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::arg (T const &arg_ctx, TArgument const &argument)
 Computes the complex argument of the value. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::asin (T const &asin_ctx, TArg const &arg)
 Computes the principal value of the arc sine. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::asinh (T const &asinh_ctx, TArg const &arg)
 Computes the principal value of the hyperbolic arc sine. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::atan (T const &atan_ctx, TArg const &arg)
 Computes the principal value of the arc tangent. More...
 
template<typename T , typename Ty , typename Tx >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::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. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::atanh (T const &atanh_ctx, TArg const &arg)
 Computes the principal value of the hyperbolic arc tangent. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::cbrt (T const &cbrt_ctx, TArg const &arg)
 Computes the cbrt. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::ceil (T const &ceil_ctx, TArg const &arg)
 Computes the smallest integer value not less than arg. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::conj (T const &conj_ctx, TArg const &arg)
 Computes the complex conjugate of arg. More...
 
template<typename T , typename TMag , typename TSgn >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::copysign (T const &copysign_ctx, TMag const &mag, TSgn const &sgn)
 Creates a value with the magnitude of mag and the sign of sgn. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::cos (T const &cos_ctx, TArg const &arg)
 Computes the cosine (measured in radians). More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::cosh (T const &cosh_ctx, TArg const &arg)
 Computes the hyperbolic cosine (measured in radians). More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::erf (T const &erf_ctx, TArg const &arg)
 Computes the error function of arg. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::exp (T const &exp_ctx, TArg const &arg)
 Computes the e (Euler's number, 2.7182818) raised to the given power arg. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::floor (T const &floor_ctx, TArg const &arg)
 Computes the largest integer value not greater than arg. More...
 
template<typename T , typename Tx , typename Ty , typename Tz >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::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. More...
 
template<typename T , typename Tx , typename Ty >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::fmod (T const &fmod_ctx, Tx const &x, Ty const &y)
 Computes the floating-point remainder of the division operation x/y. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::isfinite (T const &ctx, TArg const &arg)
 Checks if given value is finite. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::isinf (T const &ctx, TArg const &arg)
 Checks if given value is inf. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::isnan (T const &ctx, TArg const &arg)
 Checks if given value is NaN. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::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, regardless of the current rounding mode. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::log (T const &log_ctx, TArg const &arg)
 Computes the the natural (base e) logarithm of arg. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::log10 (T const &log10_ctx, TArg const &arg)
 Computes the the natural (base 10) logarithm of arg. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::log2 (T const &log2_ctx, TArg const &arg)
 Computes the the natural (base 2) logarithm of arg. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::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, regardless of the current rounding mode. More...
 
template<typename T , typename Tx , typename Ty >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::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 value, the numeric value is chosen). More...
 
template<typename T , typename Tx , typename Ty >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::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 value, the numeric value is chosen). More...
 
template<typename T , typename TBase , typename TExp >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::pow (T const &pow_ctx, TBase const &base, TExp const &exp)
 Computes the value of base raised to the power exp. More...
 
template<typename T , typename Tx , typename Ty >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::remainder (T const &remainder_ctx, Tx const &x, Ty const &y)
 Computes the IEEE remainder of the floating point division operation x/y. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::round (T const &round_ctx, TArg const &arg)
 Computes the nearest integer value to arg (in floating-point format), rounding halfway cases away from zero, regardless of the current rounding mode. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::rsqrt (T const &rsqrt_ctx, TArg const &arg)
 Computes the rsqrt. More...
 
template<typename TArg >
ALPAKA_FN_HOST_ACC auto alpaka::math::trait::detail::rsqrt (TArg const &arg)
 Fallback implementation when no better ADL match was found. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::sin (T const &sin_ctx, TArg const &arg)
 Computes the sine (measured in radians). More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::sincos (T const &sincos_ctx, TArg const &arg, TArg &result_sin, TArg &result_cos) -> void
 Computes the sine and cosine (measured in radians). More...
 
template<typename TArg >
ALPAKA_FN_HOST_ACC auto alpaka::math::trait::detail::sincos (TArg const &arg, TArg &result_sin, TArg &result_cos)
 Fallback implementation when no better ADL match was found. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::sinh (T const &sinh_ctx, TArg const &arg)
 Computes the hyperbolic sine (measured in radians). More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::sqrt (T const &sqrt_ctx, TArg const &arg)
 Computes the square root of arg. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::tan (T const &tan_ctx, TArg const &arg)
 Computes the tangent (measured in radians). More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::tanh (T const &tanh_ctx, TArg const &arg)
 Computes the hyperbolic tangent (measured in radians). More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::math::trunc (T const &trunc_ctx, TArg const &arg)
 Computes the nearest integer not greater in magnitude than arg. More...
 

Variables

constexpr double alpaka::math::constants::e = M_E
 
template<typename T >
constexpr T alpaka::math::constants::e_v = static_cast<T>(e)
 
constexpr double alpaka::math::constants::inv_pi = M_1_PI
 
template<typename T >
constexpr T alpaka::math::constants::inv_pi_v = static_cast<T>(inv_pi)
 
constexpr double alpaka::math::constants::ln10 = M_LN10
 
template<typename T >
constexpr T alpaka::math::constants::ln10_v = static_cast<T>(ln10)
 
constexpr double alpaka::math::constants::ln2 = M_LN2
 
template<typename T >
constexpr T alpaka::math::constants::ln2_v = static_cast<T>(ln2)
 
constexpr double alpaka::math::constants::log10e = M_LOG10E
 
template<typename T >
constexpr T alpaka::math::constants::log10e_v = static_cast<T>(log10e)
 
constexpr double alpaka::math::constants::log2e = M_LOG2E
 
template<typename T >
constexpr T alpaka::math::constants::log2e_v = static_cast<T>(log2e)
 
constexpr double alpaka::math::constants::pi = M_PI
 
template<typename T >
constexpr T alpaka::math::constants::pi_v = static_cast<T>(pi)
 
constexpr double alpaka::math::constants::sqrt2 = M_SQRT2
 
template<typename T >
constexpr T alpaka::math::constants::sqrt2_v = static_cast<T>(sqrt2)