alpaka
Abstraction Library for Parallel Kernel Acceleration
alpaka::math Namespace Reference

Namespaces

 constants
 
 trait
 The math traits.
 

Classes

class  AbsStdLib
 The standard library abs, implementation covered by the general template. More...
 
class  AbsUniformCudaHipBuiltIn
 The CUDA built in abs. More...
 
class  AcoshStdLib
 The standard library acos, implementation covered by the general template. More...
 
class  AcoshUniformCudaHipBuiltIn
 The CUDA built in acosh. More...
 
class  AcosStdLib
 The standard library acos, implementation covered by the general template. More...
 
class  AcosUniformCudaHipBuiltIn
 The CUDA built in acos. More...
 
class  ArgStdLib
 The standard library arg, implementation covered by the general template. More...
 
class  ArgUniformCudaHipBuiltIn
 The CUDA built in arg. More...
 
class  AsinhStdLib
 The standard library asinh, implementation covered by the general template. More...
 
class  AsinhUniformCudaHipBuiltIn
 The CUDA built in asinh. More...
 
class  AsinStdLib
 The standard library asin, implementation covered by the general template. More...
 
class  AsinUniformCudaHipBuiltIn
 The CUDA built in asin. More...
 
class  Atan2StdLib
 The standard library atan2, implementation covered by the general template. More...
 
class  Atan2UniformCudaHipBuiltIn
 The CUDA built in atan2. More...
 
class  AtanhStdLib
 The standard library atanh, implementation covered by the general template. More...
 
class  AtanhUniformCudaHipBuiltIn
 The CUDA built in atanh. More...
 
class  AtanStdLib
 The standard library atan, implementation covered by the general template. More...
 
class  AtanUniformCudaHipBuiltIn
 The CUDA built in atan. More...
 
class  CbrtStdLib
 The standard library cbrt, implementation covered by the general template. More...
 
class  CbrtUniformCudaHipBuiltIn
 The CUDA built in cbrt. More...
 
class  CeilStdLib
 The standard library ceil, implementation covered by the general template. More...
 
class  CeilUniformCudaHipBuiltIn
 The CUDA built in ceil. More...
 
struct  ConceptMathAbs
 
struct  ConceptMathAcos
 
struct  ConceptMathAcosh
 
struct  ConceptMathArg
 
struct  ConceptMathAsin
 
struct  ConceptMathAsinh
 
struct  ConceptMathAtan
 
struct  ConceptMathAtan2
 
struct  ConceptMathAtanh
 
struct  ConceptMathCbrt
 
struct  ConceptMathCeil
 
struct  ConceptMathConj
 
struct  ConceptMathCopysign
 
struct  ConceptMathCos
 
struct  ConceptMathCosh
 
struct  ConceptMathErf
 
struct  ConceptMathExp
 
struct  ConceptMathFloor
 
struct  ConceptMathFma
 
struct  ConceptMathFmod
 
struct  ConceptMathIsfinite
 
struct  ConceptMathIsinf
 
struct  ConceptMathIsnan
 
struct  ConceptMathLog
 
struct  ConceptMathLog10
 
struct  ConceptMathLog2
 
struct  ConceptMathMax
 
struct  ConceptMathMin
 
struct  ConceptMathPow
 
struct  ConceptMathRemainder
 
struct  ConceptMathRound
 
struct  ConceptMathRsqrt
 
struct  ConceptMathSin
 
struct  ConceptMathSinCos
 
struct  ConceptMathSinh
 
struct  ConceptMathSqrt
 
struct  ConceptMathTan
 
struct  ConceptMathTanh
 
struct  ConceptMathTrunc
 
class  ConjStdLib
 The standard library conj, implementation covered by the general template. More...
 
class  ConjUniformCudaHipBuiltIn
 The CUDA built in conj. More...
 
class  CopysignStdLib
 The standard library copysign, implementation covered by the general template. More...
 
class  CopysignUniformCudaHipBuiltIn
 The CUDA built in copysign. More...
 
class  CoshStdLib
 The standard library cosh, implementation covered by the general template. More...
 
class  CoshUniformCudaHipBuiltIn
 The CUDA built in cosh. More...
 
