A host / device complex number type, because std::complex doesn't work in device code with Cuda yet. More...
#include <AMReX_GpuComplex.H>
Public Types | |
using | value_type = T |
Public Member Functions | |
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE | GpuComplex (const T &a_r=T(), const T &a_i=T()) noexcept |
Construct a complex number given the real and imaginary part. More... | |
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T | real () const noexcept |
Return the real part. More... | |
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T | imag () const noexcept |
Return the imaginary part. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > & | operator+= (const T &a_t) noexcept |
Add a real number to this complex number. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > & | operator-= (const T &a_t) noexcept |
Subtract a real number from this complex number. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > & | operator*= (const T &a_t) noexcept |
Multiply this complex number by a real. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > & | operator/= (const T &a_t) noexcept |
Divide this complex number by a real. More... | |
template<typename U > | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > & | operator+= (const GpuComplex< U > &a_z) noexcept |
Add another complex number to this one. More... | |
template<typename U > | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > & | operator-= (const GpuComplex< U > &a_z) noexcept |
Subtract another complex number from this one. More... | |
template<typename U > | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > & | operator*= (const GpuComplex< U > &a_z) noexcept |
Multiply this complex number by another one. More... | |
template<typename U > | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > & | operator/= (const GpuComplex< U > &a_z) noexcept |
Divide this complex number by another one. More... | |
Public Attributes | |
T | m_real |
T | m_imag |
Friends | |
template<typename U > | |
std::ostream & | operator<< (std::ostream &out, const GpuComplex< U > &c) |
Print this complex number to an ostream. More... | |
A host / device complex number type, because std::complex doesn't work in device code with Cuda yet.
Should be bit-wise compatible with std::complex.
GpuComplex is aligned to its size (stricter than std::complex) to allow for coalesced memory accesses with nvidia GPUs.
using amrex::GpuComplex< T >::value_type = T |
|
inlineconstexprnoexcept |
Construct a complex number given the real and imaginary part.
|
inlineconstexprnoexcept |
Return the imaginary part.
|
inlinenoexcept |
Multiply this complex number by another one.
|
inlinenoexcept |
Multiply this complex number by a real.
|
inlinenoexcept |
Add another complex number to this one.
|
inlinenoexcept |
Add a real number to this complex number.
|
inlinenoexcept |
Subtract another complex number from this one.
|
inlinenoexcept |
Subtract a real number from this complex number.
|
inlinenoexcept |
Divide this complex number by another one.
|
inlinenoexcept |
Divide this complex number by a real.
|
inlineconstexprnoexcept |
Return the real part.
|
friend |
Print this complex number to an ostream.
T amrex::GpuComplex< T >::m_imag |
T amrex::GpuComplex< T >::m_real |