/* adder.c */ /* © Copyright 2003 Dauger Research, Inc. Our lawyers made us say this: DISCLAIMER: We provide the following on an "AS IS" basis. Use it at your own risk. */ #include /* standard I/O routines */ #include /* standard library routines, such as memory */ #include /* math libraries */ /* A routine performing elemental work. This can be replaced with a much larger routine. */ double kernelroutine(double input); double kernelroutine(double input) { return (input+1)*(input+1); } /* HighestIndex specifies how highest index to sample */ #define HighestIndex 10000L void computeloop(double *theSum, double **theArray); void computeloop(double *theSum, double **theArray) { /* local copies of the data to be output */ double *myArray, mySum=0; /* limit of the loop */ long loopEnd=HighestIndex; /* allocate an array to hold all the results */ myArray=malloc(sizeof(double)*loopEnd); if (myArray) { long index; /* loop over indicies */ for(index=0; index