CHROMA
ord_yxpaymabz_kernel_generic.h
Go to the documentation of this file.
1 inline
2 void ord_yxpaymabz_kernel(int lo, int hi, int my_id, ord_yxpaymabz_arg* a)
3 {
4  int atom = a->atom;
5  int low=atom*lo;
6  int len = atom*(hi - lo);
7 
8  REAL32* x_ptr = &(a->x_ptr[low]);
9  REAL32* y_ptr = &(a->y_ptr[low]);
10  REAL32* z_ptr = &(a->z_ptr[low]);
11 
12  REAL32 a_re = a->a_re;
13  REAL32 a_im = a->a_im;
14  REAL32 b_re = a->b_re;
15  REAL32 b_im = a->b_im;
16 
17 
18  if( len % 4 == 0) {
19  for(int count = 0; count < len; count+=4) {
20  REAL32 tmp_re, tmp_im;
21  REAL32 tmp_re2, tmp_im2;
22  tmp_re = y_ptr[count] - b_re*z_ptr[count];
23  tmp_re += b_im*z_ptr[count+1];
24  tmp_im = y_ptr[count+1] - b_re*z_ptr[count+1];
25  tmp_im -= b_im*z_ptr[count];
26 
27  tmp_re2 = y_ptr[count+2] - b_re*z_ptr[count+2];
28  tmp_re2 += b_im*z_ptr[count+3];
29  tmp_im2 = y_ptr[count+3] - b_re*z_ptr[count+3];
30  tmp_im2 -= b_im*z_ptr[count+2];
31 
32  y_ptr[count] = x_ptr[count] + a_re*tmp_re ;
33  y_ptr[count] -= a_im*tmp_im;
34  y_ptr[count+1] = x_ptr[count+1] + a_re*tmp_im ;
35  y_ptr[count+1]+= a_im*tmp_re;
36 
37  y_ptr[count+2] = x_ptr[count+2] + a_re*tmp_re2 ;
38  y_ptr[count+2] -= a_im*tmp_im2;
39  y_ptr[count+3] = x_ptr[count+3] + a_re*tmp_im2 ;
40  y_ptr[count+3]+= a_im*tmp_re2;
41 
42  }
43  }
44  else {
45  QDPIO::cout << "ord_yxpaymabz_kernel_generic.h: len not divisible by 4" << std::endl;
46  QDP_abort(1);
47  }
48 }
Complex a
Definition: invbicg.cc:95
int count
Definition: octave.h:14
void ord_yxpaymabz_kernel(int lo, int hi, int my_id, ord_yxpaymabz_arg *a)