CHROMA
ord_xpaypbz_kernel_generic.h
Go to the documentation of this file.
1 inline
2 void ord_xpaypbz_kernel(int lo, int hi, int my_id, ord_xpaypbz_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 
23  tmp_re = x_ptr[count] + a_re*y_ptr[count];
24  tmp_re -= a_im*y_ptr[count+1];
25  tmp_im = x_ptr[count+1] + a_re*y_ptr[count+1];
26  tmp_im += a_im*y_ptr[count];
27 
28  tmp_re2 = x_ptr[count+2] + a_re*y_ptr[count+2];
29  tmp_re2 -= a_im*y_ptr[count+3];
30  tmp_im2 = x_ptr[count+3] + a_re*y_ptr[count+3];
31  tmp_im2 += a_im*y_ptr[count+2];
32 
33 
34  x_ptr[count] = tmp_re + b_re*z_ptr[count] ;
35  x_ptr[count] -= b_im*z_ptr[count+1];
36  x_ptr[count+1] = tmp_im + b_re*z_ptr[count+1];
37  x_ptr[count+1]+= b_im *z_ptr[count];
38 
39  x_ptr[count+2] = tmp_re2 + b_re*z_ptr[count+2] ;
40  x_ptr[count+2] -= b_im*z_ptr[count+3];
41  x_ptr[count+3] = tmp_im2 + b_re*z_ptr[count+3];
42  x_ptr[count+3]+= b_im *z_ptr[count+2];
43 
44  }
45  }
46  else {
47  QDPIO::cout << "ord_xpaypbz_kernel_generic.h: len not divisible by 4" << std::endl;
48  QDP_abort(1);
49  }
50 }
Complex a
Definition: invbicg.cc:95
int count
Definition: octave.h:14
void ord_xpaypbz_kernel(int lo, int hi, int my_id, ord_xpaypbz_arg *a)