QUDA  0.9.0
Macros | Functions
convert.h File Reference
#include <quda_internal.h>
Include dependency graph for convert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_SHORT_INV   3.051850948e-5
 

Functions

template<typename type >
int vecLength ()
 
template<>
int vecLength< short > ()
 
template<>
int vecLength< float > ()
 
template<>
int vecLength< double > ()
 
template<>
int vecLength< short2 > ()
 
template<>
int vecLength< float2 > ()
 
template<>
int vecLength< double2 > ()
 
template<>
int vecLength< short4 > ()
 
template<>
int vecLength< float4 > ()
 
template<>
int vecLength< double4 > ()
 
static __device__ float s2f (const short &a)
 
static __device__ double s2d (const short &a)
 
template<typename FloatN >
__device__ void copyFloatN (FloatN &a, const FloatN &b)
 
__device__ void copyFloatN (float2 &a, const short2 &b)
 
__device__ void copyFloatN (float4 &a, const short4 &b)
 
__device__ void copyFloatN (double2 &a, const short2 &b)
 
__device__ void copyFloatN (double4 &a, const short4 &b)
 
__device__ void copyFloatN (float2 &a, const double2 &b)
 
__device__ void copyFloatN (double2 &a, const float2 &b)
 
__device__ void copyFloatN (float4 &a, const double4 &b)
 
__device__ void copyFloatN (double4 &a, const float4 &b)
 
__device__ int f2i (float f)
 
__device__ int d2i (double d)
 
__device__ void copyFloatN (short2 &a, const float2 &b)
 
__device__ void copyFloatN (short4 &a, const float4 &b)
 
__device__ void copyFloatN (short2 &a, const double2 &b)
 
__device__ void copyFloatN (short4 &a, const double4 &b)
 
template<typename OutputType , typename InputType >
__device__ void convert (OutputType x[], InputType y[], const int N)
 
template<>
__device__ void convert< float2, short2 > (float2 x[], short2 y[], const int N)
 
template<>
__device__ void convert< float4, short4 > (float4 x[], short4 y[], const int N)
 
template<>
__device__ void convert< double4, double2 > (double4 x[], double2 y[], const int N)
 
template<>
__device__ void convert< double2, double4 > (double2 x[], double4 y[], const int N)
 
template<>
__device__ void convert< float4, float2 > (float4 x[], float2 y[], const int N)
 
template<>
__device__ void convert< float2, float4 > (float2 x[], float4 y[], const int N)
 
template<>
__device__ void convert< short4, float2 > (short4 x[], float2 y[], const int N)
 
template<>
__device__ void convert< float2, short4 > (float2 x[], short4 y[], const int N)
 
template<>
__device__ void convert< float4, short2 > (float4 x[], short2 y[], const int N)
 
template<>
__device__ void convert< short2, float4 > (short2 x[], float4 y[], const int N)
 
template<>
__device__ void convert< short4, double2 > (short4 x[], double2 y[], const int N)
 
template<>
__device__ void convert< double2, short4 > (double2 x[], short4 y[], const int N)
 
template<>
__device__ void convert< double4, short2 > (double4 x[], short2 y[], const int N)
 
template<>
__device__ void convert< short2, double4 > (short2 x[], double4 y[], const int N)
 
template<>
__device__ void convert< float4, double2 > (float4 x[], double2 y[], const int N)
 
template<>
__device__ void convert< double2, float4 > (double2 x[], float4 y[], const int N)
 
template<>
__device__ void convert< double4, float2 > (double4 x[], float2 y[], const int N)
 
template<>
__device__ void convert< float2, double4 > (float2 x[], double4 y[], const int N)
 

Detailed Description

DESCRIPTION

Conversion functions that are used as building blocks for arbitrary field and register ordering.

Definition in file convert.h.

Macro Definition Documentation

◆ MAX_SHORT_INV

#define MAX_SHORT_INV   3.051850948e-5

Definition at line 28 of file convert.h.

Referenced by s2d(), and s2f().

Function Documentation

◆ convert()

template<typename OutputType , typename InputType >
__device__ void convert ( OutputType  x[],
InputType  y[],
const int  N 
)
inline

Convert a vector of type InputType to type OutputType.

The main current limitation is that there is an implicit assumption that N * sizeof(OutputType) / sizeof(InputType) is an integer. E.g., you cannot convert a vector 9 float2s into a vector of 5 float4s.

Parameters
xOutput vector.
yInput vector.
NLength of output vector.

Definition at line 71 of file convert.h.

