CHROMA
ord_xmyz_normx_kernel_generic.h
Go to the documentation of this file.
1 inline
2 void ord_xymz_normx_kernel(int lo, int hi, int my_id, ord_xymz_normx_arg* a)
3 {
4  REAL64* x_ptr;
5  REAL64* y_ptr;
6  REAL64* z_ptr;
7  REAL64 norm=0;
8  int atom = a->atom;
9  int low = atom*lo;
10  int len = atom*(hi-lo);
11 
12  x_ptr = &(a->x_ptr[low]);
13  y_ptr = &(a->y_ptr[low]);
14  z_ptr = &(a->z_ptr[low]);
15 
16 
17  if( len % 4 == 0){
18  for(int count = 0; count < len; count+=4) {
19 
20  x_ptr[count] = y_ptr[count] - z_ptr[count];
21  x_ptr[count+1] = y_ptr[count+1] - z_ptr[count+1];
22  x_ptr[count+2] = y_ptr[count+2] - z_ptr[count+2];
23  x_ptr[count+3] = y_ptr[count+3] - z_ptr[count+3];
24 
25  norm += x_ptr[count]*x_ptr[count];
26  norm += x_ptr[count+1]*x_ptr[count+1];
27  norm += x_ptr[count+2]*x_ptr[count+2];
28  norm += x_ptr[count+3]*x_ptr[count+3];
29 
30  }
31 
32  a->norm_ptr[my_id] = norm;
33  }
34  else {
35  QDPIO::cout << "ord_xmyz_normx_kernel_generic.h: len not divisible by 4" << std::endl;
36  QDP_abort(1);
37  }
38 }
Complex a
Definition: invbicg.cc:95
int count
Definition: octave.h:14
void ord_xymz_normx_kernel(int lo, int hi, int my_id, ord_xymz_normx_arg *a)
int norm
Definition: qtopcor.cc:35