Block-Structured AMR Software Framework
AMReX_GpuComplex.H File Reference
#include <AMReX_Config.H>
#include <AMReX_Algorithm.H>
#include <AMReX_Math.H>
#include <cmath>
#include <iostream>

Go to the source code of this file.

Classes

struct  amrex::GpuComplex< T >
 A host / device complex number type, because std::complex doesn't work in device code with Cuda yet. More...
 

Namespaces

 amrex
 
 amrex::detail
 

Functions

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEamrex::norm (const GpuComplex< T > &a_z) noexcept
 Return the norm (magnitude squared) of a complex number. More...
 
template<typename U >
std::ostream & amrex::operator<< (std::ostream &out, const GpuComplex< U > &c)
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator+ (const GpuComplex< T > &a_x)
 Identity operation on a complex number. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator- (const GpuComplex< T > &a_x)
 Negate a complex number. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator- (const GpuComplex< T > &a_x, const GpuComplex< T > &a_y) noexcept
 Subtract two complex numbers. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator- (const GpuComplex< T > &a_x, const T &a_y) noexcept
 Subtract a real number from a complex one. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator- (const T &a_x, const GpuComplex< T > &a_y) noexcept
 Subtract a complex number from a real one. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator+ (const GpuComplex< T > &a_x, const GpuComplex< T > &a_y) noexcept
 Add two complex numbers. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator+ (const GpuComplex< T > &a_x, const T &a_y) noexcept
 Add a real number to a complex one. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator+ (const T &a_x, const GpuComplex< T > &a_y) noexcept
 Add a complex number to a real one. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator* (const GpuComplex< T > &a_x, const GpuComplex< T > &a_y) noexcept
 Multiply two complex numbers. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator* (const GpuComplex< T > &a_x, const T &a_y) noexcept
 Multiply a complex number by a real one. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator* (const T &a_x, const GpuComplex< T > &a_y) noexcept
 Multiply a real number by a complex one. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator/ (const GpuComplex< T > &a_x, const GpuComplex< T > &a_y) noexcept
 Divide a complex number by another one. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator/ (const GpuComplex< T > &a_x, const T &a_y) noexcept
 Divide a complex number by a real. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::operator/ (const T &a_x, const GpuComplex< T > &a_y) noexcept
 Divide a real number by a complex one. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::polar (const T &a_r, const T &a_theta) noexcept
 Return a complex number given its polar representation. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::exp (const GpuComplex< T > &a_z) noexcept
 Complex expotential function. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEamrex::abs (const GpuComplex< T > &a_z) noexcept
 Return the absolute value of a complex number. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::sqrt (const GpuComplex< T > &a_z) noexcept
 Return the square root of a complex number. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEamrex::arg (const GpuComplex< T > &a_z) noexcept
 Return the angle of a complex number's polar representation. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::log (const GpuComplex< T > &a_z) noexcept
 Complex natural logarithm function. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::pow (const GpuComplex< T > &a_z, const T &a_y) noexcept
 Raise a complex number to a (real) power. More...
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::detail::complex_pow_unsigned (GpuComplex< T > a_z, unsigned a_n)
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > amrex::pow (const GpuComplex< T > &a_z, int a_n) noexcept
 Raise a complex number to an integer power. More...