diff options
Diffstat (limited to 'src/include/cctk_Loop.h.pl')
-rwxr-xr-x | src/include/cctk_Loop.h.pl | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/include/cctk_Loop.h.pl b/src/include/cctk_Loop.h.pl index 311efbcb..d290df79 100755 --- a/src/include/cctk_Loop.h.pl +++ b/src/include/cctk_Loop.h.pl @@ -249,11 +249,12 @@ for $dim (1,2,3,4) { # Export loop bounds in the i direction (bsnl ' int const imin CCTK_ATTRIBUTE_UNUSED = cctki0_imin;'), (bsnl ' int const imax CCTK_ATTRIBUTE_UNUSED = cctki0_imax;'), - (bsnl ' _Pragma("omp for[DIM==1?: collapse([DIM-1])]")'), - (reverse (rpt (bsnl (' for (int [C]=cctki0_[C]min' . - # Align i-loop to vector size - '[I==1? - ' . (sep '', rpt '[I==1?(cctki0_imin:+cctki0_[C-1]ash*([C]]') . (sep '', rpt ')') . ' % cctki0_istr:]' . - '; [C]<cctki0_[C]max; [I==1?[C]+=cctki0_[C]str:++[C]]) {')))), + (bsnl ' [DIM==1?:_Pragma("omp for collapse([DIM-1])")]'), + (reverse (rpt (bsnl ' [I==1?:for (int [C]=cctki0_[C]min; [C]<cctki0_[C]max; ++[C]) {]'))), + # Align i-loop to vector size + (bsnl (' int const cctki0_ioff = ' . (sep '', rpt '[I==1?(cctki0_imin:+cctki0_[C-1]ash*([C]]') . (sep '', rpt ')') . ' % cctki0_istr;')), + (bsnl ' [DIM==1?_Pragma("omp for"):]'), + (bsnl ' for (int i=cctki0_imin-cctki0_ioff; i<cctki0_imax; i+=cctki0_istr) {'), (rpt (bsnl ' int const n[C] CCTK_ATTRIBUTE_UNUSED = cctki0_[C]dir<0 ? [C]+1 : cctki0_[C]dir==0 ? 0 : cctki0_[C]max-[C];')), (bsnl ' {'), (nl ''), @@ -889,11 +890,11 @@ for $dim (1,2,3,4) { (rpt (bsnl ' && if (name/**/2_[C]dir==-1) name/**/2_any_bbox = name/**/2_any_bbox .or. name/**/2_bboxlo([I+1]) /= 0')), (rpt (bsnl ' && if (name/**/2_[C]dir==+1) name/**/2_any_bbox = name/**/2_any_bbox .or. name/**/2_bboxhi([I+1]) /= 0')), (bsnl ' && if (name/**/2_any_bbox) then'), + (rpt (bsnl ' && name/**/2_bmin([I+1]) = name/**/2_blo([I+1])+1')), (rpt (bsnl ' && if (name/**/2_[C]dir==-1) name/**/2_bmin([I+1]) = 1')), - (rpt (bsnl ' && if (name/**/2_[C]dir== 0) name/**/2_bmin([I+1]) = name/**/2_blo([I+1])+1')), (rpt (bsnl ' && if (name/**/2_[C]dir==+1) name/**/2_bmin([I+1]) = cctk_lsh([I+1]) - name/**/2_bhi([I+1])')), + (rpt (bsnl ' && name/**/2_bmax([I+1]) = cctk_lsh([I+1]) - name/**/2_bhi([I+1])')), (rpt (bsnl ' && if (name/**/2_[C]dir==-1) name/**/2_bmax([I+1]) = name/**/2_blo([I+1])')), - (rpt (bsnl ' && if (name/**/2_[C]dir== 0) name/**/2_bmax([I+1]) = cctk_lsh([I+1]) - name/**/2_bhi([I+1])')), (rpt (bsnl ' && if (name/**/2_[C]dir==+1) name/**/2_bmax([I+1]) = cctk_lsh([I+1])')), (bsnl ' CCTK_LOOP[DIM]STR_NORMAL(name/**/_boundaries,'), (bsnl ' '.(crpt '[C]').','), @@ -973,11 +974,11 @@ for $dim (1,2,3,4) { (rpt (bsnl ' && if (name/**/2_[C]dir==-1) name/**/2_all_bbox = name/**/2_all_bbox .and. name/**/2_bboxlo([I+1]) /= 0')), (rpt (bsnl ' && if (name/**/2_[C]dir==+1) name/**/2_all_bbox = name/**/2_all_bbox .and. name/**/2_bboxhi([I+1]) /= 0')), (bsnl ' && if (name/**/2_all_bbox .and. name/**/2_any_bbox) then'), + (rpt (bsnl ' && name/**/2_bmin([I+1]) = name/**/2_blo([I+1])+1')), (rpt (bsnl ' && if (name/**/2_[C]dir==-1) name/**/2_bmin([I+1]) = 1')), - (rpt (bsnl ' && if (name/**/2_[C]dir== 0) name/**/2_bmin([I+1]) = name/**/2_blo([I+1])+1')), (rpt (bsnl ' && if (name/**/2_[C]dir==+1) name/**/2_bmin([I+1]) = cctk_lsh([I+1]) - name/**/2_bhi([I+1])')), + (rpt (bsnl ' && name/**/2_bmax([I+1]) = cctk_lsh([I+1]) - name/**/2_bhi([I+1])')), (rpt (bsnl ' && if (name/**/2_[C]dir==-1) name/**/2_bmax([I+1]) = name/**/2_blo([I+1])')), - (rpt (bsnl ' && if (name/**/2_[C]dir== 0) name/**/2_bmax([I+1]) = cctk_lsh([I+1]) - name/**/2_bhi([I+1])')), (rpt (bsnl ' && if (name/**/2_[C]dir==+1) name/**/2_bmax([I+1]) = cctk_lsh([I+1])')), (bsnl ' CCTK_LOOP[DIM]STR_NORMAL(name/**/_intboundaries,'), (bsnl ' '.(crpt '[C]').','), |