[pypy-commit] extradoc extradoc: C runner for LU

hakanardo noreply at buildbot.pypy.org
Mon Aug 13 10:36:25 CEST 2012


Author: Hakan Ardo <hakan at debian.org>
Branch: extradoc
Changeset: r4537:d333ee6ab823
Date: 2012-08-13 10:35 +0200
http://bitbucket.org/pypy/extradoc/changeset/d333ee6ab823/

Log:	C runner for LU

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
@@ -20,7 +20,9 @@
     ./runner.py -n 5 -c "$*" scimark/run_SOR.c 1000 256
     ./runner.py -n 5 -c "$*" scimark/run_SparseMatMult.c 1000 5000 262144
     ./runner.py -n 5 -c "$*" scimark/run_SparseMatMult.c 100000 1000000 1024
-    ./runner.py -n 5 -c "$*" scimark/run_MonteCarlo 268435456
+    ./runner.py -n 5 -c "$*" scimark/run_MonteCarlo.c 268435456
+    ./runner.py -n 5 -c "$*" scimark/run_LU.c 100 4096
+    ./runner.py -n 5 -c "$*" scimark/run_LU.c 1000 2
     rm a.out
 else
     if [ "$1" == "python2.7" ]; then
@@ -58,4 +60,5 @@
     $* ./runner.py $EXTRA_OPTS scimark.py SparseMatMult 100000 1000000 1024
     $* ./runner.py $EXTRA_OPTS scimark.py MonteCarlo 268435456
     $* ./runner.py $EXTRA_OPTS scimark.py LU 100 4096
+    $* ./runner.py $EXTRA_OPTS scimark.py LU 1000 2
 fi
diff --git a/talk/iwtc11/benchmarks/scimark/run_LU.c b/talk/iwtc11/benchmarks/scimark/run_LU.c
new file mode 100644
--- /dev/null
+++ b/talk/iwtc11/benchmarks/scimark/run_LU.c
@@ -0,0 +1,32 @@
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "Random.c"
+#include "LU.c"
+#include "array.c"
+
+int main(int ac, char **av) {
+    assert(ac==3);
+    int N = atoi(av[1]);
+    int cycles = atoi(av[2]);
+    double **A = NULL;
+    double **lu = NULL; 
+    int *pivot = NULL;
+    int i;
+
+    Random R = new_Random_seed(7);
+    if ((A = RandomMatrix(N, N,  R)) == NULL) exit(1);
+    if ((lu = new_Array2D_double(N, N)) == NULL) exit(1);
+    if ((pivot = (int *) malloc(N * sizeof(int))) == NULL) exit(1);
+
+    for (i=0; i<cycles; i++)
+    {
+        Array2D_double_copy(N, N, lu, A);
+        LU_factor(N, N, lu, pivot);
+    }
+
+    fprintf(stderr, "LU(%d, %d):    ", N, cycles);
+    return 0;
+}
+    


More information about the pypy-commit mailing list