References copyFloatN(), x, and y.

Here is the call graph for this function:

◆ convert< double2, double4 >()

template<>
__device__ void convert< double2, double4 > ( double2  x[],
double4  y[],
const int  N 
)
inline

Definition at line 94 of file convert.h.

References w, x, y, and z.

◆ convert< double2, float4 >()

template<>
__device__ void convert< double2, float4 > ( double2  x[],
float4  y[],
const int  N 
)
inline

Definition at line 172 of file convert.h.

References w, x, y, and z.

◆ convert< double2, short4 >()

template<>
__device__ void convert< double2, short4 > ( double2  x[],
short4  y[],
const int  N 
)
inline

Definition at line 146 of file convert.h.

References w, x, y, and z.

◆ convert< double4, double2 >()

template<>
__device__ void convert< double4, double2 > ( double4  x[],
double2  y[],
const int  N 
)
inline

Definition at line 89 of file convert.h.

References x, and y.

◆ convert< double4, float2 >()

template<>
__device__ void convert< double4, float2 > ( double4  x[],
float2  y[],
const int  N 
)
inline

Definition at line 180 of file convert.h.

References x, and y.

◆ convert< double4, short2 >()

template<>
__device__ void convert< double4, short2 > ( double4  x[],
short2  y[],
const int  N 
)
inline

Definition at line 154 of file convert.h.

References x, and y.

◆ convert< float2, double4 >()

template<>
__device__ void convert< float2, double4 > ( float2  x[],
double4  y[],
const int  N 
)
inline

Definition at line 185 of file convert.h.

References w, x, y, and z.

◆ convert< float2, float4 >()

template<>
__device__ void convert< float2, float4 > ( float2  x[],
float4  y[],
const int  N 
)
inline

Definition at line 107 of file convert.h.

References w, x, y, and z.

◆ convert< float2, short2 >()

template<>
__device__ void convert< float2, short2 > ( float2  x[],
short2  y[],
const int  N 
)
inline

Definition at line 77 of file convert.h.

References x, and y.

◆ convert< float2, short4 >()

template<>
__device__ void convert< float2, short4 > ( float2  x[],
short4  y[],
const int  N 
)
inline

Definition at line 120 of file convert.h.

References w, x, y, and z.

◆ convert< float4, double2 >()

template<>
__device__ void convert< float4, double2 > ( float4  x[],
double2  y[],
const int  N 
)
inline

Definition at line 167 of file convert.h.

References x, and y.

◆ convert< float4, float2 >()

template<>
__device__ void convert< float4, float2 > ( float4  x[],
float2  y[],
const int  N 
)
inline

Definition at line 102 of file convert.h.

References x, and y.

◆ convert< float4, short2 >()

template<>
__device__ void convert< float4, short2 > ( float4  x[],
short2  y[],
const int  N 
)
inline

Definition at line 128 of file convert.h.

References x, and y.

◆ convert< float4, short4 >()

template<>
__device__ void convert< float4, short4 > ( float4  x[],
short4  y[],
const int  N 
)
inline

Definition at line 82 of file convert.h.

References w, x, y, and z.

◆ convert< short2, double4 >()

template<>
__device__ void convert< short2, double4 > ( short2  x[],
double4  y[],
const int  N 
)
inline

Definition at line 159 of file convert.h.

References d2i(), w, x, y, and z.

Here is the call graph for this function:

◆ convert< short2, float4 >()

template<>
__device__ void convert< short2, float4 > ( short2  x[],
float4  y[],
const int  N 
)
inline

Definition at line 133 of file convert.h.

References f2i(), w, x, y, and z.

Here is the call graph for this function:

◆ convert< short4, double2 >()

template<>
__device__ void convert< short4, double2 > ( short4  x[],
double2  y[],
const int  N 
)
inline

Definition at line 141 of file convert.h.

References d2i(), x, and y.

Here is the call graph for this function:

◆ convert< short4, float2 >()

template<>
__device__ void convert< short4, float2 > ( short4  x[],
float2  y[],
const int  N 
)
inline

Definition at line 115 of file convert.h.

References f2i(), x, and y.

Here is the call graph for this function:

◆ copyFloatN() [1/13]

template<typename FloatN >
__device__ void copyFloatN ( FloatN &  a,
const FloatN &  b 
)
inline

◆ copyFloatN() [2/13]

__device__ void copyFloatN ( float2 &  a,
const short2 &  b 
)
inline

Definition at line 36 of file convert.h.

References a, b, and s2f().

Here is the call graph for this function:

◆ copyFloatN() [3/13]

__device__ void copyFloatN ( float4 &  a,
const short4 &  b 
)
inline

Definition at line 37 of file convert.h.

References a, b, and s2f().

Here is the call graph for this function:

◆ copyFloatN() [4/13]

__device__ void copyFloatN ( double2 &  a,
const short2 &  b 
)
inline

Definition at line 38 of file convert.h.

References a, b, and s2d().

Here is the call graph for this function:

◆ copyFloatN() [5/13]

__device__ void copyFloatN ( double4 &  a,
const short4 &  b 
)
inline

Definition at line 39 of file convert.h.

References a, b, and s2d().

Here is the call graph for this function:

◆ copyFloatN() [6/13]

__device__ void copyFloatN ( float2 &  a,
const double2 &  b 
)
inline

Definition at line 41 of file convert.h.

References a, and b.

◆ copyFloatN() [7/13]

__device__ void copyFloatN ( double2 &  a,
const float2 &  b 
)
inline

Definition at line 42 of file convert.h.

References a, and b.

◆ copyFloatN() [8/13]

__device__ void copyFloatN ( float4 &  a,
const double4 &  b 
)
inline

Definition at line 43 of file convert.h.

References a, and b.

◆ copyFloatN() [9/13]

__device__ void copyFloatN ( double4 &  a,
const float4 &  b 
)
inline

Definition at line 44 of file convert.h.

References a, and b.

◆ copyFloatN() [10/13]

__device__ void copyFloatN ( short2 &  a,
const float2 &  b 
)
inline

Definition at line 53 of file convert.h.

References a, b, and f2i().

Here is the call graph for this function:

◆ copyFloatN() [11/13]

__device__ void copyFloatN ( short4 &  a,
const float4 &  b 
)
inline

Definition at line 54 of file convert.h.

References a, b, and f2i().

Here is the call graph for this function:

◆ copyFloatN() [12/13]

__device__ void copyFloatN ( short2 &  a,
const double2 &  b 
)
inline

Definition at line 55 of file convert.h.

References a, b, and d2i().

Here is the call graph for this function:

◆ copyFloatN() [13/13]

__device__ void copyFloatN ( short4 &  a,
const double4 &  b 
)
inline

Definition at line 56 of file convert.h.

References a, b, and d2i().

Here is the call graph for this function:

◆ d2i()

__device__ int d2i ( double  d)
inline

Definition at line 50 of file convert.h.

References d.

Referenced by convert< short2, double4 >(), convert< short4, double2 >(), and copyFloatN().

Here is the caller graph for this function:

◆ f2i()

__device__ int f2i ( float  f)
inline

Definition at line 47 of file convert.h.

References f.

Referenced by convert< short2, float4 >(), convert< short4, float2 >(), and copyFloatN().

Here is the caller graph for this function:

◆ s2d()

static __device__ double s2d ( const short &  a)
inlinestatic

Definition at line 30 of file convert.h.

References a, and MAX_SHORT_INV.

Referenced by copyFloatN().

Here is the caller graph for this function:

◆ s2f()

static __device__ float s2f ( const short &  a)
inlinestatic

Definition at line 29 of file convert.h.

References a, and MAX_SHORT_INV.

Referenced by copyFloatN().

Here is the caller graph for this function:

◆ vecLength()

template<typename type >
int vecLength ( )
inline

Definition at line 13 of file convert.h.

◆ vecLength< double >()

template<>
int vecLength< double > ( )
inline

Definition at line 17 of file convert.h.

◆ vecLength< double2 >()

template<>
int vecLength< double2 > ( )
inline

Definition at line 21 of file convert.h.

◆ vecLength< double4 >()

template<>
int vecLength< double4 > ( )
inline

Definition at line 25 of file convert.h.

◆ vecLength< float >()

template<>
int vecLength< float > ( )
inline

Definition at line 16 of file convert.h.

◆ vecLength< float2 >()

template<>
int vecLength< float2 > ( )
inline

Definition at line 20 of file convert.h.

◆ vecLength< float4 >()

template<>
int vecLength< float4 > ( )
inline

Definition at line 24 of file convert.h.

◆ vecLength< short >()

template<>
int vecLength< short > ( )
inline

Definition at line 15 of file convert.h.

◆ vecLength< short2 >()

template<>
int vecLength< short2 > ( )
inline

Definition at line 19 of file convert.h.

◆ vecLength< short4 >()

template<>
int vecLength< short4 > ( )
inline

Definition at line 23 of file convert.h.