GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
cu_complex.h File Reference

Inline template functions for CUDA complex number handling. More...

#include <cuComplex.h>
Include dependency graph for cu_complex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
__device__ __host__ void zero (T &val)
 
template<>
__device__ __host__ void zero< cuFloatComplex > (cuFloatComplex &val)
 
template<>
__device__ __host__ void zero< cuDoubleComplex > (cuDoubleComplex &val)
 
template<typename T >
__device__ __host__ void one (T &val)
 
template<>
__device__ __host__ void one< cuFloatComplex > (cuFloatComplex &val)
 
template<>
__device__ __host__ void one< cuDoubleComplex > (cuDoubleComplex &val)
 
template<typename T , typename T_b >
__device__ void fromReal (T &val, T_b real)
 
template<>
__device__ void fromReal< cuDoubleComplex, double > (cuDoubleComplex &val, double real)
 
template<>
__device__ void fromReal< cuFloatComplex, float > (cuFloatComplex &val, float real)
 
template<typename T , typename T_b >
__device__ T_b Real (T val)
 
template<>
__device__ double Real< cuDoubleComplex, double > (cuDoubleComplex val)
 
template<>
__device__ float Real< cuFloatComplex, float > (cuFloatComplex val)
 
template<typename T , typename T_b >
__device__ T_b Imag (T val)
 
template<>
__device__ double Imag< cuDoubleComplex, double > (cuDoubleComplex val)
 
template<>
__device__ float Imag< cuFloatComplex, float > (cuFloatComplex val)
 
template<typename t >
__device__ t accu (t val, t val2)
 
template<>
__device__ cuFloatComplex accu< cuFloatComplex > (cuFloatComplex val, cuFloatComplex val2)
 
template<>
__device__ cuDoubleComplex accu< cuDoubleComplex > (cuDoubleComplex val, cuDoubleComplex val2)
 
template<typename T , typename T2 >
__device__ T axpy (T val, T val2, T2 val3)
 
template<>
__device__ cuFloatComplex axpy< cuFloatComplex, cuFloatComplex > (cuFloatComplex val, cuFloatComplex val2, cuFloatComplex val3)
 
template<>
__device__ cuFloatComplex axpy< cuFloatComplex, double > (cuFloatComplex val, cuFloatComplex val2, double val3)
 
template<>
__device__ cuFloatComplex axpy< cuFloatComplex, float > (cuFloatComplex val, cuFloatComplex val2, float val3)
 
template<>
__device__ cuFloatComplex axpy< cuFloatComplex, cuDoubleComplex > (cuFloatComplex val, cuFloatComplex val2, cuDoubleComplex val3)
 
template<>
__device__ cuDoubleComplex axpy< cuDoubleComplex, double > (cuDoubleComplex val, cuDoubleComplex val2, double val3)
 
template<>
__device__ cuDoubleComplex axpy< cuDoubleComplex, float > (cuDoubleComplex val, cuDoubleComplex val2, float val3)
 
template<>
__device__ cuDoubleComplex axpy< cuDoubleComplex, cuDoubleComplex > (cuDoubleComplex val, cuDoubleComplex val2, cuDoubleComplex val3)
 
template<>
__device__ cuDoubleComplex axpy< cuDoubleComplex, cuFloatComplex > (cuDoubleComplex val, cuDoubleComplex val2, cuFloatComplex val3)
 
template<>
__device__ double axpy< double, cuFloatComplex > (double val, double val2, cuFloatComplex val3)
 
template<>
__device__ double axpy< double, cuDoubleComplex > (double val, double val2, cuDoubleComplex val3)
 
template<>
__device__ float axpy< float, cuFloatComplex > (float val, float val2, cuFloatComplex val3)
 
template<>
__device__ float axpy< float, cuDoubleComplex > (float val, float val2, cuDoubleComplex val3)
 
template<typename T >
__device__ T axpby (T x, T y, T a, T b)
 
template<typename T , typename T_b >
__device__ T_b mulConjSame (T x)
 
template<>
__device__ float mulConjSame< cuFloatComplex, float > (cuFloatComplex x)
 
template<>
__device__ double mulConjSame< cuDoubleComplex, double > (cuDoubleComplex x)
 
template<typename T >
__device__ T conj (T x)
 
template<>
__device__ cuFloatComplex conj< cuFloatComplex > (cuFloatComplex x)
 
template<>
__device__ cuDoubleComplex conj< cuDoubleComplex > (cuDoubleComplex x)
 
template<typename T >
__device__ T mulConj (T x, T y)
 
template<>
__device__ cuFloatComplex mulConj< cuFloatComplex > (cuFloatComplex x, cuFloatComplex y)
 
template<>
__device__ cuDoubleComplex mulConj< cuDoubleComplex > (cuDoubleComplex x, cuDoubleComplex y)
 
