[pypy-commit] extradoc extradoc: convert benchmark to our format

hakanardo noreply at buildbot.pypy.org
Fri Aug 10 22:25:37 CEST 2012


Author: Hakan Ardo <hakan at debian.org>
Branch: extradoc
Changeset: r4512:4c2d7d48434b
Date: 2012-08-10 22:23 +0200
http://bitbucket.org/pypy/extradoc/changeset/4c2d7d48434b/

Log:	convert benchmark to our format

diff --git a/talk/iwtc11/benchmarks/benchmark.sh b/talk/iwtc11/benchmarks/benchmark.sh
--- a/talk/iwtc11/benchmarks/benchmark.sh
+++ b/talk/iwtc11/benchmarks/benchmark.sh
@@ -16,6 +16,8 @@
     ./runner.py -n 5 -c "$* -lstdc++" convolution/conv3x3.cc 1000 1000
     ./runner.py -n 5 -c "$* -lstdc++" convolution/dilate3x3.cc 1000 1000
     ./runner.py -n 5 -c "$* -lstdc++" image/sobel.cc 1000 1000
+    ./runner.py -n 5 -c "$*" scimark/run_SOR.c 100 32768
+    ./runner.py -n 5 -c "$*" scimark/run_SOR.c 1000 256
     rm a.out
 else
     if [ "$1" == "python2.7" ]; then
@@ -45,4 +47,6 @@
     #$* ./runner.py $EXTRA_OPTS image/noborder.py main NoBorderImage range
     #$* ./runner.py $EXTRA_OPTS image/sobel.py main NoBorderImagePadded
     #$* ./runner.py $EXTRA_OPTS image/sobel.py main NoBorderImagePadded uint8
+    $* ./runner.py $EXTRA_OPTS scimark.py SOR 100 32768
+    $* ./runner.py $EXTRA_OPTS scimark.py SOR 1000 256
 fi
diff --git a/talk/iwtc11/benchmarks/scimark.py b/talk/iwtc11/benchmarks/scimark.py
--- a/talk/iwtc11/benchmarks/scimark.py
+++ b/talk/iwtc11/benchmarks/scimark.py
@@ -10,12 +10,5 @@
     n, cycles = map(int, args)
     a = Array2D(n, n)
     SOR_execute(1.25, a, cycles)
+    return "SOR(%d, %d)" % (n, cycles)
 
-if __name__ == '__main__':
-    from time import time
-    for i in range(10):
-        t0 = time()
-        #SOR([100, 32768]) # gcc -O3: 2.51, pypy-1.8: 3.83
-        SOR([1000, 256]) # gcc -O3 2.07, pypy-1.8: 3.03
-        t1 = time()
-        print t1-t0
diff --git a/talk/iwtc11/benchmarks/scimark/run_SOR.c b/talk/iwtc11/benchmarks/scimark/run_SOR.c
new file mode 100644
--- /dev/null
+++ b/talk/iwtc11/benchmarks/scimark/run_SOR.c
@@ -0,0 +1,17 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+
+#include "SOR.c"
+
+int main(int ac, char **av) {
+    assert(ac==3);
+    int N = atoi(av[1]);
+    int cycles = atoi(av[2]);
+    double **G = malloc(sizeof(double*)*N);
+    int i;
+    for (i=0; i<N; i++) G[i] = malloc(sizeof(double)*N);
+    SOR_execute(N, N, 1.25, G, cycles);
+    fprintf(stderr, "SOR(%d, %d):  ", N, cycles);
+    return 0;
+}


More information about the pypy-commit mailing list