Kokkos Core Kernels Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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 void operator= (const complex< InputRealType > &src) volatile
 Assignment operator, for volatile *this and nonvolatile input. 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...
 
KOKKOS_INLINE_FUNCTION void imag (RealType v)
 Set the imaginary part of this complex number. More...
 
KOKKOS_INLINE_FUNCTION void real (RealType v)
 Set the real part of this complex number. 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 61 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 67 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 70 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 75 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 80 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 90 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 106 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 117 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 99 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 124 of file Kokkos_Complex.hpp.

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

Assignment operator, for volatile *this and nonvolatile input.

Parameters
src[in] Input; right-hand side of the assignment.

This operator returns void instead of volatile complex<RealType>& . See Kokkos Issue #177 for the explanation. In practice, this means that you should not chain assignments with volatile lvalues.

Definition at line 141 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 151 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 160 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 169 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 178 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 189 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 196 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 201 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 206 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 211 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 216 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 221 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 226 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 231 of file Kokkos_Complex.hpp.

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

Set the imaginary part of this complex number.

Definition at line 236 of file Kokkos_Complex.hpp.

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

Set the real part of this complex number.

Definition at line 241 of file Kokkos_Complex.hpp.


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