template<>
__device__ cuFloatComplex axpby< cuFloatComplex > (cuFloatComplex x, cuFloatComplex y, cuFloatComplex a, cuFloatComplex b)
 
template<>
__device__ cuDoubleComplex axpby< cuDoubleComplex > (cuDoubleComplex x, cuDoubleComplex y, cuDoubleComplex a, cuDoubleComplex b)
 
template<typename T >
__device__ T scale (T y, T a)
 
template<>
__device__ cuFloatComplex scale< cuFloatComplex > (cuFloatComplex y, cuFloatComplex a)
 
template<>
__device__ cuDoubleComplex scale< cuDoubleComplex > (cuDoubleComplex y, cuDoubleComplex a)
 
template<typename T1 , typename T2 >
__device__ T1 scale2 (T1 y, T2 a)
 
template<>
__device__ cuFloatComplex scale2< cuFloatComplex, cuFloatComplex > (cuFloatComplex y, cuFloatComplex a)
 
template<>
__device__ cuFloatComplex scale2< cuFloatComplex, float > (cuFloatComplex y, float a)
 
template<>
__device__ cuFloatComplex scale2< cuFloatComplex, double > (cuFloatComplex y, double a)
 
template<>
__device__ cuDoubleComplex scale2< cuDoubleComplex, cuDoubleComplex > (cuDoubleComplex y, cuDoubleComplex a)
 
template<>
__device__ cuDoubleComplex scale2< cuDoubleComplex, float > (cuDoubleComplex y, float a)
 
template<>
__device__ cuDoubleComplex scale2< cuDoubleComplex, double > (cuDoubleComplex y, double a)
 
template<typename T >
__device__ T mult (T x, T y, T a)
 
template<>
__device__ cuFloatComplex mult< cuFloatComplex > (cuFloatComplex x, cuFloatComplex y, cuFloatComplex a)
 
template<>
__device__ cuDoubleComplex mult< cuDoubleComplex > (cuDoubleComplex x, cuDoubleComplex y, cuDoubleComplex a)
 

Detailed Description

Inline template functions for CUDA complex number handling.

Author
Moritz Kreutzer morit.nosp@m.z.kr.nosp@m.eutze.nosp@m.r@fa.nosp@m.u.de

Function Documentation

