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

« back to all changes in this revision

Viewing changes to benchmarks/loop19.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 loop19_f77 loop19_f77_
23
27
 #define loop19_f77overhead loop19_f77overhead_
24
28
 #define loop19_f90 loop19_f90_
25
29
 #define loop19_f90overhead loop19_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 loop19_f77 loop19_f77__
30
32
 #define loop19_f77overhead loop19_f77overhead__
31
33
 #define loop19_f90 loop19_f90__
32
34
 #define loop19_f90overhead loop19_f90overhead__
33
 
#endif
34
 
 
35
 
#ifdef BZ_FORTRAN_SYMBOLS_CAPS
 
35
#elif defined(BZ_FORTRAN_SYMBOLS_CAPS)
36
36
 #define loop19_f77 LOOP19_F77
37
37
 #define loop19_f77overhead LOOP19_F77OVERHEAD
38
38
 #define loop19_f90 LOOP19_F90
53
53
void VectorVersion(BenchmarkExt<int>& bench, double u, double v);
54
54
void ArrayVersion(BenchmarkExt<int>& bench, double u, double v);
55
55
void F77Version(BenchmarkExt<int>& bench, double u, double v);
 
56
#ifdef FORTRAN_90
56
57
void F90Version(BenchmarkExt<int>& bench, double u, double v);
57
 
 
 
58
#endif
58
59
#ifdef BENCHMARK_VALARRAY
59
60
void ValarrayVersion(BenchmarkExt<int>& bench, double u, double v);
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("loop19: $x=u*$a;$y=v*$b", numBenchmarks);
100
103
    VectorVersion(bench, u, v);
101
104
    ArrayVersion(bench, u, v);
102
105
    F77Version(bench, u, v);
 
106
#ifdef FORTRAN_90
103
107
    F90Version(bench, u, v);
 
108
#endif
104
109
#ifdef BENCHMARK_VALARRAY
105
110
    ValarrayVersion(bench, u, v);
106
111
#endif
287
292
    bench.endImplementation();
288
293
}
289
294
 
 
295
#ifdef FORTRAN_90
290
296
void F90Version(BenchmarkExt<int>& bench, double u, double v)
291
297
{
292
298
    bench.beginImplementation("Fortran 90");
327
333
 
328
334
    bench.endImplementation();
329
335
}
 
336
#endif
330
337