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

Classes

class  Complex
 Implementation of a complex number useable on host and device. More...
 
struct  ViewAccessOps
 

Functions

template<typename T , typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &os, Complex< T > const &x)
 Host-only output of a complex number. More...
 
template<typename T , typename TChar , typename TTraits >
std::basic_istream< TChar, TTraits > & operator>> (std::basic_istream< TChar, TTraits > &is, Complex< T > const &x)
 Host-only input of a complex number. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator+ (Complex< T > const &val)
 Host-device arithmetic operations matching std::complex<T>. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator- (Complex< T > const &val)
 Unary minus. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator+ (Complex< T > const &lhs, Complex< T > const &rhs)
 Addition of two complex numbers. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator+ (Complex< T > const &lhs, T const &rhs)
 Addition of a complex and a real number. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator+ (T const &lhs, Complex< T > const &rhs)
 Addition of a real and a complex number. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator- (Complex< T > const &lhs, Complex< T > const &rhs)
 Subtraction of two complex numbers. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator- (Complex< T > const &lhs, T const &rhs)
 Subtraction of a complex and a real number. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator- (T const &lhs, Complex< T > const &rhs)
 Subtraction of a real and a complex number. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator* (Complex< T > const &lhs, Complex< T > const &rhs)
 Muptiplication of two complex numbers. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator* (Complex< T > const &lhs, T const &rhs)
 Muptiplication of a complex and a real number. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator* (T const &lhs, Complex< T > const &rhs)
 Muptiplication of a real and a complex number. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator/ (Complex< T > const &lhs, Complex< T > const &rhs)
 Division of two complex numbers. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator/ (Complex< T > const &lhs, T const &rhs)
 Division of complex and a real number. More...
 
template<typename T >
ALPAKA_FN_HOST_ACC Complex< T > operator/ (T const &lhs, Complex< T > const &rhs)
 Division of a real and a complex number. More...
 
template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool operator== (Complex< T > const &lhs, Complex< T > const &rhs)
 Equality of two complex numbers. More...
 
template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool operator== (Complex< T > const &lhs, T const &rhs)
 Equality of a complex and a real number. More...
 
template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool operator== (T const &lhs, Complex< T > const &rhs)
 Equality of a real and a complex number. More...
 
template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool operator!= (Complex< T > const &lhs, Complex< T > const &rhs)
 Inequality of two complex numbers. More...
 
template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool operator!= (Complex< T > const &lhs, T const &rhs)
 Inequality of a complex and a real number. More...
 
template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool operator!= (T const &lhs, Complex< T > const &rhs)
 Inequality of a real and a complex number. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACCabs (Complex< T > const &x)
 Host-only math functions matching std::complex<T>. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > acos (Complex< T > const &x)
 Arc cosine. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > acosh (Complex< T > const &x)
 Arc hyperbolic cosine. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACCarg (Complex< T > const &x)
 Argument. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > asin (Complex< T > const &x)
 Arc sine. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > asinh (Complex< T > const &x)
 Arc hyperbolic sine. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > atan (Complex< T > const &x)
 Arc tangent. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > atanh (Complex< T > const &x)
 Arc hyperbolic tangent. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > conj (Complex< T > const &x)
 Complex conjugate. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > cos (Complex< T > const &x)
 Cosine. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > cosh (Complex< T > const &x)
 Hyperbolic cosine. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > exp (Complex< T > const &x)
 Exponential. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > log (Complex< T > const &x)
 Natural logarithm. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > log10 (Complex< T > const &x)
 Base 10 logarithm. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACCnorm (Complex< T > const &x)
 Squared magnitude. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > polar (T const &r, T const &theta=T())
 Get a complex number with given magnitude and phase angle. More...
 
template<typename T , typename U >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto pow (Complex< T > const &x, Complex< U > const &y)
 Complex power of a complex number. More...
 
template<typename T , typename U >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto pow (Complex< T > const &x, U const &y)
 Real power of a complex number. More...
 
template<typename T , typename U >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto pow (T const &x, Complex< U > const &y)
 Complex power of a real number. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > proj (Complex< T > const &x)
 Projection onto the Riemann sphere. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > sin (Complex< T > const &x)
 Sine. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > sinh (Complex< T > const &x)
 Hyperbolic sine. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > sqrt (Complex< T > const &x)
 Square root. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > tan (Complex< T > const &x)
 Tangent. More...
 
template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex< T > tanh (Complex< T > const &x)
 Hyperbolic tangent. More...
 

Variables

template<typename T , typename SFINAE = void>
constexpr bool isView = false
 

Function Documentation

◆ abs()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC T alpaka::internal::abs ( Complex< T > const &  x)
constexpr

