Bridge++  Ver.2.1.3
afield-tmpl.h
Go to the documentation of this file.
1 
12 
13 template<typename REALTYPE>
14 const std::string AField<REALTYPE,ACCEL>::class_name
15  = "AField<REALTYPE,ACCEL>";
16 
17 template<typename REALTYPE>
19 
20 template<typename REALTYPE>
21 REALTYPE* AField<REALTYPE,ACCEL>::m_red1 = 0;
22 
23 template<typename REALTYPE>
24 REALTYPE* AField<REALTYPE,ACCEL>::m_red2 = 0;
25 
26 //====================================================================
27 template<typename REALTYPE>
28 void AField<REALTYPE,ACCEL>::init(const int nin,
29  const int nvol,
30  const int nex,
31  const element_type cmpl)
32 {
34 
35  m_vl = CommonParameters::Vlevel();
36 
37  m_nin = nin;
38  m_nvol = nvol;
39  m_nex = nex;
40  m_element_type = cmpl;
41 
42  m_nsize = m_nin * m_nvol * m_nex;
43 
44  m_nvol_pad = ceil_nwp(m_nvol);
45  m_nsize_pad = m_nin * m_nvol_pad * m_nex;
46 
47  if(m_nsize > 0){
48  m_field = (real_t*)malloc(m_nsize_pad*sizeof(real_t));
49  BridgeACC::afield_init(m_field, m_nsize_pad);
50  vout.paranoiac("%s: data memory allocated\n", class_name.c_str());
51  }else{
52  m_field = NULL;
53  vout.paranoiac("%s: null data size\n", class_name.c_str());
54  }
55 
56 #ifndef USE_ACCEL_OPENACC
57  // setup fields for reduction
58  if(m_num_instance == 0){
59  int Nvol_pad = ceil_nwp(CommonParameters::Nvol());
60 
61  m_red1 = (real_t*)malloc(Nvol_pad * sizeof(real_t));
62  BridgeACC::afield_init(m_red1, Nvol_pad);
63 
64  m_red2 = (real_t*)malloc(Nvol_pad * sizeof(real_t));
65  BridgeACC::afield_init(m_red2, Nvol_pad);
66  }
67 #endif
68 
69  ++m_num_instance;
70 
71 #pragma omp barrier
72 
73  vout.paranoiac("%s: construction finished\n", class_name.c_str());
74 
75 }
76 
77 //====================================================================
78 template<typename REALTYPE>
80 {
82 
83  if(m_field != NULL){
84  BridgeACC::afield_tidyup(m_field, m_nsize_pad);
85  free(m_field);
86  }
87 
88  --m_num_instance;
89 
90 #ifndef USE_ACCEL_OPENACC
91  // tidyup fields for reduction
92  if(m_num_instance == 0){
93  int Nvol_pad = ceil_nwp(CommonParameters::Nvol());
94  BridgeACC::exit_data_delete(m_red1, Nvol_pad);
95  free(m_red1);
96  BridgeACC::exit_data_delete(m_red2, Nvol_pad);
97  free(m_red2);
98  }
99 #endif
100 
101 
102 }
103 
104 //====================================================================
105 template<typename REALTYPE>
106 void AField<REALTYPE,ACCEL>::reset(const int nin,
107  const int nvol,
108  const int nex,
109  const element_type cmpl)
110 {
111  vout.paranoiac("%s: reset called\n", class_name.c_str());
112  if(check_size(nin,nvol,nex) && m_element_type == cmpl) return;
113 
114 #pragma omp barrier
115 
116  // call in parallel region is enabled
117  int ith = ThreadManager::get_thread_id();
118  if(ith == 0){
119 
120  std::size_t nsize_pad_prev = m_nsize_pad;
121 
122  m_nin = nin;
123  m_nvol = nvol;
124  m_nex = nex;
125  m_element_type = cmpl;
126 
127  m_nsize = m_nin * m_nvol * m_nex;
128 
129  m_nvol_pad = ceil_nwp(m_nvol);
130  m_nsize_pad = m_nin * m_nvol_pad * m_nex;
131 
132  if(m_nsize_pad != nsize_pad_prev){
133  if(m_field != NULL){
134  BridgeACC::afield_tidyup(m_field, nsize_pad_prev);
135  free(m_field);
136  }
137  if(m_nsize > 0){
138  m_field = (real_t*)malloc(m_nsize_pad*sizeof(real_t));
139  BridgeACC::afield_init(m_field, m_nsize_pad);
140  }else{
141  m_field = NULL;
142  }
143  vout.paranoiac("%s: data resized\n", class_name.c_str());
144  }
145  }
146 #pragma omp barrier
147 
148 }
149 
150 //====================================================================
151 template<typename REALTYPE>
153 {
154 #pragma omp barrier
155 
156  int ith, nth;
157  set_thread(ith, nth);
158 
159  if(ith == 0){
160  BridgeACC::copy_from_device(m_field, m_nsize_pad);
161  }
162 
163 #pragma omp barrier
164 }
165 
166 //====================================================================
167 template<typename REALTYPE>
169 {
170 #pragma omp barrier
171 
172  int ith, nth;
173  set_thread(ith, nth);
174 
175  if(ith == 0){
176  BridgeACC::copy_to_device(m_field, m_nsize_pad);
177  }
178 
179 #pragma omp barrier
180 }
181 
182 //====================================================================
183 template<typename REALTYPE>
184 void AField<REALTYPE,ACCEL>::set(const REALTYPE a)
185 {
186  int ith, nth;
187  set_thread(ith, nth);
188 
189  if(ith == 0){
190  int nsize2 = m_nsize_pad/m_nin;
191  BridgeACC::afield_set(m_field, a, m_nin, nsize2);
192  }
193 #pragma omp barrier
194 
195 }
196 
197 //====================================================================
198 template<typename REALTYPE>
199 void AField<REALTYPE,ACCEL>::set(const int index, const REALTYPE a)
200 {
201  int ith, nth;
202  set_thread(ith, nth);
203 
204  if(ith == 0){
205  m_field[index] = a;
206  BridgeACC::copy_to_device(m_field, index, 1);
207  }
208 #pragma omp barrier
209 
210 }
211 
212 //====================================================================
213 template<typename REALTYPE>
214 REALTYPE AField<REALTYPE,ACCEL>::cmp(const int index) const
215 {
216  int ith, nth;
217  set_thread(ith, nth);
218 
219  if(ith == 0){
220  BridgeACC::copy_from_device(m_field, index, 1);
221  }
222 #pragma omp barrier
223 
224  return m_field[index];
225 
226 }
227 
228 //====================================================================
229 template<typename REALTYPE>
230 void AField<REALTYPE,ACCEL>::set_host(const REALTYPE a)
231 {
232 #pragma omp barrier
233 
234  int ith, nth, is, ns;
235  set_threadtask(ith, nth, is, ns, m_nsize_pad);
236 
237  for (int i = is; i < ns; ++i) {
238  m_field[i] = a;
239  }
240 
241 #pragma omp barrier
242 
243 }
244 
245 //====================================================================
246 template<typename REALTYPE>
248 {
249  assert(check_size(w));
250 
251  int size2 = m_nin * m_nvol_pad;
252 
253  int ith, nth, is, ns;
254  set_threadtask(ith, nth, is, ns, m_nvol_pad);
255 
256  for(int ex = 0; ex < m_nex; ++ex){
257  for(int ist = is; ist < ns; ++ist){
258 
259  if(ist < m_nvol){
260  for(int in = 0; in < m_nin; ++in){
261  int idx2 = IDX2(m_nin, in, ist) + size2 * ex;
262  m_field[idx2] = REALTYPE(w.cmp(in, ist, ex));
263  }
264  }else{
265  for(int in = 0; in < m_nin; ++in){
266  int idx2 = IDX2(m_nin, in, ist) + size2 * ex;
267  m_field[idx2] = 0.0;
268  }
269  }
270 
271  }
272  }
273 #pragma omp barrier
274 
275  if(ith == 0){
276  BridgeACC::copy_to_device(m_field, m_nsize_pad);
277  }
278 
279 #pragma omp barrier
280 
281 }
282 
283 //====================================================================
284 template<typename REALTYPE>
286 {
287  assert(check_size(w));
288 
289  int ith, nth;
290  set_thread(ith, nth);
291 
292  if(ith == 0){
293  int nvex = m_nsize_pad/m_nin;
294  BridgeACC::copy(m_field, w.m_field, m_nin, nvex);
295  }
296 #pragma omp barrier
297 
298 }
299 
300 //====================================================================
301 template<typename REALTYPE>
303  const AField<REALTYPE,ACCEL>& w,
304  const int ex_w)
305 {
306  assert( nin() == w.nin());
307  assert(nvol() == w.nvol());
308  assert(ex < nex());
309  assert(ex_w < w.nex());
310 
311  int ith, nth;
312  set_thread(ith, nth);
313 
314  if(ith == 0){
315  int size2 = m_nin * m_nvol_pad;
316  BridgeACC::copy(m_field, size2 * ex, w.m_field, size2 * ex_w,
317  m_nin, m_nvol_pad);
318  }
319 #pragma omp barrier
320 
321 }
322 
323 //====================================================================
324 template<typename REALTYPE>
325 void AField<REALTYPE,ACCEL>::axpy(const REALTYPE a,
326  const AField<REALTYPE,ACCEL>& w)
327 {
328  assert(check_size(w));
329 
330  int ith, nth;
331  set_thread(ith, nth);
332 
333  if(ith == 0){
334  int nvex = m_nsize_pad/m_nin;
335  BridgeACC::axpy(m_field, 0, a, w.m_field, 0, m_nin, nvex);
336  }
337 #pragma omp barrier
338 
339 }
340 
341 //====================================================================
342 template<typename REALTYPE>
343 void AField<REALTYPE,ACCEL>::axpy(const int ex, const REALTYPE a,
344  const AField<REALTYPE,ACCEL>& w,
345  const int ex_w)
346 {
347  assert( nin() == w.nin());
348  assert(nvol() == w.nvol());
349  assert(ex < nex());
350  assert(ex_w < w.nex());
351 
352  int ith, nth;
353  set_thread(ith, nth);
354 
355  if(ith == 0){
356  int size2 = m_nin * m_nvol_pad;
357  BridgeACC::axpy(m_field, size2 * ex, a, w.m_field, size2 * ex_w,
358  m_nin, m_nvol_pad);
359  }
360 #pragma omp barrier
361 
362 }
363 
364 //====================================================================
365 template<typename REALTYPE>
366 void AField<REALTYPE,ACCEL>::axpy(const REALTYPE ar, const REALTYPE ai,
367  const AField<REALTYPE,ACCEL>& w)
368 {
369  assert(check_size(w));
370 
371  int ith, nth;
372  set_thread(ith, nth);
373 
374  if(ith == 0){
375  int nvex = m_nsize_pad/m_nin;
376  BridgeACC::axpy(m_field, 0, ar, ai, w.m_field, 0, m_nin, nvex);
377  }
378 #pragma omp barrier
379 
380 }
381 
382 //====================================================================
383 template<typename REALTYPE>
385  const REALTYPE ar, const REALTYPE ai,
386  const AField<REALTYPE,ACCEL>& w,
387  const int ex_w)
388 {
389  assert( nin() == w.nin());
390  assert(nvol() == w.nvol());
391  assert(ex < nex());
392  assert(ex_w < w.nex());
393 
394  int ith, nth;
395  set_thread(ith, nth);
396 
397  if(ith == 0){
398  int size2 = m_nin * m_nvol_pad;
399  BridgeACC::axpy(m_field, size2 * ex, ar, ai, w.m_field, size2 * ex_w,
400  m_nin, m_nvol_pad);
401  }
402 #pragma omp barrier
403 
404 }
405 
406 //====================================================================
407 template<typename REALTYPE>
409  const typename ComplexTraits<REALTYPE>::complex_t a,
410  const AField<REALTYPE,ACCEL>& w)
411 {
412  assert(check_size(w));
413 
414  int ith, nth;
415  set_thread(ith, nth);
416 
417  if(ith == 0){
418  REALTYPE ar = real(a);
419  REALTYPE ai = imag(a);
420  int nvex = m_nsize_pad/m_nin;
421  BridgeACC::axpy(m_field, 0, ar, ai, w.m_field, 0, m_nin, nvex);
422  }
423 #pragma omp barrier
424 
425 }
426 
427 //====================================================================
428 template<typename REALTYPE>
430  const int ex,
431  const typename ComplexTraits<REALTYPE>::complex_t a,
432  const AField<REALTYPE,ACCEL>& w,
433  const int ex_w)
434 {
435  assert( nin() == w.nin());
436  assert(nvol() == w.nvol());
437  assert(ex < nex());
438  assert(ex_w < w.nex());
439 
440  int ith, nth;
441  set_thread(ith, nth);
442 
443  if(ith == 0){
444  int size2 = m_nin * m_nvol_pad;
445  REALTYPE ar = real(a);
446  REALTYPE ai = imag(a);
447  BridgeACC::axpy(m_field, size2 * ex, ar, ai, w.m_field, size2 * ex_w,
448  m_nin, m_nvol_pad);
449  }
450 #pragma omp barrier
451 
452 }
453 
454 //====================================================================
455 template<typename REALTYPE>
456 void AField<REALTYPE,ACCEL>::aypx(const REALTYPE a,
457  const AField<REALTYPE,ACCEL>& w)
458 {
459  assert(check_size(w));
460 
461  int ith, nth;
462  set_thread(ith, nth);
463 
464  if(ith == 0){
465  int nvex = m_nsize_pad/m_nin;
466  BridgeACC::aypx(a, m_field, 0, w.m_field, 0, m_nin, nvex);
467  }
468 #pragma omp barrier
469 
470 }
471 
472 //====================================================================
473 template<typename REALTYPE>
475  const REALTYPE a,
476  const AField<REALTYPE,ACCEL>& w,
477  const int ex_w)
478 {
479  assert( nin() == w.nin());
480  assert(nvol() == w.nvol());
481  assert(ex < nex());
482  assert(ex_w < w.nex());
483 
484  int ith, nth;
485  set_thread(ith, nth);
486 
487  if(ith == 0){
488  int size2 = m_nin * m_nvol_pad;
489  BridgeACC::aypx(a, m_field, size2 * ex, w.m_field, size2 * ex_w,
490  m_nin, m_nvol_pad);
491  }
492 #pragma omp barrier
493 
494 }
495 
496 //====================================================================
497 template<typename REALTYPE>
498 void AField<REALTYPE,ACCEL>::aypx(const REALTYPE ar, const REALTYPE ai,
499  const AField<REALTYPE,ACCEL>& w)
500 {
501  assert(check_size(w));
502 
503  int ith, nth;
504  set_thread(ith, nth);
505 
506  if(ith == 0){
507  int nvex = m_nsize_pad/m_nin;
508  BridgeACC::aypx(ar, ai, m_field, 0, w.m_field, 0, m_nin, nvex);
509  }
510 #pragma omp barrier
511 
512 }
513 
514 //====================================================================
515 template<typename REALTYPE>
517  const typename ComplexTraits<REALTYPE>::complex_t a,
518  const AField<REALTYPE,ACCEL>& w)
519 {
520  assert(check_size(w));
521 
522  int ith, nth;
523  set_thread(ith, nth);
524 
525  if(ith == 0){
526  REALTYPE ar = real(a);
527  REALTYPE ai = imag(a);
528  int nvex = m_nsize_pad/m_nin;
529  BridgeACC::aypx(ar, ai, m_field, 0, w.m_field, 0, m_nin, nvex);
530  }
531 #pragma omp barrier
532 
533 }
534 
535 //====================================================================
536 template<typename REALTYPE>
538  const int ex,
539  const typename ComplexTraits<REALTYPE>::complex_t a,
540  const AField<REALTYPE,ACCEL>& w,
541  const int ex_w)
542 {
543  assert( nin() == w.nin());
544  assert(nvol() == w.nvol());
545  assert(ex < nex());
546  assert(ex_w < w.nex());
547 
548  int ith, nth;
549  set_thread(ith, nth);
550 
551  if(ith == 0){
552  int size2 = m_nin * m_nvol_pad;
553  REALTYPE ar = real(a);
554  REALTYPE ai = imag(a);
555  BridgeACC::aypx(ar, ai, m_field, size2 * ex, w.m_field, size2 * ex_w,
556  m_nin, m_nvol_pad);
557  }
558 
559 #pragma omp barrier
560 
561 }
562 
563 //====================================================================
564 template<typename REALTYPE>
565 void AField<REALTYPE,ACCEL>::scal(const REALTYPE a)
566 {
567  int ith, nth;
568  set_thread(ith, nth);
569 
570  if(ith == 0){
571  int nvex = m_nsize_pad/m_nin;
572  BridgeACC::scal(m_field, 0, a, m_nin, nvex);
573  }
574 #pragma omp barrier
575 
576 }
577 
578 //====================================================================
579 template<typename REALTYPE>
580 void AField<REALTYPE,ACCEL>::scal(const REALTYPE a, const int ex)
581 {
582  int size2 = m_nin * m_nvol_pad;
583 
584  int ith, nth;
585  set_thread(ith, nth);
586 
587  if(ith == 0){
588  BridgeACC::scal(m_field, size2 * ex, a, m_nin, m_nvol_pad);
589  }
590 
591 #pragma omp barrier
592 
593 }
594 
595 //====================================================================
596 template<typename REALTYPE>
598  const typename ComplexTraits<REALTYPE>::complex_t a)
599 {
600  REALTYPE ar = real(a);
601  REALTYPE ai = imag(a);
602 
603  int ith, nth;
604  set_thread(ith, nth);
605 
606  if(ith == 0){
607  int nvex = m_nsize_pad/m_nin;
608  BridgeACC::scal(m_field, 0, ar, ai, m_nin, nvex);
609  }
610 
611 #pragma omp barrier
612 
613 }
614 
615 //====================================================================
616 template<typename REALTYPE>
618  const typename ComplexTraits<REALTYPE>::complex_t a,
619  const int ex)
620 {
621  int size2 = m_nin * m_nvol_pad;
622 
623  REALTYPE ar = real(a);
624  REALTYPE ai = imag(a);
625 
626  int ith, nth;
627  set_thread(ith, nth);
628 
629  if(ith == 0){
630  BridgeACC::scal(m_field, size2 * ex, ar, ai, m_nin, m_nvol_pad);
631  }
632 #pragma omp barrier
633 
634 }
635 
636 //====================================================================
637 template<typename REALTYPE>
639 {
640  assert(check_size(w));
641 
642  int ith, nth;
643  set_thread(ith, nth);
644 
645  real_t a = 0.0;
646 
647  if(ith == 0){
648 #ifdef USE_ACCEL_OPENACC
649  int nvex = m_nsize_pad/m_nin;
650  a = BridgeACC::dot(m_field, w.m_field, m_nin, nvex);
651 #else
652  a = BridgeACC::dot(m_field, w.m_field,
653  m_red1, m_nin, m_nvol_pad, m_nex);
654 #endif
655  }
656 #pragma omp barrier
657 
659 
660  return a;
661 
662 }
663 
664 //====================================================================
665 template<typename REALTYPE>
666 void AField<REALTYPE,ACCEL>::dotc(REALTYPE& ar, REALTYPE& ai,
667  const AField<REALTYPE,ACCEL>& w) const
668 {
669  assert(check_size(w));
670 
671  int ith, nth;
672  set_thread(ith, nth);
673 
674  real_t ar2 = 0.0;
675  real_t ai2 = 0.0;
676 
677  if(ith == 0){
678 #ifdef USE_ACCEL_OPENACC
679  int nvex = m_nvol_pad * m_nex;
680  BridgeACC::dotc(&ar2, &ai2, m_field, w.m_field, m_nin, nvex);
681 #else
682  BridgeACC::dotc(&ar2, &ai2, m_field, w.m_field,
683  m_red1, m_red2, m_nin, m_nvol_pad, m_nex);
684 #endif
685  }
686 
687 #pragma omp barrier
688 
689  real_t sum[2] = { ar2, ai2 };
690  ThreadManager::reduce_sum_global(sum, 2, ith, nth);
691  ar = sum[0];
692  ai = sum[1];
693 
694 }
695 
696 //====================================================================
697 template<typename REALTYPE>
699 {
700  int ith, nth;
701  set_thread(ith, nth);
702 
703  real_t a = 0.0;
704 
705  if(ith == 0){
706 #ifdef USE_ACCEL_OPENACC
707  int nvex = m_nvol_pad * m_nex;
708  a = BridgeACC::norm2(m_field, m_nin, nvex);
709 #else
710  a = BridgeACC::norm2(m_field, m_red1, m_nin, m_nvol_pad, m_nex);
711 #endif
712  }
713 #pragma omp barrier
714 
716 
717  return a;
718 
719 }
720 
721 //====================================================================
722 template<typename REALTYPE>
724 {
725  int ith, nth;
726  set_thread(ith, nth);
727 
728  real_t a = 0.0;
729 
730  if(ith == 0){
731  int nvex = m_nvol_pad * m_nex;
732  for(int ivex = 0; ivex < nvex; ++ivex){
733  real_t at = 0.0;
734  for(int in = 0; in < m_nin; ++in){
735  real_t ft = m_field[IDX2(m_nin, in, ivex)];
736  at += ft * ft;
737  }
738  a += at;
739  }
740  }
741 #pragma omp barrier
742 
744 
745  return a;
746 
747 }
748 
749 //====================================================================
750 template<typename REALTYPE>
752 {
753  if(field_element_type() != Element_type::COMPLEX){
754  vout.general("%s: xI is not relevant opearation\n",
755  class_name.c_str());
756  return;
757  }
758 
759  int ith, nth;
760  set_thread(ith, nth);
761 
762  if(ith == 0){
763  int nvex = m_nvol_pad * m_nex;
764  BridgeACC::xI(m_field, m_nin, nvex);
765  }
766 #pragma omp barrier
767 
768 }
769 
770 //====================================================================
771 template<typename REALTYPE>
773 {
774  if(field_element_type() == Element_type::REAL) return;
775 
776  int ith, nth;
777  set_thread(ith, nth);
778 
779  if(ith == 0){
780  int nvex = m_nvol_pad * m_nex;
781  BridgeACC::conjg(m_field, m_nin, nvex);
782  }
783 #pragma omp barrier
784 
785 }
786 
787 //============================================================END=====
BridgeACC::afield_tidyup
void afield_tidyup(double *data, const int size)
AField< REALTYPE, ACCEL >::nin
int nin() const
returning size of inner (on site) d.o.f.
Definition: afield.h:116
BridgeACC::copy
void copy(double *v, double *w, int nin, int nvol)
update_device
void update_device(AField< REALTYPE, ACCEL > &v)
Definition: afield-inc.h:33
AField
Definition: afield_base.h:16
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
aypx
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
Definition: field.cpp:510
axpy
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:381
dot
double dot(const Field &y, const Field &x)
Definition: field.cpp:577
BridgeACC::copy_from_device
void copy_from_device(double *v, int nv)
BridgeACC::axpy
void axpy(double *restrict v, int nv1, double a, double *restrict w, int nv2, int nin, int nvol)
update_host
void update_host(AField< REALTYPE, ACCEL > &v)
Definition: afield-inc.h:26
copy
void copy(Field &y, const Field &x)
copy(y, x): y = x
Definition: field.cpp:213
AField< REALTYPE, ACCEL >::nex
int nex() const
returning size of extra d.o.f.
Definition: afield.h:122
Bridge::BridgeIO::paranoiac
void paranoiac(const char *format,...)
Definition: bridgeIO.cpp:300
AField::class_name
const std::string class_name
Definition: afield_double.cpp:31
BridgeACC::conjg
void conjg(double *restrict v1, int nin, int nvol)
BridgeACC::aypx
void aypx(double a, double *restrict v, int nv1, double *restrict w, int nv2, int nin, int nvol)
BridgeACC::scal
void scal(double *restrict v, int nv1, double a, int nin, int nvol)
AField< REALTYPE, ACCEL >::m_field
real_t * m_field
Definition: afield.h:57
BridgeACC::afield_set
void afield_set(double *v, double a, const int nin, const int nv2)
ThreadManager::reduce_sum_global
static void reduce_sum_global(dcomplex &value, const int i_thread, const int Nthread)
global reduction with summation: dcomplex values are assumed thread local.
Definition: threadManager.cpp:288
Element_type::REAL
@ REAL
Definition: bridge_defs.h:43
dotc
dcomplex dotc(const Field &y, const Field &x)
Definition: field.cpp:713
SU_N::xI
Mat_SU_N xI(const Mat_SU_N &u)
Definition: mat_SU_N.h:586
ComplexTraits
Definition: complexTraits.h:16
BridgeACC::norm2
double norm2(double *restrict v1, int nin, int nvol)
AField< REALTYPE, ACCEL >::real_t
REALTYPE real_t
Definition: afield.h:35
IDX2
#define IDX2(nin, in, ist)
Definition: define_index.h:28
define_index.h
Field::cmp
double cmp(const int jin, const int site, const int jex) const
Definition: field.h:143
CommonParameters::Vlevel
static Bridge::VerboseLevel Vlevel()
Definition: commonParameters.h:122
BridgeACC::dotc
void dotc(double *ar, double *ai, double *restrict v1, double *restrict v2, int nin, int nvv)
Element_type::COMPLEX
@ COMPLEX
Definition: bridge_defs.h:43
scal
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:262
BridgeACC::dot
double dot(double *restrict v1, double *restrict v2, int nin, int nvol)
AField< REALTYPE, ACCEL >::nvol
int nvol() const
returning size of site d.o.f.
Definition: afield.h:119
BridgeACC::xI
void xI(double *restrict v1, int nin, int nvol)
define_params.h
BridgeACC::exit_data_delete
void exit_data_delete(double *data, const size_t size)
Definition: bridgeACC.cpp:25
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
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:262
BridgeACC::copy_to_device
void copy_to_device(double *v, int nv)
AField< REALTYPE, ACCEL >
Definition: afield.h:31
ThreadManager::assert_single_thread
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
Definition: threadManager.cpp:372
Element_type::type
type
Definition: bridge_defs.h:41
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:572
BridgeACC::afield_init
void afield_init(double *data, const int size)