A host / device complex number type, because std::complex doesn't work in device code with Cuda yet.
More...
|
| __host__ __device__ constexpr | GpuComplex (const T &a_r=T(), const T &a_i=T()) noexcept |
| | Construct a complex number given the real and imaginary part.
|
| |
| __host__ __device__ constexpr T | real () const noexcept |
| | Return the real part.
|
| |
| __host__ __device__ constexpr T | imag () const noexcept |
| | Return the imaginary part.
|
| |
| template<typename U > |
| __host__ __device__ GpuComplex< T > & | operator+= (const U &a_t) noexcept |
| | Add a real number to this complex number.
|
| |
| template<typename U > |
| __host__ __device__ GpuComplex< T > & | operator-= (const U &a_t) noexcept |
| | Subtract a real number from this complex number.
|
| |
| template<typename U > |
| __host__ __device__ GpuComplex< T > & | operator*= (const U &a_t) noexcept |
| | Multiply this complex number by a real.
|
| |
| template<typename U > |
| __host__ __device__ GpuComplex< T > & | operator/= (const U &a_t) noexcept |
| | Divide this complex number by a real.
|
| |
| template<typename U > |
| __host__ __device__ GpuComplex< T > & | operator+= (const GpuComplex< U > &a_z) noexcept |
| | Add another complex number to this one.
|
| |
| template<typename U > |
| __host__ __device__ GpuComplex< T > & | operator-= (const GpuComplex< U > &a_z) noexcept |
| | Subtract another complex number from this one.
|
| |
| template<typename U > |
| __host__ __device__ GpuComplex< T > & | operator*= (const GpuComplex< U > &a_z) noexcept |
| | Multiply this complex number by another one.
|
| |
| template<typename U > |
| __host__ __device__ GpuComplex< T > & | operator/= (const GpuComplex< U > &a_z) noexcept |
| | Divide this complex number by another one.
|
| |
template<typename T>
struct amrex::GpuComplex< T >
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.