template<typename t >
__device__ t accu ( val,
val2 
)
inline
template<>
__device__ cuDoubleComplex accu< cuDoubleComplex > ( cuDoubleComplex  val,
cuDoubleComplex  val2 
)
inline
template<>
__device__ cuFloatComplex accu< cuFloatComplex > ( cuFloatComplex  val,
cuFloatComplex  val2 
)
inline
template<typename T >
__device__ T axpby ( x,
y,
a,
b 
)
inline
template<>
__device__ cuDoubleComplex axpby< cuDoubleComplex > ( cuDoubleComplex  x,
cuDoubleComplex  y,
cuDoubleComplex  a,
cuDoubleComplex  b 
)
inline
template<>
__device__ cuFloatComplex axpby< cuFloatComplex > ( cuFloatComplex  x,
cuFloatComplex  y,
cuFloatComplex  a,
cuFloatComplex  b 
)
inline
template<typename T , typename T2 >
__device__ T axpy ( val,
val2,
T2  val3 
)
inline
template<>
__device__ cuDoubleComplex axpy< cuDoubleComplex, cuDoubleComplex > ( cuDoubleComplex  val,
cuDoubleComplex  val2,
cuDoubleComplex  val3 
)
inline
template<>
__device__ cuDoubleComplex axpy< cuDoubleComplex, cuFloatComplex > ( cuDoubleComplex  val,
cuDoubleComplex  val2,
cuFloatComplex  val3 
)
inline
template<>
__device__ cuDoubleComplex axpy< cuDoubleComplex, double > ( cuDoubleComplex  val,
cuDoubleComplex  val2,
double  val3 
)
inline
template<>
__device__ cuDoubleComplex axpy< cuDoubleComplex, float > ( cuDoubleComplex  val,
cuDoubleComplex  val2,
float  val3 
)
inline
template<>
__device__ cuFloatComplex axpy< cuFloatComplex, cuDoubleComplex > ( cuFloatComplex  val,
cuFloatComplex  val2,
cuDoubleComplex  val3 
)
inline
template<>
__device__ cuFloatComplex axpy< cuFloatComplex, cuFloatComplex > ( cuFloatComplex  val,
cuFloatComplex  val2,
cuFloatComplex  val3 
)
inline
template<>
__device__ cuFloatComplex axpy< cuFloatComplex, double > ( cuFloatComplex  val,
cuFloatComplex  val2,
double  val3 
)
inline
template<>
__device__ cuFloatComplex axpy< cuFloatComplex, float > ( cuFloatComplex  val,
cuFloatComplex  val2,
float  val3 
)
inline
template<>
__device__ double axpy< double, cuDoubleComplex > ( double  val,
double  val2,
cuDoubleComplex  val3 
)
inline
template<>
__device__ double axpy< double, cuFloatComplex > ( double  val,
double  val2,
cuFloatComplex  val3 
)
inline
template<>
__device__ float axpy< float, cuDoubleComplex > ( float  val,
float  val2,
cuDoubleComplex  val3 
)
inline
template<>
__device__ float axpy< float, cuFloatComplex > ( float  val,
float  val2,
cuFloatComplex  val3 
)
inline
template<typename T >
__device__ T conj ( x)
inline
template<>
__device__ cuDoubleComplex conj< cuDoubleComplex > ( cuDoubleComplex  x)
inline
template<>
__device__ cuFloatComplex conj< cuFloatComplex > ( cuFloatComplex  x)
inline
template<typename T , typename T_b >
__device__ void fromReal ( T &  val,
T_b  real 
)
inline
template<>
__device__ void fromReal< cuDoubleComplex, double > ( cuDoubleComplex &  val,
double  real 
)
inline
template<>
__device__ void fromReal< cuFloatComplex, float > ( cuFloatComplex &  val,
float  real 
)
inline
template<typename T , typename T_b >
__device__ T_b Imag ( val)
inline
template<>
__device__ double Imag< cuDoubleComplex, double > ( cuDoubleComplex  val)
inline
template<>
__device__ float Imag< cuFloatComplex, float > ( cuFloatComplex  val)
inline
template<typename T >
__device__ T mulConj ( x,
y 
)
inline
template<>
__device__ cuDoubleComplex mulConj< cuDoubleComplex > ( cuDoubleComplex  x,
cuDoubleComplex  y 
)
inline
template<>
__device__ cuFloatComplex mulConj< cuFloatComplex > ( cuFloatComplex  x,
cuFloatComplex  y 
)
inline
template<typename T , typename T_b >
__device__ T_b mulConjSame ( x)
inline
template<>
__device__ double mulConjSame< cuDoubleComplex, double > ( cuDoubleComplex  x)
inline
template<>
__device__ float mulConjSame< cuFloatComplex, float > ( cuFloatComplex  x)
inline
template<typename T >
__device__ T mult ( x,
y,
a 
)
inline
template<>
__device__ cuDoubleComplex mult< cuDoubleComplex > ( cuDoubleComplex  x,
cuDoubleComplex  y,
cuDoubleComplex  a 
)
inline
template<>
__device__ cuFloatComplex mult< cuFloatComplex > ( cuFloatComplex  x,
cuFloatComplex  y,
cuFloatComplex  a 
)
inline
template<typename T >
__device__ __host__ void one ( T &  val)
inline
template<>
__device__ __host__ void one< cuDoubleComplex > ( cuDoubleComplex &  val)
inline
template<>
__device__ __host__ void one< cuFloatComplex > ( cuFloatComplex &  val)
inline
template<typename T , typename T_b >
__device__ T_b Real ( val)
inline
template<>
__device__ double Real< cuDoubleComplex, double > ( cuDoubleComplex  val)
inline
template<>
__device__ float Real< cuFloatComplex, float > ( cuFloatComplex  val)
inline
template<typename T >
__device__ T scale ( y,
a 
)
inline
template<typename T1 , typename T2 >
__device__ T1 scale2 ( T1  y,
T2  a 
)
inline
template<>
__device__ cuDoubleComplex scale2< cuDoubleComplex, cuDoubleComplex > ( cuDoubleComplex  y,
cuDoubleComplex  a 
)
inline
template<>
__device__ cuDoubleComplex scale2< cuDoubleComplex, double > ( cuDoubleComplex  y,
double  a 
)
inline
template<>
__device__ cuDoubleComplex scale2< cuDoubleComplex, float > ( cuDoubleComplex  y,
float  a 
)
inline
template<>
__device__ cuFloatComplex scale2< cuFloatComplex, cuFloatComplex > ( cuFloatComplex  y,
cuFloatComplex  a 
)
inline
template<>
__device__ cuFloatComplex scale2< cuFloatComplex, double > ( cuFloatComplex  y,
double  a 
)
inline
template<>
__device__ cuFloatComplex scale2< cuFloatComplex, float > ( cuFloatComplex  y,
float  a 
)
inline
template<>
__device__ cuDoubleComplex scale< cuDoubleComplex > ( cuDoubleComplex  y,
cuDoubleComplex  a 
)
inline
template<>
__device__ cuFloatComplex scale< cuFloatComplex > ( cuFloatComplex  y,
cuFloatComplex  a 
)
inline
template<typename T >
__device__ __host__ void zero ( T &  val)
inline
template<>
__device__ __host__ void zero< cuDoubleComplex > ( cuDoubleComplex &  val)
inline
template<>
__device__ __host__ void zero< cuFloatComplex > ( cuFloatComplex &  val)
inline