[llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp ary.cpp ary2.cpp ary3.cpp except.cpp fibo.cpp hash.cpp hash2.cpp heapsort.cpp lists.cpp lists1.cpp matrix.cpp methcall.cpp moments.cpp nestedloop.cpp objinst.cpp random.cpp sieve.cpp
Lauro Ramos Venancio
lauro.venancio at gmail.com
Thu May 3 09:56:37 PDT 2007
Changes in directory llvm-test/SingleSource/Benchmarks/Shootout-C++:
ackermann.cpp updated: 1.2 -> 1.3
ary.cpp updated: 1.4 -> 1.5
ary2.cpp updated: 1.5 -> 1.6
ary3.cpp updated: 1.2 -> 1.3
except.cpp updated: 1.2 -> 1.3
fibo.cpp updated: 1.2 -> 1.3
hash.cpp updated: 1.3 -> 1.4
hash2.cpp updated: 1.2 -> 1.3
heapsort.cpp updated: 1.3 -> 1.4
lists.cpp updated: 1.3 -> 1.4
lists1.cpp updated: 1.5 -> 1.6
matrix.cpp updated: 1.2 -> 1.3
methcall.cpp updated: 1.2 -> 1.3
moments.cpp updated: 1.4 -> 1.5
nestedloop.cpp updated: 1.2 -> 1.3
objinst.cpp updated: 1.2 -> 1.3
random.cpp updated: 1.2 -> 1.3
sieve.cpp updated: 1.3 -> 1.4
---
Log message:
Implement SMALL_PROBLEM_SIZE.
---
Diffs of the changes: (+124 -34)
ackermann.cpp | 9 +++++++--
ary.cpp | 9 +++++++--
ary2.cpp | 9 +++++++--
ary3.cpp | 9 +++++++--
except.cpp | 9 +++++++--
fibo.cpp | 9 +++++++--
hash.cpp | 9 +++++++--
hash2.cpp | 9 +++++++--
heapsort.cpp | 9 +++++++--
lists.cpp | 9 +++++++--
lists1.cpp | 9 +++++++--
matrix.cpp | 9 +++++++--
methcall.cpp | 9 +++++++--
moments.cpp | 7 ++++++-
nestedloop.cpp | 9 +++++++--
objinst.cpp | 9 +++++++--
random.cpp | 9 +++++++--
sieve.cpp | 7 ++++++-
18 files changed, 124 insertions(+), 34 deletions(-)
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: ackermann.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: ackermann.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -10,7 +10,12 @@
int Ack(int M, int N) { return(M ? (Ack(M-1,N ? Ack(M,(N-1)) : 1)) : N+1); }
int main(int argc, char *argv[]) {
- int n = ((argc == 2) ? atoi(argv[1]) : 12);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 11
+#else
+#define LENGTH 12
+#endif
+ int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
cout << "Ack(3," << n << "): " << Ack(3, n) << endl;
return(0);
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.4 llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.5
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.4 Sat Jul 24 05:44:11 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: ary.cpp,v 1.4 2004/07/24 10:44:11 alkis Exp $
+// $Id: ary.cpp,v 1.5 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -7,7 +7,12 @@
int
main(int argc, char *argv[]) {
- int i, n = ((argc == 2) ? atoi(argv[1]) : 9000000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 900000
+#else
+#define LENGTH 9000000
+#endif
+ int i, n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
typedef std::vector<int> ARY;
ARY x(n);
ARY y(n);
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.5 llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.6
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.5 Sat Jul 24 05:44:11 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: ary2.cpp,v 1.5 2004/07/24 10:44:11 alkis Exp $
+// $Id: ary2.cpp,v 1.6 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -7,7 +7,12 @@
int
main(int argc, char *argv[]) {
- int i, n = 10*((argc == 2) ? atoi(argv[1]) : 900000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 90000
+#else
+#define LENGTH 900000
+#endif
+ int i, n = 10*((argc == 2) ? atoi(argv[1]) : LENGTH);
typedef std::vector<int> ARY;
ARY x(n);
ARY y(n);
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: ary3.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: ary3.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -8,7 +8,12 @@
using namespace std;
int main(int argc, char *argv[]) {
- int i, k, n = ((argc == 2) ? atoi(argv[1]) : 1500000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 150000
+#else
+#define LENGTH 1500000
+#endif
+ int i, k, n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
typedef vector<int> ARY;
ARY x(n);
ARY y(n);
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: except.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: except.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
// from Bill Lear
@@ -61,7 +61,12 @@
int
main(int argc, char* argv[]) {
- size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 100000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 10000
+#else
+#define LENGTH 100000
+#endif
+ size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): LENGTH);
while (NUM--) {
some_function(NUM);
}
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: fibo.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: fibo.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -15,7 +15,12 @@
}
int main(int argc, char *argv[]) {
- int n = ((argc == 2) ? atoi(argv[1]) : 43);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 40
+#else
+#define LENGTH 43
+#endif
+ int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
cout << fib(n) << endl;
return(0);
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.3 llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.4
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.3 Sat Jul 24 05:44:11 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: hash.cpp,v 1.3 2004/07/24 10:44:11 alkis Exp $
+// $Id: hash.cpp,v 1.4 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <stdio.h>
@@ -16,7 +16,12 @@
int
main(int argc, char *argv[]) {
- int n = ((argc == 2) ? atoi(argv[1]) : 500000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 50000
+#else
+#define LENGTH 500000
+#endif
+ int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
char buf[16];
typedef hash_map<const char*, int, hash<const char*>, eqstr> HM;
HM X;
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: hash2.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: hash2.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <stdio.h>
@@ -16,7 +16,12 @@
int
main(int argc, char *argv[]) {
- int n = ((argc == 2) ? atoi(argv[1]) : 2000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 200
+#else
+#define LENGTH 2000
+#endif
+ int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
char buf[16];
typedef hash_map<const char*, int, hash<const char*>, eqstr> HM;
HM hash1, hash2;
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.3 llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.4
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.3 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: heapsort.cpp,v 1.3 2004/06/15 20:48:16 lattner Exp $
+// $Id: heapsort.cpp,v 1.4 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -53,7 +53,12 @@
int
main(int argc, char *argv[]) {
- int N = ((argc == 2) ? atoi(argv[1]) : 8000000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 800000
+#else
+#define LENGTH 8000000
+#endif
+ int N = ((argc == 2) ? atoi(argv[1]) : LENGTH);
double *ary;
int i;
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.3 llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.4
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.3 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: lists.cpp,v 1.3 2004/06/15 20:48:16 lattner Exp $
+// $Id: lists.cpp,v 1.4 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
// from Bill Lear
@@ -46,7 +46,12 @@
}
int main(int argc, char* argv[]) {
- size_t ITER = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 3000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 300
+#else
+#define LENGTH 3000
+#endif
+ size_t ITER = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): LENGTH);
size_t result = 0;
while (ITER > 0) {
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.5 llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.6
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.5 Sat Jul 24 05:44:11 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: lists1.cpp,v 1.5 2004/07/24 10:44:11 alkis Exp $
+// $Id: lists1.cpp,v 1.6 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -27,7 +27,12 @@
}
int main(int argc, char* argv[]) {
- int N = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 1000000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 100000
+#else
+#define LENGTH 1000000
+#endif
+ int N = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): LENGTH);
list<int>::iterator i;
// create empty list B
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: matrix.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: matrix.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -48,7 +48,12 @@
}
int main(int argc, char *argv[]) {
- int i, n = ((argc == 2) ? atoi(argv[1]) : 100000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 10000
+#else
+#define LENGTH 100000
+#endif
+ int i, n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
int **m1 = mkmatrix(SIZE, SIZE);
int **m2 = mkmatrix(SIZE, SIZE);
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: methcall.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: methcall.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
// with some help from Bill Lear
@@ -43,7 +43,12 @@
int
main(int argc, char *argv[]) {
- int n = ((argc == 2) ? atoi(argv[1]) : 1000000000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 100000000
+#else
+#define LENGTH 1000000000
+#endif
+ int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
bool val = true;
Toggle *toggle = new Toggle(val);
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.4 llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.5
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.4 Sat Jul 24 05:44:11 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp Thu May 3 11:55:46 2007
@@ -66,7 +66,12 @@
};
int main(int argc, char**argv) {
- int n = ((argc == 2) ? atoi(argv[1]) : 5000000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 500000
+#else
+#define LENGTH 5000000
+#endif
+ int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
vector<double> v;
double d;
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: nestedloop.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: nestedloop.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -8,7 +8,12 @@
using namespace std;
int main(int argc, char *argv[]) {
- int n = ((argc == 2) ? atoi(argv[1]) : 46);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 30
+#else
+#define LENGTH 46
+#endif
+ int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
int a, b, c, d, e, f, x=0;
for (a=0; a<n; a++)
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/objinst.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/objinst.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/objinst.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/objinst.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/objinst.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: objinst.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: objinst.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <stdlib.h>
@@ -40,7 +40,12 @@
int
main(int argc, char *argv[]) {
- int n = ((argc == 2) ? atoi(argv[1]) : 70000000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 7000000
+#else
+#define LENGTH 70000000
+#endif
+ int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
Toggle *toggle1 = new Toggle(true);
for (int i=0; i<5; i++) {
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.3
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.2 Tue Jun 15 15:48:16 2004
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp Thu May 3 11:55:46 2007
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: random.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $
+// $Id: random.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
@@ -19,7 +19,12 @@
}
int main(int argc, char *argv[]) {
- int N = ((argc == 2) ? atoi(argv[1]) : 400000000);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 4000000
+#else
+#define LENGTH 400000000
+#endif
+ int N = ((argc == 2) ? atoi(argv[1]) : LENGTH);
double result = 0;
while (N--) {
Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp
diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.3 llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.4
--- llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.3 Fri Nov 17 15:22:26 2006
+++ llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp Thu May 3 11:55:46 2007
@@ -25,7 +25,12 @@
int main(int argc, char *argv[])
{
- size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 500);
+#ifdef SMALL_PROBLEM_SIZE
+#define LENGTH 50
+#else
+#define LENGTH 500
+#endif
+ size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): LENGTH);
vector<int> primes;
More information about the llvm-commits
mailing list