Bridge++  Ver.2.1.3
afield_Gauge-inc.h
Go to the documentation of this file.
1 
10 #ifndef ACCEL_AFIELD_GAUGE_INC_INCLUDED
11 #define ACCEL_AFIELD_GAUGE_INC_INCLUDED
12 
13 #include "lib_alt_Accel/BridgeACC/bridgeACC_AField_Gauge.h"
14 
15 //====================================================================
16 template <typename REALTYPE>
17 void multadd_Gnn(AField<REALTYPE,ACCEL>& u, const int exu,
18  const AField<REALTYPE,ACCEL>& v, const int exv,
19  const AField<REALTYPE,ACCEL>& w, const int exw,
20  const REALTYPE a)
21 {
23  typedef REALTYPE real_t;
24 
25 #pragma omp barrier
26 
27  int ith = ThreadManager::get_thread_id();
28 
29  int Nst = v.nvol();
30 
31  real_t* up = u.ptr(0);
32  real_t* vp = const_cast<AFIELD*>(&v)->ptr(0);
33  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
34 
35  if(ith == 0)
36  BridgeACC::multadd_Gnn(up, exu, vp, exv, wp, exw, a, Nst);
37 
38 #pragma omp barrier
39 }
40 
41 //====================================================================
42 template <typename REALTYPE>
43 void mult_Gnn(AField<REALTYPE,ACCEL>& u, const int exu,
44  const AField<REALTYPE,ACCEL>& v, const int exv,
45  const AField<REALTYPE,ACCEL>& w, const int exw)
46 {
48  typedef REALTYPE real_t;
49 
50 #pragma omp barrier
51 
52  int ith = ThreadManager::get_thread_id();
53 
54  int Nst = v.nvol();
55 
56  real_t* up = u.ptr(0);
57  real_t* vp = const_cast<AFIELD*>(&v)->ptr(0);
58  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
59 
60  if(ith == 0) BridgeACC::mult_Gnn(up, exu, vp, exv, wp, exw, Nst);
61 
62 #pragma omp barrier
63 
64 }
65 
66 //====================================================================
67 template <typename REALTYPE>
68 void multadd_Gnd(AField<REALTYPE,ACCEL>& u, const int exu,
69  const AField<REALTYPE,ACCEL>& v, const int exv,
70  const AField<REALTYPE,ACCEL>& w, const int exw,
71  const REALTYPE a)
72 {
74  typedef REALTYPE real_t;
75 
76 #pragma omp barrier
77 
78  int ith = ThreadManager::get_thread_id();
79 
80  int Nst = v.nvol();
81 
82  real_t* up = u.ptr(0);
83  real_t* vp = const_cast<AFIELD*>(&v)->ptr(0);
84  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
85 
86  if(ith == 0)
87  BridgeACC::multadd_Gnd(up, exu, vp, exv, wp, exw, a, Nst);
88 
89 #pragma omp barrier
90 }
91 
92 //====================================================================
93 template <typename REALTYPE>
94 void mult_Gnd(AField<REALTYPE,ACCEL>& u, const int exu,
95  const AField<REALTYPE,ACCEL>& v, const int exv,
96  const AField<REALTYPE,ACCEL>& w, const int exw)
97 {
99  typedef REALTYPE real_t;
100 
101 #pragma omp barrier
102 
103  int ith = ThreadManager::get_thread_id();
104 
105  int Nst = v.nvol();
106 
107  real_t* up = u.ptr(0);
108  real_t* vp = const_cast<AFIELD*>(&v)->ptr(0);
109  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
110 
111  if(ith == 0) BridgeACC::mult_Gnd(up, exu, vp, exv, wp, exw, Nst);
112 
113 #pragma omp barrier
114 }
115 
116 //====================================================================
117 template <typename REALTYPE>
118 void multadd_Gdn(AField<REALTYPE,ACCEL>& u, const int exu,
119  const AField<REALTYPE,ACCEL>& v, const int exv,
120  const AField<REALTYPE,ACCEL>& w, const int exw,
121  const REALTYPE a)
122 {
124  typedef REALTYPE real_t;
125 
126 #pragma omp barrier
127 
128  int ith = ThreadManager::get_thread_id();
129 
130  int Nst = v.nvol();
131 
132  real_t* up = u.ptr(0);
133  real_t* vp = const_cast<AFIELD*>(&v)->ptr(0);
134  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
135 
136  if(ith == 0)
137  BridgeACC::multadd_Gdn(up, exu, vp, exv, wp, exw, a, Nst);
138 
139 #pragma omp barrier
140 
141 }
142 
143 //====================================================================
144 template <typename REALTYPE>
145 void mult_Gdn(AField<REALTYPE,ACCEL>& u, const int exu,
146  const AField<REALTYPE,ACCEL>& v, const int exv,
147  const AField<REALTYPE,ACCEL>& w, const int exw)
148 {
150  typedef REALTYPE real_t;
151 
152 #pragma omp barrier
153 
154  int ith = ThreadManager::get_thread_id();
155 
156  int Nst = v.nvol();
157 
158  real_t* up = u.ptr(0);
159  real_t* vp = const_cast<AFIELD*>(&v)->ptr(0);
160  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
161 
162  if(ith == 0) BridgeACC::mult_Gdn(up, exu, vp, exv, wp, exw, Nst);
163 
164 #pragma omp barrier
165 
166 }
167 
168 //====================================================================
169 template <typename REALTYPE>
170 void mult_Gdd(AField<REALTYPE,ACCEL>& u, const int exu,
171  const AField<REALTYPE,ACCEL>& v, const int exv,
172  const AField<REALTYPE,ACCEL>& w, const int exw)
173 {
175  typedef REALTYPE real_t;
176 
177 #pragma omp barrier
178 
179  int ith = ThreadManager::get_thread_id();
180 
181  int Nst = v.nvol();
182 
183  real_t* up = u.ptr(0);
184  real_t* vp = const_cast<AFIELD*>(&v)->ptr(0);
185  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
186 
187  if(ith == 0) BridgeACC::mult_Gdd(up, exu, vp, exv, wp, exw, Nst);
188 
189 #pragma omp barrier
190 }
191 
192 //====================================================================
193 // anti-hermitian
194 template <typename REALTYPE>
195 void ah_G(AField<REALTYPE,ACCEL>& u, const int ex)
196 {
197  typedef REALTYPE real_t;
198 
199 #pragma omp barrier
200 
201  int ith = ThreadManager::get_thread_id();
202 
203  int Nst = u.nvol();
204  real_t* up = u.ptr(0);
205 
206  if(ith == 0) BridgeACC::ah_G(up, ex, Nst);
207 
208 #pragma omp barrier
209 
210 }
211 
212 //====================================================================
213 // anti-hermitian traceless
214 template <typename REALTYPE>
215 void at_G(AField<REALTYPE,ACCEL>& u, const int ex)
216 {
217  typedef REALTYPE real_t;
218 
219 #pragma omp barrier
220 
221  int ith = ThreadManager::get_thread_id();
222 
223  int Nst = u.nvol();
224  real_t* up = u.ptr(0);
225 
226  if(ith == 0) BridgeACC::at_G(up, ex, Nst);
227 
228 #pragma omp barrier
229 
230 }
231 
232 //====================================================================
233 template <typename REALTYPE>
234 void add_unit(AField<REALTYPE,ACCEL>& u, const int ex, REALTYPE a)
235 { // u = u + a * I (I: unit matrix)
236 
237  typedef REALTYPE real_t;
238 
239 #pragma omp barrier
240 
241  int ith = ThreadManager::get_thread_id();
242 
243  int Nst = u.nvol();
244  real_t* up = u.ptr(0);
245 
246  if(ith == 0) BridgeACC::add_unit(up, ex, a, Nst);
247 
248 #pragma omp barrier
249 
250 }
251 
252 //============================================================END=====
253 #endif
AField< REALTYPE, ACCEL >::ptr
real_t * ptr(int i)
return the address of data at given index.
Definition: afield.h:148
BridgeACC::mult_Gnd
void mult_Gnd(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const int nst)
BridgeACC::ah_G
void ah_G(double *u, const int ex, const int nst)
Definition: afield_Gauge_openacc-inc.h:643
mult_Gnn
void mult_Gnn(AField< REALTYPE, ACCEL > &u, const int exu, const AField< REALTYPE, ACCEL > &v, const int exv, const AField< REALTYPE, ACCEL > &w, const int exw)
Definition: afield_Gauge-inc.h:43
mult_Gnd
void mult_Gnd(AField< REALTYPE, ACCEL > &u, const int exu, const AField< REALTYPE, ACCEL > &v, const int exv, const AField< REALTYPE, ACCEL > &w, const int exw)
Definition: afield_Gauge-inc.h:94
AFIELD
Field AFIELD
Definition: eigensolver.cpp:18
BridgeACC::mult_Gnn
void mult_Gnn(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const int nst)
BridgeACC::multadd_Gnn
void multadd_Gnn(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const double a, const int nst)
BridgeACC::multadd_Gdn
void multadd_Gdn(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const double a, const int nst)
ah_G
void ah_G(AField< REALTYPE, ACCEL > &u, const int ex)
Definition: afield_Gauge-inc.h:195
BridgeACC::mult_Gdd
void mult_Gdd(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const int nst)
multadd_Gdn
void multadd_Gdn(AField< REALTYPE, ACCEL > &u, const int exu, const AField< REALTYPE, ACCEL > &v, const int exv, const AField< REALTYPE, ACCEL > &w, const int exw, const REALTYPE a)
Definition: afield_Gauge-inc.h:118
multadd_Gnd
void multadd_Gnd(AField< REALTYPE, ACCEL > &u, const int exu, const AField< REALTYPE, ACCEL > &v, const int exv, const AField< REALTYPE, ACCEL > &w, const int exw, const REALTYPE a)
Definition: afield_Gauge-inc.h:68
multadd_Gnn
void multadd_Gnn(AField< REALTYPE, ACCEL > &u, const int exu, const AField< REALTYPE, ACCEL > &v, const int exv, const AField< REALTYPE, ACCEL > &w, const int exw, const REALTYPE a)
Definition: afield_Gauge-inc.h:17
BridgeACC::at_G
void at_G(double *u, const int ex, const int nst)
Definition: afield_Gauge_openacc-inc.h:705
mult_Gdd
void mult_Gdd(AField< REALTYPE, ACCEL > &u, const int exu, const AField< REALTYPE, ACCEL > &v, const int exv, const AField< REALTYPE, ACCEL > &w, const int exw)
Definition: afield_Gauge-inc.h:170
real_t
double real_t
Definition: bridgeACC_AField_double.cpp:14
BridgeACC::mult_Gdn
void mult_Gdn(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const int nst)
mult_Gdn
void mult_Gdn(AField< REALTYPE, ACCEL > &u, const int exu, const AField< REALTYPE, ACCEL > &v, const int exv, const AField< REALTYPE, ACCEL > &w, const int exw)
Definition: afield_Gauge-inc.h:145
BridgeACC::add_unit
void add_unit(double *u, const int ex, const double a, const int nst)
Definition: afield_Gauge_openacc-inc.h:767
AField< REALTYPE, ACCEL >::nvol
int nvol() const
returning size of site d.o.f.
Definition: afield.h:119
at_G
void at_G(AField< REALTYPE, ACCEL > &u, const int ex)
Definition: afield_Gauge-inc.h:215
Field
Container of Field-type object.
Definition: field.h:46
ThreadManager::get_thread_id
static int get_thread_id()
returns thread id.
Definition: threadManager.cpp:253
add_unit
void add_unit(AField< REALTYPE, ACCEL > &u, const int ex, REALTYPE a)
Definition: afield_Gauge-inc.h:234
AField< REALTYPE, ACCEL >
Definition: afield.h:31
BridgeACC::multadd_Gnd
void multadd_Gnd(double *restrict u, const int exu, double *restrict v, const int exv, double *restrict w, const int exw, const double a, const int nst)