5 template <
typename Float>
8 for(
int i=0; i < len; i++){ y[i] += a*x[i]; }
13 else aXpY((
float)a, (
float *)x, (
float *)y, len);
17 template <
typename Float>
19 for (
int i=0; i<len; i++) x[i] *= a;
24 else aX((
float)a, (
float*)x, len);
28 template <
typename Float>
30 for (
int i=0; i<len; i++) y[i] -= x[i];
35 else mXpY((
float*)x, (
float*)y, len);
40 template <
typename Float>
43 for (
int i=0; i<len; i++)
sum += v[i]*v[i];
50 else return norm2((
float*)v, len);
54 template <
typename Float>
56 for (
int i=0; i<len; i++) y[i] = x[i] + a*y[i];
61 else xpay((
float*)x, (
float)a, (
float*)y,
length);
67 xpay((
double _Complex *)x, (
double _Complex)a, (
double _Complex *)y,
length / 2);
69 xpay((
float _Complex *)x, (
float _Complex)a, (
float _Complex *)y,
length / 2);
77 double *dst = (
double *)y;
78 double *src = (
double *)x;
79 for (
int i = 0; i < size; i++) { dst[i] = a * src[i]; }
81 float *dst = (
float *)y;
82 float *src = (
float *)x;
83 for (
int i = 0; i < size; i++) { dst[i] = a * src[i]; }
90 double *dst = (
double *)y;
91 double *src = (
double *)x;
92 for (
int i = 0; i < size; i++) { dst[i] += src[i]; }
94 float *dst = (
float *)y;
95 float *src = (
float *)x;
96 for (
int i = 0; i < size; i++) { dst[i] += src[i]; }
void comm_allreduce(double *data)
enum QudaPrecision_s QudaPrecision
void aXpY(Float a, Float *x, Float *y, int len)
void ax(double a, void *x, int len, QudaPrecision precision)
void xpay(void *x, double a, void *y, int length, QudaPrecision precision)
double norm_2(void *v, int len, QudaPrecision precision)
void mxpy(void *x, void *y, int len, QudaPrecision precision)
void aX(Float a, Float *x, int len)
double norm2(Float *v, int len)
void mXpY(Float *x, Float *y, int len)
void cpu_axy(QudaPrecision prec, double a, void *x, void *y, int size)
void cpu_xpy(QudaPrecision prec, void *x, void *y, int size)
void axpy(double a, void *x, void *y, int len, QudaPrecision precision)
void cxpay(void *x, double _Complex a, void *y, int length, QudaPrecision precision)
FloatingPoint< float > Float
__host__ __device__ T sum(const array< T, s > &a)