class  CosStdLib
 The standard library cos, implementation covered by the general template. More...
 
class  CosUniformCudaHipBuiltIn
 The CUDA built in cos. More...
 
class  ErfStdLib
 The standard library erf, implementation covered by the general template. More...
 
class  ErfUniformCudaHipBuiltIn
 The CUDA built in erf. More...
 
class  ExpStdLib
 The standard library exp, implementation covered by the general template. More...
 
class  ExpUniformCudaHipBuiltIn
 The CUDA built in exp. More...
 
class  FloorStdLib
 The standard library floor, implementation covered by the general template. More...
 
class  FloorUniformCudaHipBuiltIn
 The CUDA built in floor. More...
 
class  FmaStdLib
 The standard library fma, implementation covered by the general template. More...
 
class  FmaUniformCudaHipBuiltIn
 The CUDA built in fma. More...
 
class  FmodStdLib
 The standard library fmod, implementation covered by the general template. More...
 
class  FmodUniformCudaHipBuiltIn
 The CUDA built in fmod. More...
 
class  IsfiniteStdLib
 The standard library isfinite, implementation covered by the general template. More...
 
class  IsfiniteUniformCudaHipBuiltIn
 The CUDA built in isfinite. More...
 
class  IsinfStdLib
 The standard library isinf, implementation covered by the general template. More...
 
class  IsinfUniformCudaHipBuiltIn
 The CUDA built in isinf. More...
 
class  IsnanStdLib
 The standard library isnan, implementation covered by the general template. More...
 
class  IsnanUniformCudaHipBuiltIn
 The CUDA built in isnan. More...
 
class  Log10StdLib
 The standard library log10, implementation covered by the general template. More...
 
class  Log10UniformCudaHipBuiltIn
 
class  Log2StdLib
 The standard library log2, implementation covered by the general template. More...
 
class  Log2UniformCudaHipBuiltIn
 
class  LogStdLib
 The standard library log, implementation covered by the general template. More...
 
class  LogUniformCudaHipBuiltIn
 
class  MathStdLib
 The standard library math trait specializations. More...
 
class  MathUniformCudaHipBuiltIn
 The standard library math trait specializations. More...
 
class  MaxStdLib
 The standard library max. More...
 
class  MaxUniformCudaHipBuiltIn
 The CUDA built in max. More...
 
class  MinStdLib
 The standard library min. More...
 
class  MinUniformCudaHipBuiltIn
 The CUDA built in min. More...
 
class  PowStdLib
 The standard library pow, implementation covered by the general template. More...
 
class  PowUniformCudaHipBuiltIn
 The CUDA built in pow. More...
 
class  RemainderStdLib
 The standard library remainder, implementation covered by the general template. More...
 
class  RemainderUniformCudaHipBuiltIn
 The CUDA built in remainder. More...
 
class  RoundStdLib
 The standard library round, implementation covered by the general template. More...
 
class  RoundUniformCudaHipBuiltIn
 The CUDA round. More...
 
class  RsqrtStdLib
 The standard library rsqrt, implementation covered by the general template. More...
 
class  RsqrtUniformCudaHipBuiltIn
 The CUDA rsqrt. More...
 
class  SinCosStdLib
 The standard library sincos, implementation covered by the general template. More...
 
class  SinCosUniformCudaHipBuiltIn
 The CUDA sincos. More...
 
class  SinhStdLib
 The standard library sinh, implementation covered by the general template. More...
 
class  SinhUniformCudaHipBuiltIn
 The CUDA sinh. More...
 
class  SinStdLib
 The standard library sin, implementation covered by the general template. More...
 
class  SinUniformCudaHipBuiltIn
 The CUDA sin. More...
 
class  SqrtStdLib
 The standard library sqrt, implementation covered by the general template. More...
 
class  SqrtUniformCudaHipBuiltIn
 The CUDA sqrt. More...
 
class  TanhStdLib
 The standard library tanh, implementation covered by the general template. More...
 
class  TanhUniformCudaHipBuiltIn
 The CUDA tanh. More...
 
class  TanStdLib
 The standard library tan, implementation covered by the general template. More...
 
