Actual source code: setval.h

      2: /* This file contains definitions for INLINING some popular operations
      3:    All arguments should be simple and in register if possible.
      4:  */

      6: #ifndef SET

      8: #ifdef PETSC_USE_UNROLL_KERNELS
      9: #define SET(v,n,val) \
     10: switch (n&0x3) { \
     11: case 3: *v++ = val;\
     12: case 2: *v++ = val;\
     13: case 1: *v++ = val;n-=4;\
     14: case 0: while (n>0) {v[0]=val;v[1]=val;v[2]=val;v[3]=val;v+=4;n-=4;}}

     16: #elif defined(PETSC_USE_WHILE_KERNELS)
     17: #define SET(v,n,val) while (n--) *v++ = val;

     19: #else
     20: #define SET(v,n,val) {PetscInt __i;for(__i=0;__i<n;__i++)v[__i] = val;}
     21: #endif

     23: #endif