loop25.cpp   loop25.cpp 
skipping to change at line 13 skipping to change at line 13
// In KAI C++ 3.2, restrict causes problems for copy propagation. // In KAI C++ 3.2, restrict causes problems for copy propagation.
// Temporary fix: disable restrict // Temporary fix: disable restrict
#define BZ_DISABLE_RESTRICT #define BZ_DISABLE_RESTRICT
#include <blitz/vector.h> #include <blitz/vector.h>
#include <blitz/array.h> #include <blitz/array.h>
#include <blitz/rand-uniform.h> #include <blitz/rand-uniform.h>
#include <blitz/benchext.h> #include <blitz/benchext.h>
// Generated: makeloops.cpp Jul 30 1998 // Generated: makeloops.cpp Dec 11 2002
#ifdef BZ_HAVE_VALARRAY
#define BENCHMARK_VALARRAY
#endif
#ifdef BENCHMARK_VALARRAY #ifdef BENCHMARK_VALARRAY
#include <valarray> #include <valarray>
#endif #endif
BZ_USING_NAMESPACE(blitz) BZ_USING_NAMESPACE(blitz)
#ifdef BZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES #if defined(BZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES)
#define loop25_f77 loop25_f77_ #define loop25_f77 loop25_f77_
#define loop25_f77overhead loop25_f77overhead_ #define loop25_f77overhead loop25_f77overhead_
#define loop25_f90 loop25_f90_ #define loop25_f90 loop25_f90_
#define loop25_f90overhead loop25_f90overhead_ #define loop25_f90overhead loop25_f90overhead_
#endif #elif defined(BZ_FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES)
#ifdef BZ_FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES
#define loop25_f77 loop25_f77__ #define loop25_f77 loop25_f77__
#define loop25_f77overhead loop25_f77overhead__ #define loop25_f77overhead loop25_f77overhead__
#define loop25_f90 loop25_f90__ #define loop25_f90 loop25_f90__
#define loop25_f90overhead loop25_f90overhead__ #define loop25_f90overhead loop25_f90overhead__
#endif #elif defined(BZ_FORTRAN_SYMBOLS_CAPS)
#ifdef BZ_FORTRAN_SYMBOLS_CAPS
#define loop25_f77 LOOP25_F77 #define loop25_f77 LOOP25_F77
#define loop25_f77overhead LOOP25_F77OVERHEAD #define loop25_f77overhead LOOP25_F77OVERHEAD
#define loop25_f90 LOOP25_F90 #define loop25_f90 LOOP25_F90
#define loop25_f90overhead LOOP25_F90OVERHEAD #define loop25_f90overhead LOOP25_F90OVERHEAD
#endif #endif
extern "C" { extern "C" {
void loop25_f77(const int& N, double* x, double* a, double* b, double* c, double* y, const double& u, const double& v, const double& w); void loop25_f77(const int& N, double* x, double* a, double* b, double* c, double* y, const double& u, const double& v, const double& w);
void loop25_f77overhead(const int& N, double* x, double* a, double* b, do uble* c, double* y, const double& u, const double& v, const double& w); void loop25_f77overhead(const int& N, double* x, double* a, double* b, do uble* c, double* y, const double& u, const double& v, const double& w);
void loop25_f90(const int& N, double* x, double* a, double* b, double* c, double* y, const double& u, const double& v, const double& w); void loop25_f90(const int& N, double* x, double* a, double* b, double* c, double* y, const double& u, const double& v, const double& w);
void loop25_f90overhead(const int& N, double* x, double* a, double* b, do uble* c, double* y, const double& u, const double& v, const double& w); void loop25_f90overhead(const int& N, double* x, double* a, double* b, do uble* c, double* y, const double& u, const double& v, const double& w);
} }
void VectorVersion(BenchmarkExt<int>& bench, double u, double v, double w); void VectorVersion(BenchmarkExt<int>& bench, double u, double v, double w);
void ArrayVersion(BenchmarkExt<int>& bench, double u, double v, double w); void ArrayVersion(BenchmarkExt<int>& bench, double u, double v, double w);
void F77Version(BenchmarkExt<int>& bench, double u, double v, double w); void F77Version(BenchmarkExt<int>& bench, double u, double v, double w);
#ifdef FORTRAN_90
void F90Version(BenchmarkExt<int>& bench, double u, double v, double w); void F90Version(BenchmarkExt<int>& bench, double u, double v, double w);
#endif
#ifdef BENCHMARK_VALARRAY #ifdef BENCHMARK_VALARRAY
void ValarrayVersion(BenchmarkExt<int>& bench, double u, double v, double w ); void ValarrayVersion(BenchmarkExt<int>& bench, double u, double v, double w );
#endif #endif
void sink() {} void sink() {}
int main() int main()
{ {
#ifdef BENCHMARK_VALARRAY
int numBenchmarks = 5; int numBenchmarks = 5;
#else #ifndef BENCHMARK_VALARRAY
int numBenchmarks = 4; numBenchmarks--; // No valarray
#endif
#ifndef FORTRAN_90
numBenchmarks--; // No fortran 90
#endif #endif
BenchmarkExt<int> bench("loop25: $x=u*$b;$y=v*$b+w*$a+u*$c", numBenchma rks); BenchmarkExt<int> bench("loop25: $x=u*$b;$y=v*$b+w*$a+u*$c", numBenchma rks);
const int numSizes = 23; const int numSizes = 23;
bench.setNumParameters(numSizes); bench.setNumParameters(numSizes);
bench.setRateDescription("Mflops/s"); bench.setRateDescription("Mflops/s");
Vector<int> parameters(numSizes); Vector<int> parameters(numSizes);
Vector<long> iters(numSizes); Vector<long> iters(numSizes);
Vector<double> flops(numSizes); Vector<double> flops(numSizes);
for (int i=0; i < numSizes; ++i) for (int i=0; i < numSizes; ++i)
{ {
parameters[i] = (int)pow(10.0, (i+1)/4.0); parameters[i] = (int)pow(10.0, (i+1)/4.0);
iters[i] = 10000000L / parameters[i]; iters[i] = 10000000L / parameters[i];
if (iters[i] < 2) if (iters[i] < 2)
iters[i] = 2; iters[i] = 2;
flops[i] = 0 * parameters[i]; flops[i] = 6 * parameters[i];
} }
bench.setParameterVector(parameters); bench.setParameterVector(parameters);
bench.setIterations(iters); bench.setIterations(iters);
bench.setFlopsPerIteration(flops); bench.setFlopsPerIteration(flops);
bench.beginBenchmarking(); bench.beginBenchmarking();
double u = 0.39123982498157938742; double u = 0.39123982498157938742;
double v = 0.39123982498157938742; double v = 0.39123982498157938742;
double w = 0.39123982498157938742; double w = 0.39123982498157938742;
VectorVersion(bench, u, v, w); VectorVersion(bench, u, v, w);
ArrayVersion(bench, u, v, w); ArrayVersion(bench, u, v, w);
F77Version(bench, u, v, w); F77Version(bench, u, v, w);
#ifdef FORTRAN_90
F90Version(bench, u, v, w); F90Version(bench, u, v, w);
#endif
#ifdef BENCHMARK_VALARRAY #ifdef BENCHMARK_VALARRAY
ValarrayVersion(bench, u, v, w); ValarrayVersion(bench, u, v, w);
#endif #endif
bench.endBenchmarking(); bench.endBenchmarking();
bench.saveMatlabGraph("loop25.m"); bench.saveMatlabGraph("loop25.m");
return 0; return 0;
} }
skipping to change at line 300 skipping to change at line 305
delete [] x; delete [] x;
delete [] a; delete [] a;
delete [] b; delete [] b;
delete [] c; delete [] c;
delete [] y; delete [] y;
} }
bench.endImplementation(); bench.endImplementation();
} }
#ifdef FORTRAN_90
void F90Version(BenchmarkExt<int>& bench, double u, double v, double w) void F90Version(BenchmarkExt<int>& bench, double u, double v, double w)
{ {
bench.beginImplementation("Fortran 90"); bench.beginImplementation("Fortran 90");
while (!bench.doneImplementationBenchmark()) while (!bench.doneImplementationBenchmark())
{ {
int N = bench.getParameter(); int N = bench.getParameter();
cout << "Fortran 90: N = " << N << endl; cout << "Fortran 90: N = " << N << endl;
cout.flush(); cout.flush();
skipping to change at line 343 skipping to change at line 349
bench.stopOverhead(); bench.stopOverhead();
delete [] x; delete [] x;
delete [] a; delete [] a;
delete [] b; delete [] b;
delete [] c; delete [] c;
delete [] y; delete [] y;
} }
bench.endImplementation(); bench.endImplementation();
} }
#endif
 End of changes. 13 change blocks. 
13 lines changed or deleted 19 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/