Host-only math functions matching std::complex<T>.

Due to issue #1688, these functions are technically marked host-device and suppress related warnings. However, they must be called for host only.

They take and return alpaka::Complex (or a real number when appropriate). Internally cast, fall back to std::complex implementation and cast back. These functions can be used directly on the host side. They are also picked up by ADL in math traits for CPU backends.

On the device side, alpaka math traits must be used instead. Note that the set of the traits is currently a bit smaller. Absolute value

Definition at line 378 of file Complex.hpp.

◆ acos()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::acos ( Complex< T > const &  x)
constexpr

Arc cosine.

Definition at line 386 of file Complex.hpp.

◆ acosh()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::acosh ( Complex< T > const &  x)
constexpr

Arc hyperbolic cosine.

Definition at line 394 of file Complex.hpp.

◆ arg()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC T alpaka::internal::arg ( Complex< T > const &  x)
constexpr

Argument.

Definition at line 402 of file Complex.hpp.

◆ asin()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::asin ( Complex< T > const &  x)
constexpr

Arc sine.

Definition at line 410 of file Complex.hpp.

◆ asinh()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::asinh ( Complex< T > const &  x)
constexpr

Arc hyperbolic sine.

Definition at line 418 of file Complex.hpp.

◆ atan()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::atan ( Complex< T > const &  x)
constexpr

Arc tangent.

Definition at line 426 of file Complex.hpp.

◆ atanh()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::atanh ( Complex< T > const &  x)
constexpr

Arc hyperbolic tangent.

Definition at line 434 of file Complex.hpp.

◆ conj()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::conj ( Complex< T > const &  x)
constexpr

Complex conjugate.

Definition at line 442 of file Complex.hpp.

◆ cos()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::cos ( Complex< T > const &  x)
constexpr

Cosine.

Definition at line 450 of file Complex.hpp.

◆ cosh()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::cosh ( Complex< T > const &  x)
constexpr

Hyperbolic cosine.

Definition at line 458 of file Complex.hpp.

◆ exp()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::exp ( Complex< T > const &  x)
constexpr

Exponential.

Definition at line 466 of file Complex.hpp.

◆ log()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::log ( Complex< T > const &  x)
constexpr

Natural logarithm.

Definition at line 474 of file Complex.hpp.

◆ log10()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::log10 ( Complex< T > const &  x)
constexpr

Base 10 logarithm.

Definition at line 482 of file Complex.hpp.

◆ norm()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC T alpaka::internal::norm ( Complex< T > const &  x)
constexpr

Squared magnitude.

Definition at line 490 of file Complex.hpp.

◆ operator!=() [1/3]

template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool alpaka::internal::operator!= ( Complex< T > const &  lhs,
Complex< T > const &  rhs 
)
constexpr

Inequality of two complex numbers.

Note
this and other versions of operator != should be removed since C++20, as so does std::complex

Definition at line 318 of file Complex.hpp.

◆ operator!=() [2/3]

template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool alpaka::internal::operator!= ( Complex< T > const &  lhs,
T const &  rhs 
)
constexpr

Inequality of a complex and a real number.

Definition at line 325 of file Complex.hpp.

◆ operator!=() [3/3]

template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool alpaka::internal::operator!= ( T const &  lhs,
Complex< T > const &  rhs 
)
constexpr

Inequality of a real and a complex number.

Definition at line 333 of file Complex.hpp.

◆ operator*() [1/3]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator* ( Complex< T > const &  lhs,
Complex< T > const &  rhs 
)

Muptiplication of two complex numbers.

Definition at line 242 of file Complex.hpp.

◆ operator*() [2/3]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator* ( Complex< T > const &  lhs,
T const &  rhs 
)

Muptiplication of a complex and a real number.

Definition at line 251 of file Complex.hpp.

◆ operator*() [3/3]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator* ( T const &  lhs,
Complex< T > const &  rhs 
)

Muptiplication of a real and a complex number.

Definition at line 258 of file Complex.hpp.

◆ operator+() [1/4]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator+ ( Complex< T > const &  lhs,
Complex< T > const &  rhs 
)

Addition of two complex numbers.

Definition at line 200 of file Complex.hpp.

◆ operator+() [2/4]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator+ ( Complex< T > const &  lhs,
T const &  rhs 
)

Addition of a complex and a real number.

Definition at line 207 of file Complex.hpp.

◆ operator+() [3/4]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator+ ( Complex< T > const &  val)

Host-device arithmetic operations matching std::complex<T>.

They take and return alpaka::Complex. Unary plus (added for compatibility with std::complex)

Definition at line 186 of file Complex.hpp.

◆ operator+() [4/4]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator+ ( T const &  lhs,
Complex< T > const &  rhs 
)

Addition of a real and a complex number.

Definition at line 214 of file Complex.hpp.

◆ operator-() [1/4]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator- ( Complex< T > const &  lhs,
Complex< T > const &  rhs 
)

Subtraction of two complex numbers.

Definition at line 221 of file Complex.hpp.

◆ operator-() [2/4]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator- ( Complex< T > const &  lhs,
T const &  rhs 
)

Subtraction of a complex and a real number.

Definition at line 228 of file Complex.hpp.

◆ operator-() [3/4]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator- ( Complex< T > const &  val)

Unary minus.

Definition at line 193 of file Complex.hpp.

◆ operator-() [4/4]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator- ( T const &  lhs,
Complex< T > const &  rhs 
)

Subtraction of a real and a complex number.

Definition at line 235 of file Complex.hpp.

◆ operator/() [1/3]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator/ ( Complex< T > const &  lhs,
Complex< T > const &  rhs 
)

Division of two complex numbers.

Definition at line 265 of file Complex.hpp.

◆ operator/() [2/3]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator/ ( Complex< T > const &  lhs,
T const &  rhs 
)

Division of complex and a real number.

Definition at line 276 of file Complex.hpp.

◆ operator/() [3/3]

template<typename T >
ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::operator/ ( T const &  lhs,
Complex< T > const &  rhs 
)

Division of a real and a complex number.

Definition at line 283 of file Complex.hpp.

◆ operator<<()

template<typename T , typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& alpaka::internal::operator<< ( std::basic_ostream< TChar, TTraits > &  os,
Complex< T > const &  x 
)

Host-only output of a complex number.

Definition at line 333 of file Complex.hpp.

◆ operator==() [1/3]

template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool alpaka::internal::operator== ( Complex< T > const &  lhs,
Complex< T > const &  rhs 
)
constexpr

Equality of two complex numbers.

Definition at line 292 of file Complex.hpp.

◆ operator==() [2/3]

template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool alpaka::internal::operator== ( Complex< T > const &  lhs,
T const &  rhs 
)
constexpr

Equality of a complex and a real number.

Definition at line 300 of file Complex.hpp.

◆ operator==() [3/3]

template<typename T >
constexpr ALPAKA_FN_HOST_ACC bool alpaka::internal::operator== ( T const &  lhs,
Complex< T > const &  rhs 
)
constexpr

Equality of a real and a complex number.

Definition at line 308 of file Complex.hpp.

◆ operator>>()

template<typename T , typename TChar , typename TTraits >
std::basic_istream<TChar, TTraits>& alpaka::internal::operator>> ( std::basic_istream< TChar, TTraits > &  is,
Complex< T > const &  x 
)

Host-only input of a complex number.

Definition at line 351 of file Complex.hpp.

◆ polar()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::polar ( T const &  r,
T const &  theta = T() 
)
constexpr

Get a complex number with given magnitude and phase angle.

Definition at line 498 of file Complex.hpp.

◆ pow() [1/3]

template<typename T , typename U >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::internal::pow ( Complex< T > const &  x,
Complex< U > const &  y 
)
constexpr

Complex power of a complex number.

Definition at line 506 of file Complex.hpp.

◆ pow() [2/3]

template<typename T , typename U >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::internal::pow ( Complex< T > const &  x,
U const &  y 
)
constexpr

Real power of a complex number.

Definition at line 517 of file Complex.hpp.

◆ pow() [3/3]

template<typename T , typename U >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto alpaka::internal::pow ( T const &  x,
Complex< U > const &  y 
)
constexpr

Complex power of a real number.

Definition at line 525 of file Complex.hpp.

◆ proj()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::proj ( Complex< T > const &  x)
constexpr

Projection onto the Riemann sphere.

Definition at line 533 of file Complex.hpp.

◆ sin()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::sin ( Complex< T > const &  x)
constexpr

Sine.

Definition at line 541 of file Complex.hpp.

◆ sinh()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::sinh ( Complex< T > const &  x)
constexpr

Hyperbolic sine.

Definition at line 549 of file Complex.hpp.

◆ sqrt()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::sqrt ( Complex< T > const &  x)
constexpr

Square root.

Definition at line 557 of file Complex.hpp.

◆ tan()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::tan ( Complex< T > const &  x)
constexpr

Tangent.

Definition at line 565 of file Complex.hpp.

◆ tanh()

template<typename T >
constexpr ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC Complex<T> alpaka::internal::tanh ( Complex< T > const &  x)
constexpr

Hyperbolic tangent.

Definition at line 573 of file Complex.hpp.

Variable Documentation

◆ isView

template<typename T , typename SFINAE = void>
constexpr bool alpaka::internal::isView = false
inlineconstexpr

Definition at line 20 of file ViewAccessOps.hpp.