QDP++
qdp_generic_spin_project_evaluates_wrapper.h
Go to the documentation of this file.
1#ifndef QDP_GENERIC_SPIN_PROJECT_EVALUATES_WRAPPER_H
2#define QDP_GENERIC_SPIN_PROJECT_EVALUATES_WRAPPER_H
3
4
6// Threading evaluates wrappers
7//
8// by Xu Guo, EPCC, 28 August, 2008
10
11// for inlineSpinProjDir0Plus, inlineSpinProjDir1Plus, inlineSpinProjDir2Plus, inlineSpinProjDir3Plus, inlineSpinProjDir0Minus, inlineSpinProjDir1Minus, inlineSpinProjDir2Minus, inlineSpinProjDir3Minus
12// for inlineSpinReconDir0Plus, inlineSpinReconDir1Plus, inlineSpinReconDir2Plus, inlineSpinReconDir3Plus, inlineSpinReconDir0Minus, inlineSpinReconDir1Minus, inlineSpinReconDir2Minus, inlineSpinReconDir3Minus,
13
14// user arg for evaluate having order
18 void (*func)(const REAL*, REAL*, unsigned int);
19};
20
21
22// user func for evaluate having order
23inline
25
26 REAL* aptr = arg->aptr;
27 REAL* bptr = arg->bptr;
28 void (*func)(const REAL*, REAL*,unsigned int) = arg->func;
29
30 unsigned int n_vec = hi - lo;
31
32 func(aptr, bptr, n_vec);
33}
34
35
36// user arg for evaluate NOT having order
37template <class A, class B>
39 A a;
40 B b;
41 const int *tab;
42 void (*func)(const REAL*, REAL*,unsigned int);
43};
44
45
46// user func for evaluate NOT having order
47template <class A, class B>
48inline
50
51 A a = arg->a;
52 B b = arg->b;
53 const int *tab = arg->tab;
54 void (*func)(const REAL*, REAL*, unsigned int) = arg->func;
55
56
57 for(int j=lo; j < hi; j++) {
58 int i = tab[j];
59
60 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
61 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
62 func(aptr, bptr, 1);
63 }
64
65}
66
67
68
69
70
71
72#endif
void unordered_spin_project_evaluate_function(int lo, int hi, int myId, unordered_spin_project_user_arg< A, B > *arg)
void ordered_spin_project_evaluate_function(int lo, int hi, int myId, ordered_spin_project_user_arg *arg)
REAL32 REAL
void(* func)(const REAL *, REAL *, unsigned int)
void(* func)(const REAL *, REAL *, unsigned int)