#include "bench7.h" /* ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c s7 generates a buffer of the pseudo-random A stream for Benchmark #7 c c Parameters: c Provided by calling routine: c BUFNUM = Number of this buffer of A in the full stream c ISEED = Seed for randon number generator c c Returned by this routine: c A = Array holding the data - BUFSIZE words c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc */ s7 ( uint64 * A, int bufnum, int seed ) { uint64 PAT1010 = 0XAAAAAAAAAAAAAAAA, PAT0101 = 0X5555555555555555; int64 nwds = BUFSIZE; int64 negseed = -(long)seed; int64 myf=0, myl=0; /* dummy */ int i, i1, i2; // bufnum+1 to get same data as Fortran get_my_bdata64( bufnum+1, 1, 1, nwds, 1, negseed, A, &myf, &myl ); // Artificially insert several regions that produce // 600-long patterns in the B and C streams and thence // 500-long runs of zeros in E-stream for ( i = -1; i <= 19; i++ ) { A[ i + 68750 ] = PAT1010; A[ i + 78776 ] = PAT0101; A[ i + 137500 ] = 0; A[ i + 157552 ] = -1; } // Create a zero region overlapping end of buff i and start of buff i+1, i>=0 // Region at end of buff is not long enough w/o beginning of next buff // So no trouble checking results: we get 5 regions in each buffer // except the last one, which has 4 regions i1 = 4; i2 = 6; for (i=1; i<=i1; i++) A[nwds-i] = 0; if (bufnum > 0) for (i=0; i