QDP++
generic_blas_vaxpy3.h
Go to the documentation of this file.
1// $Id: generic_blas_vaxpy3.h,v 1.3 2009-09-15 20:48:42 bjoo Exp $
2
7
8#ifndef QDP_GENERIC_BLAS_VAXPY3
9#define QDP_GENERIC_BLAS_VAXPY3
10
11namespace QDP {
12// (Vector) out = (Scalar) (*scalep) * (Vector) InScale + (Vector) Add
13inline
14void vaxpy3(REAL *Out,REAL *scalep,REAL *InScale, REAL *Add,int n_4vec)
15{
16
17 REAL a=*scalep;
18
19 int len=n_4vec*24;
20 for(int i=0; i < len; i++) {
21 Out[i]=a*InScale[i]+Add[i];
22 }
23
24#if 0
25 cout << "generic vaxpy3" << endl;
26
27 double a;
28 double x0r;
29 double x0i;
30
31 double x1r;
32 double x1i;
33
34 double x2r;
35 double x2i;
36
37 double y0r;
38 double y0i;
39
40 double y1r;
41 double y1i;
42
43 double y2r;
44 double y2i;
45
46 double z0r;
47 double z0i;
48
49 double z1r;
50 double z1i;
51
52 double z2r;
53 double z2i;
54
55 a = *scalep;
56
57 int index_x = 0;
58 int index_y = 0;
59 int index_z = 0;
60
61 int counter;
62
63 // OK. Each n_4vec a length 24 vector. Here we've unrolled
64 // 6 deep, so we need to do 4* this
65 int len=4*n_4vec;
66
67 for( counter = 0; counter < len; counter++) {
68 x0r = (double)InScale[index_x++];
69 y0r = (double)Add[index_y++];
70 z0r = a*x0r + y0r;
71 Out[index_z++] =(REAL) z0r;
72
73 x0i = (double)InScale[index_x++];
74 y0i = (double)Add[index_y++];
75 z0i = a*x0i + y0i;
76 Out[index_z++] =(REAL) z0i;
77
78 x1r = (double)InScale[index_x++];
79 y1r = (double)Add[index_y++];
80 z1r = a*x1r + y1r;
81 Out[index_z++] = (REAL)z1r;
82
83 x1i = (double)InScale[index_x++];
84 y1i = (double)Add[index_y++];
85 z1i = a*x1i + y1i;
86 Out[index_z++] = (REAL)z1i;
87
88 x2r = (double)InScale[index_x++];
89 y2r = (double)Add[index_y++];
90 z2r = a*x2r + y2r;
91 Out[index_z++] = (REAL)z2r;
92
93 x2i = (double)InScale[index_x++];
94 y2i = (double)Add[index_y++];
95 z2i = a*x2i + y2i;
96 Out[index_z++] = (REAL)z2i;
97 }
98#endif
99
100}
101
102
103} // namespace QDP;
104
105#endif // guard
REAL32 REAL
Yet another random number generator.
void vaxpy3(REAL *Out, REAL *scalep, REAL *InScale, REAL *Add, int n_4vec)