Skip to content

Instantly share code, notes, and snippets.

@kaushikcfd
Created November 14, 2017 02:41
Show Gist options
  • Save kaushikcfd/fcea3e835abf7cda3962a0f2f81a9e79 to your computer and use it in GitHub Desktop.
Save kaushikcfd/fcea3e835abf7cda3962a0f2f81a9e79 to your computer and use it in GitHub Desktop.
---------------------------------------------------------------------------
KERNEL: loopy_kernel_and_loopy_kernel_and_tsfc_kernel_and_loopy_kernel
---------------------------------------------------------------------------
ARGUMENTS:
A0_global: GlobalArg, type: np_atomic:dtype('float64'), shape: (A0_size), dim_tags: (N0:stride:1)
A0_size: ValueArg, type: np:dtype('int32')
coords_global: GlobalArg, type: np:dtype('float64'), shape: (coords_global_len, 2), dim_tags: (N1:stride:2, N0:stride:1)
coords_global_len: ValueArg, type: np:dtype('int32')
ltg_0: GlobalArg, type: np:dtype('int32'), shape: (nelements, 3), dim_tags: (N1:stride:3, N0:stride:1)
ltg_1: GlobalArg, type: np:dtype('int32'), shape: (nelements, 3), dim_tags: (N1:stride:3, N0:stride:1)
nelements: ValueArg, type: np:dtype('int32')
w_0_global: GlobalArg, type: np:dtype('float64'), shape: (w_0_global_len), dim_tags: (N0:stride:1)
w_0_global_len: ValueArg, type: np:dtype('int32')
---------------------------------------------------------------------------
DOMAINS:
[A0_size, nelements] -> { [i_init_0, ibf_gather_0, ibf_scat_0, idim_scat_0, ibf_scat_1, idim_scat_1, iel_outer, iel_inner]
: idim_scat_1 = 0 and 0 <= i_init_0 < A0_size and 0 <= ibf_gather_0 <= 2 and 0 <= ibf_scat_0 <= 2 and 0 <= idim_scat_0 <= 1
and 0 <= ibf_scat_1 <= 2 and iel_inner >= 0 and -2iel_outer <= iel_inner <= 1 and iel_inner < nelements - 2iel_outer }
{ [i12, i1, i1_0] : 0 <= i12 <= 2 and 0 <= i1 <= 2 and 0 <= i1_0 <= 2 }
---------------------------------------------------------------------------
INAME IMPLEMENTATION TAGS:
i1: None
i1_0: None
i12: None
i_init_0: None
ibf_gather_0: None
ibf_scat_0: None
ibf_scat_1: None
idim_scat_0: None
idim_scat_1: None
iel_inner: l.0
iel_outer: g.0
---------------------------------------------------------------------------
TEMPORARIES:
cnst: type: np:dtype('float64'), shape: (3, 3), dim_tags: (N1:stride:3, N0:stride:1) scope:global
cnst_0: type: np:dtype('float64'), shape: (3), dim_tags: (N0:stride:1) scope:global
sum_tmp_0: type: np:dtype('float64'), shape: (i1_0:3), dim_tags: (N0:stride:1) scope:auto
---------------------------------------------------------------------------
SUBSTIUTION RULES:
A_0_subst(iel, i1) := sum_tmp_0[i1]
coords_subst(iel, ibf_scat_0, idim_scat_0) := coords_global[ltg_0[iel, ibf_scat_0], idim_scat_0]
w_0_subst(iel, ibf_scat_1, idim_scat_1) := w_0_global[ltg_1[iel, ibf_scat_1]]
---------------------------------------------------------------------------
INSTRUCTIONS:
for iel_outer, iel_inner, i1_0
↱ sum_tmp_0[i1_0] = reduce(sum, [i12], cnst[i12, i1_0]*(cnst[i12, 2]*w_0_subst(iel_inner + iel_outer*2, 2, 0) + cn
st[i12, 0]*w_0_subst(iel_inner + iel_outer*2, 0, 0) + cnst[i12, 1]*w_0_subst(iel_inner + iel_outer*2, 1, 0))*cnst_0[i12]*ab
s(((-1.0)*coords_subst(iel_inner + iel_outer*2, 0, 0) + coords_subst(iel_inner + iel_outer*2, 1, 0))*((-1.0)*coords_subst(i
el_inner + iel_outer*2, 0, 1) + coords_subst(iel_inner + iel_outer*2, 2, 1)) + (-1.0)*((-1.0)*coords_subst(iel_inner + iel_
outer*2, 0, 0) + coords_subst(iel_inner + iel_outer*2, 2, 0))*((-1.0)*coords_subst(iel_inner + iel_outer*2, 0, 1) + coords_
subst(iel_inner + iel_outer*2, 1, 1)))) {id=sum_tmp}
│ end iel_outer, iel_inner, i1_0
│ for i_init_0
│↱↱ A0_global[i_init_0] = 0.0 {id=init_0, atomic=update[A0_global]seq_cst/auto}
│││ end i_init_0
│└│↱ ... gbarrier {id=gb1}
│ ││ for ibf_gather_0, iel_outer, iel_inner
└ └└ A0_global[ltg_1[iel_inner + iel_outer*2, ibf_gather_0]] = A0_global[ltg_1[iel_inner + iel_outer*2, ibf_gather_0]
] + A_0_subst(iel_inner + iel_outer*2, ibf_gather_0) {id=insn, atomic=update[A0_global]seq_cst/auto}
end ibf_gather_0, iel_outer, iel_inner
---------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment