Bridge++  Ver.2.1.3
define_index.h
Go to the documentation of this file.
1 
9 #ifndef ACCEL_DEFINE_INDEX_INCLUDED
10 #define ACCEL_DEFINE_INDEX_INCLUDED
11 
12 // Index functions for lib_alt_Accel implementation.
13 // Note that this file must be included after define_params_SU3.h.
14 // [21 Jul 2019 H.Matsufuru]
15 
16 // the following definitions explicitly assume the SU(3) gauge group.
17 #define ID1 0
18 #define ID2 6
19 #define ID3 12
20 #define ID4 18
21 
22 #define NDD 8 // assuming ND = 4
23 
24 // index of corelib
25 #define IDX_CORE(nin, in, ist) ((in) + (nin) * (ist))
26 
27 // general index
28 #define IDX2(nin, in, ist) (((ist)%NWP) + NWP*((in) + (nin)*((ist)/NWP)))
29 
30 // for Wilson-type fermion
31 #define IDX2_SP_R(ic, id, ist) (((ist)%NWP) + NWP*(2*(ic) + NVC*((id) + ND*((ist)/NWP))))
32 #define IDX2_SP_I(ic, id, ist) (((ist)%NWP) + NWP*(2*(ic)+1 + NVC*((id) + ND*((ist)/NWP))))
33 #define IDX2_SP(ivc, id, ist) (((ist)%NWP) + NWP*((ivc) + NVC*((id) + ND*((ist)/NWP))))
34 
35 // for Domainwall-type fermion
36 #define IDX2_SP_5D_R(ic, id, is, Ns, ist) (((ist)%NWP) + NWP*(2*(ic) + NVC*((id) + ND*( (is) + (Ns) * ((ist)/NWP)))))
37 #define IDX2_SP_5D_I(ic, id, is, Ns, ist) (((ist)%NWP) + NWP*(2*(ic)+1 + NVC*((id) + ND*( (is) + (Ns) * ((ist)/NWP)))))
38 
39 
40 // for communication buffer of Wilson-type fermion
41 #define IDXBF_R(ic, id, ist) (((ist)%NWP) + NWP*(2*(ic) + NVC*((id) + ND2*((ist)/NWP))))
42 #define IDXBF_I(ic, id, ist) (((ist)%NWP) + NWP*(2*(ic)+1 + NVC*((id) + ND2*((ist)/NWP))))
43 #define IDXBF(ivc, id, ist) (((ist)%NWP) + NWP*((ivc) + NVC*((id) + ND2*((ist)/NWP))))
44 
45 // for 1 component spinor (staggered)
46 #define IDX2_1SP_R(ic, ist) (((ist)%NWP) + NWP*( 2*((ic) + NC*((ist)/NWP))))
47 #define IDX2_1SP_I(ic, ist) (((ist)%NWP) + NWP*(1+2*((ic) + NC*((ist)/NWP))))
48 #define IDX2_1SP(ivc, ist) (((ist)%NWP) + NWP*((ivc) + NVC*((ist)/NWP)))
49 
50 // for gauge field
51 #define IDX2_G_R(ic1, ic2, ist) (((ist)%NWP) + NWP*( 2*((ic1) + NC*((ic2) + NC*((ist)/NWP)))))
52 #define IDX2_G_I(ic1, ic2, ist) (((ist)%NWP) + NWP*(1+2*((ic1) + NC*((ic2) + NC*((ist)/NWP)))))
53 
54 // for clover term
55 #define IDX_CT_R(ic1, ic2, idd, ist) (((ist)%NWP) + NWP*( 2*((ic1) + NC*((ic2) + NC*((idd) + NDD*((ist)/NWP))))))
56 #define IDX_CT_I(ic1, ic2, idd, ist) (((ist)%NWP) + NWP*(1+2*((ic1) + NC*((ic2) + NC*((idd) + NDD*((ist)/NWP))))))
57 
58 // for Domainwall-type fermion
59 #define IDX2_5D(nin, in, is, Ns, ist) (((ist) % NWP) + NWP * ((in) + (nin) * (is + (Ns) * ((ist) / NWP))))
60 
61 #define IDX2_SP_5D_R(ic, id, is, Ns, ist) (((ist)%NWP) + NWP*(2*(ic) + NVC*((id) + ND*( (is) + (Ns) * ((ist)/NWP)))))
62 #define IDX2_SP_5D_I(ic, id, is, Ns, ist) (((ist)%NWP) + NWP*(2*(ic)+1 + NVC*((id) + ND*( (is) + (Ns) * ((ist)/NWP)))))
63 
64 #endif