class  TanUniformCudaHipBuiltIn
 The CUDA tan. More...
 
class  TruncStdLib
 The standard library trunc, implementation covered by the general template. More...
 
class  TruncUniformCudaHipBuiltIn
 The CUDA trunc. More...
 

Functions

template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 >
ALPAKA_FN_INLINE ALPAKA_FN_HOST_ACC auto floatEqualExactNoWarning (T a, T b) -> bool
 
template<typename T , typename TArg >
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. More...
 
template<typename T , typename Tx , typename Ty , typename Tz >
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. More...
 
template<typename T , typename Tx , typename Ty >
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. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto 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 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 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 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 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 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 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 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 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 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 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 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 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 rsqrt (T const &rsqrt_ctx, TArg const &arg)
 Computes the rsqrt. More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto 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 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 T , typename TArg >
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). More...
 
template<typename T , typename TArg >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto 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 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 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 trunc (T const &trunc_ctx, TArg const &arg)
 Computes the nearest integer not greater in magnitude than arg. More...
 

Function Documentation

◆ abs()

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.

Template Parameters
TThe type of the object specializing Abs.
TArgThe arg type.
Parameters
abs_ctxThe object specializing Abs.
argThe arg.

Definition at line 864 of file Traits.hpp.

◆ acos()

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.

The valid real argument range is [-1.0, 1.0]. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TArgThe arg type.
Parameters
acos_ctxThe object specializing Acos.
argThe arg.

Definition at line 881 of file Traits.hpp.

◆ acosh()

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.

The valid real argument range is [1.0, Inf]. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TArgThe arg type.
Parameters
acosh_ctxThe object specializing Acos.
argThe arg.

Definition at line 898 of file Traits.hpp.

◆ arg()

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.

Template Parameters
TThe type of the object specializing Arg.
TArgumentThe argument type.
Parameters
arg_ctxThe object specializing Arg.
argumentThe argument.

Definition at line 912 of file Traits.hpp.

◆ asin()

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.

The valid real argument range is [-1.0, 1.0]. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TArgThe arg type.
Parameters
asin_ctxThe object specializing Asin.
argThe arg.

Definition at line 929 of file Traits.hpp.

◆ asinh()

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.

Template Parameters
TArgThe arg type.
Parameters
asinh_ctxThe object specializing Asin.
argThe arg.

Definition at line 942 of file Traits.hpp.

◆ atan()

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.

Template Parameters
TArgThe arg type.
Parameters
atan_ctxThe object specializing Atan.
argThe arg.

Definition at line 955 of file Traits.hpp.

◆ atan2()

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.

Template Parameters
TThe type of the object specializing Atan2.
TyThe y arg type.
TxThe x arg type.
Parameters
atan2_ctxThe object specializing Atan2.
yThe y arg.
xThe x arg.

Definition at line 988 of file Traits.hpp.

◆ atanh()

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.

The valid real argument range is [-1.0, 1.0]. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TArgThe arg type.
Parameters
atanh_ctxThe object specializing Atanh.
argThe arg.

Definition at line 972 of file Traits.hpp.

◆ cbrt()

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.

Template Parameters
TThe type of the object specializing Cbrt.
TArgThe arg type.
Parameters
cbrt_ctxThe object specializing Cbrt.
argThe arg.

Definition at line 1002 of file Traits.hpp.

◆ ceil()

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.

Template Parameters
TThe type of the object specializing Ceil.
TArgThe arg type.
Parameters
ceil_ctxThe object specializing Ceil.
argThe arg.

Definition at line 1016 of file Traits.hpp.

◆ conj()

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.

Template Parameters
TThe type of the object specializing Conj.
TArgThe arg type.
Parameters
conj_ctxThe object specializing Conj.
argThe arg.

Definition at line 1030 of file Traits.hpp.

◆ copysign()

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.

Template Parameters
TThe type of the object specializing Copysign.
TMagThe mag type.
TSgnThe sgn type.
Parameters
copysign_ctxThe object specializing Copysign.
magThe mag.
sgnThe sgn.

Definition at line 1046 of file Traits.hpp.

◆ cos()

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).

