~ubuntu-branches/ubuntu/raring/blitz++/raring

« back to all changes in this revision

Viewing changes to benchmarks/loop6.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Konstantinos Margaritis
  • Date: 2005-02-28 20:25:01 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050228202501-3i4f2sknnprsqfhz
Tags: 1:0.8-4
Added missing build-depends (Closes: #297323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#include <blitz/rand-uniform.h>
11
11
#include <blitz/benchext.h>
12
12
 
13
 
// Generated: makeloops.cpp Jul 30 1998
 
13
// Generated: makeloops.cpp Dec 11 2002
 
14
 
 
15
#ifdef BZ_HAVE_VALARRAY
 
16
 #define BENCHMARK_VALARRAY
 
17
#endif
14
18
 
15
19
#ifdef BENCHMARK_VALARRAY
16
20
#include <valarray>
18
22
 
19
23
BZ_USING_NAMESPACE(blitz)
20
24
 
21
 
#ifdef BZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES
 
25
#if defined(BZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES)
22
26
 #define loop6_f77 loop6_f77_
23
27
 #define loop6_f77overhead loop6_f77overhead_
24
28
 #define loop6_f90 loop6_f90_
25
29
 #define loop6_f90overhead loop6_f90overhead_
26
 
#endif
27
 
 
28
 
#ifdef BZ_FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES
 
30
#elif defined(BZ_FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES)
29
31
 #define loop6_f77 loop6_f77__
30
32
 #define loop6_f77overhead loop6_f77overhead__
31
33
 #define loop6_f90 loop6_f90__
32
34
 #define loop6_f90overhead loop6_f90overhead__
33
 
#endif
34
 
 
35
 
#ifdef BZ_FORTRAN_SYMBOLS_CAPS
 
35
#elif defined(BZ_FORTRAN_SYMBOLS_CAPS)
36
36
 #define loop6_f77 LOOP6_F77
37
37
 #define loop6_f77overhead LOOP6_F77OVERHEAD
38
38
 #define loop6_f90 LOOP6_F90
53
53
void VectorVersion(BenchmarkExt<int>& bench);
54
54
void ArrayVersion(BenchmarkExt<int>& bench);
55
55
void F77Version(BenchmarkExt<int>& bench);
 
56
#ifdef FORTRAN_90
56
57
void F90Version(BenchmarkExt<int>& bench);
57
 
 
 
58
#endif
58
59
#ifdef BENCHMARK_VALARRAY
59
60
void ValarrayVersion(BenchmarkExt<int>& bench);
60
61
#endif
63
64
 
64
65
int main()
65
66
{
66
 
#ifdef BENCHMARK_VALARRAY
67
67
    int numBenchmarks = 5;
68
 
#else
69
 
    int numBenchmarks = 4;
 
68
#ifndef BENCHMARK_VALARRAY
 
69
    numBenchmarks--;   // No  valarray
 
70
#endif
 
71
#ifndef FORTRAN_90
 
72
    numBenchmarks--;   // No fortran 90
70
73
#endif
71
74
 
72
75
    BenchmarkExt<int> bench("loop6: $x=$a*$b", numBenchmarks);
98
101
    VectorVersion(bench);
99
102
    ArrayVersion(bench);
100
103
    F77Version(bench);
 
104
#ifdef FORTRAN_90
101
105
    F90Version(bench);
 
106
#endif
102
107
#ifdef BENCHMARK_VALARRAY
103
108
    ValarrayVersion(bench);
104
109
#endif
276
281
    bench.endImplementation();
277
282
}
278
283
 
 
284
#ifdef FORTRAN_90
279
285
void F90Version(BenchmarkExt<int>& bench)
280
286
{
281
287
    bench.beginImplementation("Fortran 90");
313
319
 
314
320
    bench.endImplementation();
315
321
}
 
322
#endif
316
323