Kokkos Core Kernels Package  Version of the Day
Public Types | Public Member Functions | List of all members
Kokkos::complex< RealType > Class Template Reference

Partial reimplementation of std::complex that works as the result of a Kokkos::parallel_reduce. More...

#include <Kokkos_Complex.hpp>

Public Types

typedef RealType value_type
 The type of the real or imaginary parts of this complex number. More...
 

Public Member Functions

KOKKOS_INLINE_FUNCTION complex ()
 Default constructor (initializes both real and imaginary parts to zero). More...
 
KOKKOS_INLINE_FUNCTION complex (const complex< RealType > &src)
 Copy constructor. More...
 
KOKKOS_INLINE_FUNCTION complex (const volatile complex< RealType > &src)
 Copy constructor from volatile. More...
 
template<class InputRealType >
 complex (const std::complex< InputRealType > &src)
 Conversion constructor from std::complex. More...
 
 operator std::complex< RealType > () const
 Conversion operator to std::complex. More...
 
template<class InputRealType >
KOKKOS_INLINE_FUNCTION complex (const InputRealType &val)
 Constructor that takes just the real part, and sets the imaginary part to zero. More...
 
template<class RealType1 , class RealType2 >
KOKKOS_INLINE_FUNCTION complex (const RealType1 &re, const RealType2 &im)
 Constructor that takes the real and imaginary parts. More...
 
template<class InputRealType >
KOKKOS_INLINE_FUNCTION complex< RealType > & operator= (const complex< InputRealType > &src)
 Assignment operator. More...
 
template<class InputRealType >
KOKKOS_INLINE_FUNCTION volatile complex< RealType > & operator= (const complex< InputRealType > &src) volatile
 Assignment operator. More...
 
template<class InputRealType >
KOKKOS_INLINE_FUNCTION volatile complex< RealType > & operator= (const volatile complex< InputRealType > &src) volatile
 Assignment operator. More...
 
template<class InputRealType >
KOKKOS_INLINE_FUNCTION complex< RealType > & operator= (const volatile complex< InputRealType > &src)
 Assignment operator. More...
 
template<class InputRealType >
KOKKOS_INLINE_FUNCTION complex< RealType > & operator= (const InputRealType &val)
 Assignment operator (from a real number). More...
 
template<class InputRealType >
KOKKOS_INLINE_FUNCTION void operator= (const InputRealType &val) volatile
 Assignment operator (from a real number). More...
 
template<class InputRealType >
complex< RealType > & operator= (const std::complex< InputRealType > &src)
 Assignment operator from std::complex. More...
 
KOKKOS_INLINE_FUNCTION RealType & imag ()
 The imaginary part of this complex number. More...
 
KOKKOS_INLINE_FUNCTION RealType & real ()
 The real part of this complex number. More...
 
KOKKOS_INLINE_FUNCTION const RealType imag () const
 The imaginary part of this complex number. More...
 
KOKKOS_INLINE_FUNCTION const RealType real () const
 The real part of this complex number. More...
 
KOKKOS_INLINE_FUNCTION volatile RealType & imag () volatile
 The imaginary part of this complex number (volatile overload). More...
 
KOKKOS_INLINE_FUNCTION volatile RealType & real () volatile
 The real part of this complex number (volatile overload). More...
 
KOKKOS_INLINE_FUNCTION const RealType imag () const volatile
 The imaginary part of this complex number (volatile overload). More...
 
KOKKOS_INLINE_FUNCTION const RealType real () const volatile
 The real part of this complex number (volatile overload). More...
 

Detailed Description

template<class RealType>
class Kokkos::complex< RealType >

Partial reimplementation of std::complex that works as the result of a Kokkos::parallel_reduce.

Template Parameters
RealTypeThe type of the real and imaginary parts of the complex number. As with std::complex, this is only defined for float, double, and long double. The latter is currently forbidden in CUDA device kernels.

Definition at line 60 of file Kokkos_Complex.hpp.

Member Typedef Documentation

template<class RealType>
typedef RealType Kokkos::complex< RealType >::value_type

The type of the real or imaginary parts of this complex number.

Definition at line 66 of file Kokkos_Complex.hpp.

Constructor & Destructor Documentation

template<class RealType>
KOKKOS_INLINE_FUNCTION Kokkos::complex< RealType >::complex ( )
inline

Default constructor (initializes both real and imaginary parts to zero).