Template Parameters
TThe type of the object specializing Cos.
TArgThe arg type.
Parameters
cos_ctxThe object specializing Cos.
argThe arg.

Definition at line 1060 of file Traits.hpp.

◆ cosh()

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).

Template Parameters
TThe type of the object specializing Cos.
TArgThe arg type.
Parameters
cosh_ctxThe object specializing Cos.
argThe arg.

Definition at line 1074 of file Traits.hpp.

◆ erf()

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.

Template Parameters
TThe type of the object specializing Erf.
TArgThe arg type.
Parameters
erf_ctxThe object specializing Erf.
argThe arg.

Definition at line 1088 of file Traits.hpp.

◆ exp()

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.

Template Parameters
TThe type of the object specializing Exp.
TArgThe arg type.
Parameters
exp_ctxThe object specializing Exp.
argThe arg.

Definition at line 1102 of file Traits.hpp.

◆ floatEqualExactNoWarning()

template<typename T >
ALPAKA_FN_INLINE ALPAKA_FN_HOST_ACC auto alpaka::math::floatEqualExactNoWarning ( a,
b 
) -> bool

Compare two floating point numbers for exact equivalence. Use only when necessary, and be aware of the implications. Most codes should not use this function and instead implement a correct epsilon-based comparison. If you are unfamiliar with the topic, check out https://www.geeksforgeeks.org/problem-in-comparing-floating-point-numbers-and-how-to-compare-them-correctly/ or Goldberg 1991: "What every computer scientist should know about floating-point arithmetic", https://dl.acm.org/doi/10.1145/103162.103163

This function calls the == operator for floating point types, but disables the warning issued by the compiler when compiling with the float equality warning checks enabled. This warning is valid an valuable in most codes and should be generally enabled, but there are specific instances where a piece of code might need to do an exact comparison (e.g. CudaVectorArrayWrapperTest.cpp). The verbose name for the function is intentional as it should raise a red flag if used while not absolutely needed. Users are advised to add a justification whenever they use this function.

Template Parameters
Tboth operands have to be the same type and conform to std::is_floating_point
Parameters
afirst operand
bsecond operand
Returns
a == b

Definition at line 35 of file FloatEqualExact.hpp.

◆ floor()

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.

Template Parameters
TThe type of the object specializing Floor.
TArgThe arg type.
Parameters
floor_ctxThe object specializing Floor.
argThe arg.

Definition at line 1116 of file Traits.hpp.

◆ fma()

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.

Template Parameters
TThe type of the object specializing Fma.
TxThe type of the first argument.
TyThe type of the second argument.
TzThe type of the third argument.
Parameters
fma_ctxThe object specializing .
xThe first argument.
yThe second argument.
zThe third argument.

Definition at line 1134 of file Traits.hpp.

◆ fmod()

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.

Template Parameters
TThe type of the object specializing Fmod.
TxThe type of the first argument.
TyThe type of the second argument.
Parameters
fmod_ctxThe object specializing Fmod.
xThe first argument.
yThe second argument.

Definition at line 1150 of file Traits.hpp.

◆ isfinite()

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.

Template Parameters
TThe type of the object specializing Isfinite.
TArgThe arg type.
Parameters
ctxThe object specializing Isfinite.
argThe arg.

Definition at line 1164 of file Traits.hpp.

◆ isinf()

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.

Template Parameters
TThe type of the object specializing Isinf.
TArgThe arg type.
Parameters
ctxThe object specializing Isinf.
argThe arg.

Definition at line 1178 of file Traits.hpp.

◆ isnan()

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.

Template Parameters
TThe type of the object specializing Isnan.
TArgThe arg type.
Parameters
ctxThe object specializing Isnan.
argThe arg.

Definition at line 1192 of file Traits.hpp.

◆ llround()

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.

Template Parameters
TThe type of the object specializing Round.
TArgThe arg type.
Parameters
llround_ctxThe object specializing Round.
argThe arg.

Definition at line 1361 of file Traits.hpp.

◆ log()

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.

Valid real arguments are non-negative. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TThe type of the object specializing Log.
TArgThe arg type.
Parameters
log_ctxThe object specializing Log.
argThe arg.

Definition at line 1210 of file Traits.hpp.

◆ log10()

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.

Valid real arguments are non-negative. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TThe type of the object specializing Log10.
TArgThe arg type.
Parameters
log10_ctxThe object specializing Log10.
argThe arg.

Definition at line 1246 of file Traits.hpp.

◆ log2()

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.

Valid real arguments are non-negative. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TThe type of the object specializing Log2.
TArgThe arg type.
Parameters
log2_ctxThe object specializing Log2.
argThe arg.

Definition at line 1228 of file Traits.hpp.

◆ lround()

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.

Template Parameters
TThe type of the object specializing Round.
TArgThe arg type.
Parameters
lround_ctxThe object specializing Round.
argThe arg.

Definition at line 1346 of file Traits.hpp.

◆ max()

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).

Template Parameters
TThe type of the object specializing Max.
TxThe type of the first argument.
TyThe type of the second argument.
Parameters
max_ctxThe object specializing Max.
xThe first argument.
yThe second argument.

Definition at line 1263 of file Traits.hpp.

◆ min()

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).

Template Parameters
TThe type of the object specializing Min.
TxThe type of the first argument.
TyThe type of the second argument.
Parameters
min_ctxThe object specializing Min.
xThe first argument.
yThe second argument.

Definition at line 1280 of file Traits.hpp.

◆ pow()

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.

Valid real arguments for base are non-negative. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TThe type of the object specializing Pow.
TBaseThe base type.
TExpThe exponent type.
Parameters
pow_ctxThe object specializing Pow.
baseThe base.
expThe exponent.

Definition at line 1300 of file Traits.hpp.

◆ remainder()

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.

Template Parameters
TThe type of the object specializing Remainder.
TxThe type of the first argument.
TyThe type of the second argument.
Parameters
remainder_ctxThe object specializing Max.
xThe first argument.
yThe second argument.

Definition at line 1316 of file Traits.hpp.

◆ round()

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.

Template Parameters
TThe type of the object specializing Round.
TArgThe arg type.
Parameters
round_ctxThe object specializing Round.
argThe arg.

Definition at line 1331 of file Traits.hpp.

◆ rsqrt()

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.

Valid real arguments are positive. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TThe type of the object specializing Rsqrt.
TArgThe arg type.
Parameters
rsqrt_ctxThe object specializing Rsqrt.
argThe arg.

Definition at line 1379 of file Traits.hpp.

◆ sin()

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).

Template Parameters
TThe type of the object specializing Sin.
TArgThe arg type.
Parameters
sin_ctxThe object specializing Sin.
argThe arg.

Definition at line 1393 of file Traits.hpp.

◆ sincos()

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).

Template Parameters
TThe type of the object specializing SinCos.
TArgThe arg type.
Parameters
sincos_ctxThe object specializing SinCos.
argThe arg.
result_sinresult of sine
result_cosresult of cosine

Definition at line 1423 of file Traits.hpp.

◆ sinh()

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).

Template Parameters
TThe type of the object specializing Sin.
TArgThe arg type.
Parameters
sinh_ctxThe object specializing Sin.
argThe arg.

Definition at line 1407 of file Traits.hpp.

◆ sqrt()

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.

Valid real arguments are non-negative. For other values the result may depend on the backend and compilation options, will likely be NaN.

Template Parameters
TThe type of the object specializing Sqrt.
TArgThe arg type.
Parameters
sqrt_ctxThe object specializing Sqrt.
argThe arg.

Definition at line 1441 of file Traits.hpp.

◆ tan()

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).

Template Parameters
TThe type of the object specializing Tan.
TArgThe arg type.
Parameters
tan_ctxThe object specializing Tan.
argThe arg.

Definition at line 1455 of file Traits.hpp.

◆ tanh()

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).

Template Parameters
TThe type of the object specializing Tanh.
TArgThe arg type.
Parameters
tanh_ctxThe object specializing Tanh.
argThe arg.

Definition at line 1469 of file Traits.hpp.

◆ trunc()

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.

Template Parameters
TThe type of the object specializing Trunc.
TArgThe arg type.
Parameters
trunc_ctxThe object specializing Trunc.
argThe arg.

Definition at line 1483 of file Traits.hpp.