diff options
author | schnetter <schnetter@2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8> | 2007-02-28 22:11:46 +0000 |
---|---|---|
committer | schnetter <schnetter@2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8> | 2007-02-28 22:11:46 +0000 |
commit | 02fcfe17b895d0632b5f1a9ce218d013bb5964ff (patch) | |
tree | 830dc16226cdf96ccf21f878fc08c10995452e9c | |
parent | 2f6320384b3cec7ea446319f9272657d8a79e8e6 (diff) |
Add restrict qualifiers
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Slab/trunk@54 2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8
-rw-r--r-- | src/slab.c | 261 | ||||
-rw-r--r-- | src/slab.h | 44 |
2 files changed, 173 insertions, 132 deletions
@@ -78,7 +78,8 @@ static int timer_copy_in; static int timer_xfer; static int timer_copy_back; -int Slab_InitTimers (void) +int +Slab_InitTimers (void) { timer_init = CCTK_TimerCreate ("Slab/init"); timer_copy_in = CCTK_TimerCreate ("Slab/copy in"); @@ -87,7 +88,8 @@ int Slab_InitTimers (void) return 0; } -int Slab_PrintTimers (void) +int +Slab_PrintTimers (void) { CCTK_TimerPrintDataI (timer_init , -1); CCTK_TimerPrintDataI (timer_copy_in , -1); @@ -422,7 +424,8 @@ normal_type (int cactustype) /* Find the MPI datatype corresponding to a Cactus datatype */ -static MPI_Datatype mpi_type (int const cactustype) +static MPI_Datatype +mpi_type (int const cactustype) { int const normaltype = normal_type (cactustype); switch (normaltype) { @@ -479,7 +482,8 @@ struct info { -static inline int roundup (int const x, int const y) +static inline int +roundup (int const x, int const y) { assert (x >= 0); assert (y > 0); @@ -488,7 +492,8 @@ static inline int roundup (int const x, int const y) -static void bbox_print (struct bbox const * restrict const bbox) +static void +bbox_print (struct bbox const * restrict const bbox) { assert (bbox); printf @@ -496,15 +501,17 @@ static void bbox_print (struct bbox const * restrict const bbox) bbox->off, bbox->off + (bbox->len - 1) * bbox->str, bbox->str); } -static void bbox_check (struct bbox const * restrict const bbox) +static void +bbox_check (struct bbox const * restrict const bbox) { assert (bbox); assert (bbox->len >= 0); assert (bbox->str > 0); } -static void global2bbox (struct slabinfo const * restrict const slab, - struct bbox * restrict const bbox) +static void +global2bbox (struct slabinfo const * restrict const slab, + struct bbox * restrict const bbox) { assert (slab); assert (bbox); @@ -515,8 +522,9 @@ static void global2bbox (struct slabinfo const * restrict const slab, bbox_check (bbox); } -static void local2bbox (struct slabinfo const * restrict const slab, - struct bbox * restrict const bbox) +static void +local2bbox (struct slabinfo const * restrict const slab, + struct bbox * restrict const bbox) { assert (slab); assert (bbox); @@ -529,9 +537,10 @@ static void local2bbox (struct slabinfo const * restrict const slab, bbox_check (bbox); } -static void active2bbox (struct slabinfo const * restrict const slab, - struct bbox * restrict const bbox, - int const useghosts) +static void +active2bbox (struct slabinfo const * restrict const slab, + struct bbox * restrict const bbox, + int const useghosts) { int nlghostzones; int nughostzones; @@ -552,8 +561,9 @@ static void active2bbox (struct slabinfo const * restrict const slab, bbox_check (bbox); } -static void slab2bbox (struct slabinfo const * restrict const slab, - struct bbox * restrict const bbox) +static void +slab2bbox (struct slabinfo const * restrict const slab, + struct bbox * restrict const bbox) { assert (slab); assert (bbox); @@ -563,8 +573,9 @@ static void slab2bbox (struct slabinfo const * restrict const slab, bbox_check (bbox); } -static int bbox_iscontained (struct bbox const * restrict const inner, - struct bbox const * restrict const outer) +static int +bbox_iscontained (struct bbox const * restrict const inner, + struct bbox const * restrict const outer) { int inner_last; int outer_last; @@ -575,8 +586,9 @@ static int bbox_iscontained (struct bbox const * restrict const inner, return inner->off >= outer->off && inner_last <= outer_last; } -static void bbox_clip (struct bbox * restrict const inner, - struct bbox const * restrict const outer) +static void +bbox_clip (struct bbox * restrict const inner, + struct bbox const * restrict const outer) { int inner_last; int outer_last; @@ -599,11 +611,12 @@ static void bbox_clip (struct bbox * restrict const inner, bbox_check (inner); } -static void bbox_xform (struct bbox * restrict const ydst, - struct bbox const * restrict const ysrc, - struct bbox const * restrict const xdst, - struct bbox const * restrict const xsrc, - int const flip) +static void +bbox_xform (struct bbox * restrict const ydst, + struct bbox const * restrict const ysrc, + struct bbox const * restrict const xdst, + struct bbox const * restrict const xsrc, + int const flip) { int xsrc_last; int xdst_last; @@ -636,8 +649,8 @@ static void bbox_xform (struct bbox * restrict const ydst, void -print_slabinfo (FILE * const out, - struct slabinfo const * const slabinfo) +print_slabinfo (FILE * const out, + struct slabinfo const * restrict const slabinfo) { fprintf (out, " gsh: %d\n", slabinfo->gsh); fprintf (out, " lbnd: %d, lsh: %d\n", slabinfo->lbnd, slabinfo->lsh); @@ -648,8 +661,8 @@ print_slabinfo (FILE * const out, } void -print_xferinfo (FILE * const out, - struct xferinfo const * const xferinfo) +print_xferinfo (FILE * const out, + struct xferinfo const * restrict const xferinfo) { fprintf (out, " src:\n"); print_slabinfo (out, & xferinfo->src); @@ -661,15 +674,16 @@ print_xferinfo (FILE * const out, -int Slab_MultiTransfer (cGH const * const cctkGH, - int const dim, - struct xferinfo const * const xferinfo, - int const options, - int const nvars, - int const * const srctypes, - void const * const * const srcptrs, - int const * const dsttypes, - void * const * const dstptrs) +int +Slab_MultiTransfer (cGH const * restrict const cctkGH, + int const dim, + struct xferinfo const * restrict const xferinfo, + int const options, + int const nvars, + int const * restrict const srctypes, + void const * restrict const * restrict const srcptrs, + int const * restrict const dsttypes, + void * restrict const * restrict const dstptrs) { DECLARE_CCTK_PARAMETERS; @@ -1134,7 +1148,9 @@ int Slab_MultiTransfer (cGH const * const cctkGH, check (SLAB_MAXDIM == 3); if (info[0].xpose==0 && info[1].xpose==1 && info[2].xpose==2 - && srcdetail[n*SLAB_MAXDIM ].str==1 && srcdetail[n*SLAB_MAXDIM+1].str==1 && srcdetail[n*SLAB_MAXDIM+2].str==1 + && srcdetail[n*SLAB_MAXDIM ].str==1 + && srcdetail[n*SLAB_MAXDIM+1].str==1 + && srcdetail[n*SLAB_MAXDIM+2].str==1 && srctype == CCTK_VARIABLE_REAL) { /* Optimised version for a special case: no transposing */ @@ -1164,20 +1180,24 @@ int Slab_MultiTransfer (cGH const * const cctkGH, int const srcindi = srcdetailoffi + i - srcoffi; int const srcindj = srcdetailoffj + j - srcoffj; int const srcindk = srcdetailoffk + k - srcoffk; - size_t const srcind = srcindi + srcleni * (srcindj + srclenj * srcindk); + size_t const srcind + = srcindi + srcleni * (srcindj + srclenj * srcindk); size_t const bufind = i + srcdetailleni * (j + srcdetaillenj * k); ifcheck assert (srcindi>=0 && srcindi<srcleni); ifcheck assert (srcindj>=0 && srcindj<srclenj); ifcheck assert (srcindk>=0 && srcindk<srclenk); for (var=0; var<nvars; ++var) { - ((CCTK_REAL*)srcdata)[srcoffset[n] + var * srcelems[n] + bufind] = ((const CCTK_REAL*)srcptrs[var])[srcind]; + ((CCTK_REAL*restrict)srcdata)[srcoffset[n] + var * srcelems[n] + bufind] + = ((const CCTK_REAL*restrict)srcptrs[var])[srcind]; } } } } } else if (info[0].xpose==1 && info[1].xpose==0 && info[2].xpose==2 - && srcdetail[n*SLAB_MAXDIM ].str==1 && srcdetail[n*SLAB_MAXDIM+1].str==1 && srcdetail[n*SLAB_MAXDIM+2].str==1 + && srcdetail[n*SLAB_MAXDIM ].str==1 + && srcdetail[n*SLAB_MAXDIM+1].str==1 + && srcdetail[n*SLAB_MAXDIM+2].str==1 && srctype == CCTK_VARIABLE_REAL) { /* Optimised version for a special case: transpose x and y */ @@ -1207,19 +1227,23 @@ int Slab_MultiTransfer (cGH const * const cctkGH, int const srcindi = srcdetailoffi + i - srcoffi; int const srcindj = srcdetailoffj + j - srcoffj; int const srcindk = srcdetailoffk + k - srcoffk; - size_t const srcind = srcindi + srcleni * (srcindj + srclenj * srcindk); + size_t const srcind + = srcindi + srcleni * (srcindj + srclenj * srcindk); size_t const bufind = j + srcdetaillenj * (i + srcdetailleni * k); ifcheck assert (srcindi>=0 && srcindi<srcleni); ifcheck assert (srcindj>=0 && srcindj<srclenj); ifcheck assert (srcindk>=0 && srcindk<srclenk); for (var=0; var<nvars; ++var) { - ((CCTK_REAL*)srcdata)[srcoffset[n] + var * srcelems[n] + bufind] = ((const CCTK_REAL*)srcptrs[var])[srcind]; + ((CCTK_REAL*restrict)srcdata)[srcoffset[n] + var * srcelems[n] + bufind] + = ((const CCTK_REAL*restrict)srcptrs[var])[srcind]; } } } } - } else if (srcdetail[n*SLAB_MAXDIM ].str==1 && srcdetail[n*SLAB_MAXDIM+1].str==1 && srcdetail[n*SLAB_MAXDIM+2].str==1 + } else if (srcdetail[n*SLAB_MAXDIM ].str==1 + && srcdetail[n*SLAB_MAXDIM+1].str==1 + && srcdetail[n*SLAB_MAXDIM+2].str==1 && srctype == CCTK_VARIABLE_REAL) { /* Optimised version for CCTK_REAL and stride 1 */ @@ -1242,7 +1266,8 @@ int Slab_MultiTransfer (cGH const * const cctkGH, assert (srcipos[c] >= allinfo[n*SLAB_MAXDIM+c].src.slab.off && srcipos[c] <= allinfo[n*SLAB_MAXDIM+c].src.slab.off + (allinfo[n*SLAB_MAXDIM+c].src.slab.len - 1)); bufipos[d] = ipos[d]; - assert (bufipos[d] >= 0 && bufipos[d] < srcdetail[n*SLAB_MAXDIM+c].len); + assert (bufipos[d] >= 0 + && bufipos[d] < srcdetail[n*SLAB_MAXDIM+c].len); } srcind = 0; bufind = 0; @@ -1254,8 +1279,8 @@ int Slab_MultiTransfer (cGH const * const cctkGH, assert (srcind < srclentot); assert (bufind < (size_t)srccount[n]); for (var=0; var<nvars; ++var) { - ((CCTK_REAL*)srcdata)[srcoffset[n] + var * srcelems[n] + bufind] - = ((const CCTK_REAL*)srcptrs[var])[srcind]; + ((CCTK_REAL*restrict)srcdata)[srcoffset[n] + var * srcelems[n] + bufind] + = ((const CCTK_REAL*restrict)srcptrs[var])[srcind]; } } } @@ -1295,8 +1320,6 @@ int Slab_MultiTransfer (cGH const * const cctkGH, } assert (srcind < srclentot); assert (bufind < (size_t)srccount[n]); -/* ((CCTK_REAL*)srcdata)[srcoffset[n] + bufind] */ -/* = ((const CCTK_REAL*)srcptr)[srcind]; */ for (var=0; var<nvars; ++var) { memcpy ((char *) srcdata + srctypesize * (srcoffset[n] + var * srcelems[n] + bufind), (const char *) srcptrs[var] + srctypesize * srcind, @@ -1390,7 +1413,9 @@ int Slab_MultiTransfer (cGH const * const cctkGH, check (SLAB_MAXDIM == 3); if (info[0].flip==0 && info[1].flip==0 && info[2].flip==0 - && dstdetail[n*SLAB_MAXDIM ].str==1 && dstdetail[n*SLAB_MAXDIM+1].str==1 && dstdetail[n*SLAB_MAXDIM+2].str==1 + && dstdetail[n*SLAB_MAXDIM ].str==1 + && dstdetail[n*SLAB_MAXDIM+1].str==1 + && dstdetail[n*SLAB_MAXDIM+2].str==1 && dsttype == CCTK_VARIABLE_REAL) { /* Optimised version for a special case: no flipping */ @@ -1417,20 +1442,23 @@ int Slab_MultiTransfer (cGH const * const cctkGH, int const dstindi = dstdetailoffi + i - dstoffi; int const dstindj = dstdetailoffj + j - dstoffj; int const dstindk = dstdetailoffk + k - dstoffk; - size_t const dstind = dstindi + dstleni * (dstindj + dstlenj * dstindk); + size_t const dstind + = dstindi + dstleni * (dstindj + dstlenj * dstindk); ifcheck assert (dstindi>=0 && dstindi<dstleni); ifcheck assert (dstindj>=0 && dstindj<dstlenj); ifcheck assert (dstindk>=0 && dstindk<dstlenk); for (var=0; var<nvars; ++var) { - ((CCTK_REAL*)dstptrs[var])[dstind] - = ((const CCTK_REAL*)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; + ((CCTK_REAL*restrict)dstptrs[var])[dstind] + = ((const CCTK_REAL*restrict)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; } } } } } else if (info[0].flip==1 && info[1].flip==0 && info[2].flip==0 - && dstdetail[n*SLAB_MAXDIM ].str==1 && dstdetail[n*SLAB_MAXDIM+1].str==1 && dstdetail[n*SLAB_MAXDIM+2].str==1 + && dstdetail[n*SLAB_MAXDIM ].str==1 + && dstdetail[n*SLAB_MAXDIM+1].str==1 + && dstdetail[n*SLAB_MAXDIM+2].str==1 && dsttype == CCTK_VARIABLE_REAL) { /* Optimised version for a special case: flip in x direction */ @@ -1453,24 +1481,28 @@ int Slab_MultiTransfer (cGH const * const cctkGH, for (k = 0; k < dstdetaillenk; ++k) { for (j = 0; j < dstdetaillenj; ++j) { for (i = 0; i < dstdetailleni; ++i) { - size_t const bufind = (dstdetailleni - 1 - i) + dstdetailleni * (j + dstdetaillenj * k); + size_t const bufind + = (dstdetailleni - 1 - i) + dstdetailleni * (j + dstdetaillenj * k); int const dstindi = dstdetailoffi + i - dstoffi; int const dstindj = dstdetailoffj + j - dstoffj; int const dstindk = dstdetailoffk + k - dstoffk; - size_t const dstind = dstindi + dstleni * (dstindj + dstlenj * dstindk); + size_t const dstind + = dstindi + dstleni * (dstindj + dstlenj * dstindk); ifcheck assert (dstindi>=0 && dstindi<dstleni); ifcheck assert (dstindj>=0 && dstindj<dstlenj); ifcheck assert (dstindk>=0 && dstindk<dstlenk); for (var=0; var<nvars; ++var) { - ((CCTK_REAL*)dstptrs[var])[dstind] - = ((const CCTK_REAL*)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; + ((CCTK_REAL*restrict)dstptrs[var])[dstind] + = ((const CCTK_REAL*restrict)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; } } } } } else if (info[0].flip==0 && info[1].flip==1 && info[2].flip==0 - && dstdetail[n*SLAB_MAXDIM ].str==1 && dstdetail[n*SLAB_MAXDIM+1].str==1 && dstdetail[n*SLAB_MAXDIM+2].str==1 + && dstdetail[n*SLAB_MAXDIM ].str==1 + && dstdetail[n*SLAB_MAXDIM+1].str==1 + && dstdetail[n*SLAB_MAXDIM+2].str==1 && dsttype == CCTK_VARIABLE_REAL) { /* Optimised version for a special case: flip in y direction */ @@ -1493,24 +1525,28 @@ int Slab_MultiTransfer (cGH const * const cctkGH, for (k = 0; k < dstdetaillenk; ++k) { for (j = 0; j < dstdetaillenj; ++j) { for (i = 0; i < dstdetailleni; ++i) { - size_t const bufind = i + dstdetailleni * ((dstdetaillenj - 1 - j) + dstdetaillenj * k); + size_t const bufind + = i + dstdetailleni * ((dstdetaillenj - 1 - j) + dstdetaillenj * k); int const dstindi = dstdetailoffi + i - dstoffi; int const dstindj = dstdetailoffj + j - dstoffj; int const dstindk = dstdetailoffk + k - dstoffk; - size_t const dstind = dstindi + dstleni * (dstindj + dstlenj * dstindk); + size_t const dstind + = dstindi + dstleni * (dstindj + dstlenj * dstindk); ifcheck assert (dstindi>=0 && dstindi<dstleni); ifcheck assert (dstindj>=0 && dstindj<dstlenj); ifcheck assert (dstindk>=0 && dstindk<dstlenk); for (var=0; var<nvars; ++var) { - ((CCTK_REAL*)dstptrs[var])[dstind] - = ((const CCTK_REAL*)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; + ((CCTK_REAL*restrict)dstptrs[var])[dstind] + = ((const CCTK_REAL*restrict)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; } } } } } else if (info[0].flip==1 && info[1].flip==1 && info[2].flip==0 - && dstdetail[n*SLAB_MAXDIM ].str==1 && dstdetail[n*SLAB_MAXDIM+1].str==1 && dstdetail[n*SLAB_MAXDIM+2].str==1 + && dstdetail[n*SLAB_MAXDIM ].str==1 + && dstdetail[n*SLAB_MAXDIM+1].str==1 + && dstdetail[n*SLAB_MAXDIM+2].str==1 && dsttype == CCTK_VARIABLE_REAL) { /* Optimised version for a special case: flip in y direction */ @@ -1533,23 +1569,27 @@ int Slab_MultiTransfer (cGH const * const cctkGH, for (k = 0; k < dstdetaillenk; ++k) { for (j = 0; j < dstdetaillenj; ++j) { for (i = 0; i < dstdetailleni; ++i) { - size_t const bufind = (dstdetailleni - 1 - i) + dstdetailleni * ((dstdetaillenj - 1 - j) + dstdetaillenj * k); + size_t const bufind + = (dstdetailleni - 1 - i) + dstdetailleni * ((dstdetaillenj - 1 - j) + dstdetaillenj * k); int const dstindi = dstdetailoffi + i - dstoffi; int const dstindj = dstdetailoffj + j - dstoffj; int const dstindk = dstdetailoffk + k - dstoffk; - size_t const dstind = dstindi + dstleni * (dstindj + dstlenj * dstindk); + size_t const dstind + = dstindi + dstleni * (dstindj + dstlenj * dstindk); ifcheck assert (dstindi>=0 && dstindi<dstleni); ifcheck assert (dstindj>=0 && dstindj<dstlenj); ifcheck assert (dstindk>=0 && dstindk<dstlenk); for (var=0; var<nvars; ++var) { - ((CCTK_REAL*)dstptrs[var])[dstind] - = ((const CCTK_REAL*)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; + ((CCTK_REAL*restrict)dstptrs[var])[dstind] + = ((const CCTK_REAL*restrict)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; } } } } - } else if (dstdetail[n*SLAB_MAXDIM ].str==1 && dstdetail[n*SLAB_MAXDIM+1].str==1 && dstdetail[n*SLAB_MAXDIM+2].str==1 + } else if (dstdetail[n*SLAB_MAXDIM ].str==1 + && dstdetail[n*SLAB_MAXDIM+1].str==1 + && dstdetail[n*SLAB_MAXDIM+2].str==1 && dsttype == CCTK_VARIABLE_REAL) { /* Optimised version for CCTK_REAL and stride 1 */ @@ -1586,8 +1626,8 @@ int Slab_MultiTransfer (cGH const * const cctkGH, ifcheck assert (bufind < (size_t)dstcount[n]); ifcheck assert (dstind < dstlentot); for (var=0; var<nvars; ++var) { - ((CCTK_REAL*)dstptrs[var])[dstind] - = ((const CCTK_REAL*)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; + ((CCTK_REAL*restrict)dstptrs[var])[dstind] + = ((const CCTK_REAL*restrict)dstdata)[dstoffset[n] + var * dstelems[n] + bufind]; } } } @@ -1629,8 +1669,6 @@ int Slab_MultiTransfer (cGH const * const cctkGH, } ifcheck assert (bufind < (size_t)dstcount[n]); ifcheck assert (dstind < dstlentot); -/* ((CCTK_REAL*)dstptr)[dstind] */ -/* = ((const CCTK_REAL*)dstdata)[dstoffset[n] + bufind]; */ for (var=0; var<nvars; ++var) { memcpy ((char *) dstptrs[var] + dsttypesize * dstind, (const char *) dstdata + dsttypesize * (dstoffset[n] + var * dstelems[n] + bufind), @@ -1675,36 +1713,36 @@ int Slab_MultiTransfer (cGH const * const cctkGH, void CCTK_FCALL -CCTK_FNAME(Slab_Transfer) (int * restrict const ierr, +CCTK_FNAME(Slab_Transfer) (int * restrict const ierr, cGH const * const * restrict const cctkGH, - int const * restrict const dim, - int const * restrict const src_gsh, - int const * restrict const src_lbnd, - int const * restrict const src_lsh, - int const * restrict const src_lbbox, - int const * restrict const src_ubbox, - int const * restrict const src_nghostzones, - int const * restrict const src_off, - int const * restrict const src_str, - int const * restrict const src_len, - int const * restrict const dst_gsh, - int const * restrict const dst_lbnd, - int const * restrict const dst_lsh, - int const * restrict const dst_lbbox, - int const * restrict const dst_ubbox, - int const * restrict const dst_nghostzones, - int const * restrict const dst_off, - int const * restrict const dst_str, - int const * restrict const dst_len, - int const * restrict const xpose, - int const * restrict const flip, - int const * restrict const options, - int const * restrict const srctype, - void const * const srcptr, - int const * restrict const dsttype, - void * const dstptr) + int const * restrict const dim, + int const * restrict const src_gsh, + int const * restrict const src_lbnd, + int const * restrict const src_lsh, + int const * restrict const src_lbbox, + int const * restrict const src_ubbox, + int const * restrict const src_nghostzones, + int const * restrict const src_off, + int const * restrict const src_str, + int const * restrict const src_len, + int const * restrict const dst_gsh, + int const * restrict const dst_lbnd, + int const * restrict const dst_lsh, + int const * restrict const dst_lbbox, + int const * restrict const dst_ubbox, + int const * restrict const dst_nghostzones, + int const * restrict const dst_off, + int const * restrict const dst_str, + int const * restrict const dst_len, + int const * restrict const xpose, + int const * restrict const flip, + int const * restrict const options, + int const * restrict const srctype, + void const * restrict const srcptr, + int const * restrict const dsttype, + void * restrict const dstptr) { - struct xferinfo * xferinfo; + struct xferinfo * restrict xferinfo; int d; xferinfo = malloc (*dim * sizeof *xferinfo); @@ -1743,20 +1781,21 @@ CCTK_FNAME(Slab_Transfer) (int * restrict const ierr, -int Slab_Transfer (cGH const * restrict const cctkGH, - int const dim, - struct xferinfo const * restrict const xferinfo, - int const options, - int const srctype, - void const * const srcptr, - int const dsttype, - void * const dstptr) +int +Slab_Transfer (cGH const * restrict const cctkGH, + int const dim, + struct xferinfo const * restrict const xferinfo, + int const options, + int const srctype, + void const * restrict const srcptr, + int const dsttype, + void * restrict const dstptr) { int const nvars = 1; int const srctypes[] = { srctype }; - void const * const srcptrs[] = { srcptr }; + void const * restrict const srcptrs[] = { srcptr }; int const dsttypes[] = { dsttype }; - void * const dstptrs[] = { dstptr }; + void * restrict const dstptrs[] = { dstptr }; return Slab_MultiTransfer (cctkGH, dim, xferinfo, options, nvars, srctypes, srcptrs, dsttypes, dstptrs); } @@ -93,31 +93,33 @@ struct xferinfo { }; void -print_slabinfo (FILE * const out, - struct slabinfo const * const slabinfo); +print_slabinfo (FILE * const out, + struct slabinfo const * CCTK_RESTRICT const slabinfo); void -print_xferinfo (FILE * const out, - struct xferinfo const * const xferinfo); +print_xferinfo (FILE * const out, + struct xferinfo const * CCTK_RESTRICT const xferinfo); -int Slab_Transfer (cGH const * const cctkGH, - int const dim, - struct xferinfo const * const xferinfo, - int const options, - int const srctype, - void const * const srcptr, - int const dsttype, - void * const dstptr); +int +Slab_Transfer (cGH const * CCTK_RESTRICT const cctkGH, + int const dim, + struct xferinfo const * CCTK_RESTRICT const xferinfo, + int const options, + int const srctype, + void const * CCTK_RESTRICT const srcptr, + int const dsttype, + void * CCTK_RESTRICT const dstptr); -int Slab_MultiTransfer (cGH const * const cctkGH, - int const dim, - struct xferinfo const * const xferinfo, - int const options, - int const nvars, - int const * const srctypes, - void const * const * const srcptrs, - int const * const dsttypes, - void * const * const dstptrs); +int +Slab_MultiTransfer (cGH const * CCTK_RESTRICT const cctkGH, + int const dim, + struct xferinfo const * CCTK_RESTRICT const xferinfo, + int const options, + int const nvars, + int const * CCTK_RESTRICT const srctypes, + void const * CCTK_RESTRICT const * CCTK_RESTRICT const srcptrs, + int const * CCTK_RESTRICT const dsttypes, + void * CCTK_RESTRICT const * CCTK_RESTRICT const dstptrs); #ifdef __cplusplus } |