Definition at line 69 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION Kokkos::complex< RealType >::complex ( const complex< RealType > &  src)
inline

Copy constructor.

Definition at line 74 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION Kokkos::complex< RealType >::complex ( const volatile complex< RealType > &  src)
inline

Copy constructor from volatile.

Definition at line 79 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
Kokkos::complex< RealType >::complex ( const std::complex< InputRealType > &  src)
inline

Conversion constructor from std::complex.

This constructor cannot be called in a CUDA device function, because std::complex's methods and nonmember functions are not marked as CUDA device functions.

Definition at line 89 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
KOKKOS_INLINE_FUNCTION Kokkos::complex< RealType >::complex ( const InputRealType &  val)
inline

Constructor that takes just the real part, and sets the imaginary part to zero.

Definition at line 105 of file Kokkos_Complex.hpp.

template<class RealType>
template<class RealType1 , class RealType2 >
KOKKOS_INLINE_FUNCTION Kokkos::complex< RealType >::complex ( const RealType1 &  re,
const RealType2 &  im 
)
inline

Constructor that takes the real and imaginary parts.

Definition at line 111 of file Kokkos_Complex.hpp.

Member Function Documentation

template<class RealType>
Kokkos::complex< RealType >::operator std::complex< RealType > ( ) const
inline

Conversion operator to std::complex.

This operator cannot be called in a CUDA device function, because std::complex's methods and nonmember functions are not marked as CUDA device functions.

Definition at line 98 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
KOKKOS_INLINE_FUNCTION complex<RealType>& Kokkos::complex< RealType >::operator= ( const complex< InputRealType > &  src)
inline

Assignment operator.

Definition at line 118 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
KOKKOS_INLINE_FUNCTION volatile complex<RealType>& Kokkos::complex< RealType >::operator= ( const complex< InputRealType > &  src) volatile
inline

Assignment operator.

Definition at line 127 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
KOKKOS_INLINE_FUNCTION volatile complex<RealType>& Kokkos::complex< RealType >::operator= ( const volatile complex< InputRealType > &  src) volatile
inline

Assignment operator.

Definition at line 136 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
KOKKOS_INLINE_FUNCTION complex<RealType>& Kokkos::complex< RealType >::operator= ( const volatile complex< InputRealType > &  src)
inline

Assignment operator.

Definition at line 145 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
KOKKOS_INLINE_FUNCTION complex<RealType>& Kokkos::complex< RealType >::operator= ( const InputRealType &  val)
inline

Assignment operator (from a real number).

Definition at line 154 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
KOKKOS_INLINE_FUNCTION void Kokkos::complex< RealType >::operator= ( const InputRealType &  val) volatile
inline

Assignment operator (from a real number).

Definition at line 163 of file Kokkos_Complex.hpp.

template<class RealType>
template<class InputRealType >
complex<RealType>& Kokkos::complex< RealType >::operator= ( const std::complex< InputRealType > &  src)
inline

Assignment operator from std::complex.

This constructor cannot be called in a CUDA device function, because std::complex's methods and nonmember functions are not marked as CUDA device functions.

Definition at line 174 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION RealType& Kokkos::complex< RealType >::imag ( )
inline

The imaginary part of this complex number.

Definition at line 181 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION RealType& Kokkos::complex< RealType >::real ( )
inline

The real part of this complex number.

Definition at line 186 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION const RealType Kokkos::complex< RealType >::imag ( ) const
inline

The imaginary part of this complex number.

Definition at line 191 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION const RealType Kokkos::complex< RealType >::real ( ) const
inline

The real part of this complex number.

Definition at line 196 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION volatile RealType& Kokkos::complex< RealType >::imag ( ) volatile
inline

The imaginary part of this complex number (volatile overload).

Definition at line 201 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION volatile RealType& Kokkos::complex< RealType >::real ( ) volatile
inline

The real part of this complex number (volatile overload).

Definition at line 206 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION const RealType Kokkos::complex< RealType >::imag ( ) const volatile
inline

The imaginary part of this complex number (volatile overload).

Definition at line 211 of file Kokkos_Complex.hpp.

template<class RealType>
KOKKOS_INLINE_FUNCTION const RealType Kokkos::complex< RealType >::real ( ) const volatile
inline

The real part of this complex number (volatile overload).

Definition at line 216 of file Kokkos_Complex.hpp.


The documentation for this class was generated from the following file: