From 5ca4b192499ee4829aee1256a3bebf2318c68108 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 25 Sep 2019 14:37:23 +0200 Subject: Restored previous input sizes for other backends --- test/c/Makefile | 12 +----- test/c/Results/binarytrees | 11 ++++-- test/c/Results/binarytrees-mppa_k1c | 4 ++ test/c/Results/chomp | 6 +++ test/c/Results/chomp-mppa_k1c | 9 +++++ test/c/Results/fannkuch | 62 +++++++++++++++---------------- test/c/Results/fannkuch-mppa_k1c | 31 ++++++++++++++++ test/c/Results/fft | 2 +- test/c/Results/fft-mppa_k1c | 1 + test/c/Results/fftsp | 2 +- test/c/Results/fftsp-mppa_k1c | 1 + test/c/Results/fftw-mppa_k1c | 16 ++++++++ test/c/Results/fib | 2 +- test/c/Results/fib-mppa_k1c | 1 + test/c/Results/integr | 2 +- test/c/Results/integr-mppa_k1c | 1 + test/c/Results/knucleotide | 27 ++++++++++++++ test/c/Results/knucleotide-mppa_k1c | 0 test/c/Results/lists-mppa_k1c | 2 + test/c/Results/mandelbrot | Bin 709 -> 125013 bytes test/c/Results/mandelbrot-mppa_k1c | Bin 0 -> 709 bytes test/c/Results/nbody | 2 +- test/c/Results/nbody-mppa_k1c | 2 + test/c/Results/nsieve | 6 +-- test/c/Results/nsieve-mppa_k1c | 3 ++ test/c/Results/nsievebits | 6 +-- test/c/Results/nsievebits-mppa_k1c | 3 ++ test/c/Results/perlin | 2 +- test/c/Results/perlin-mppa_k1c | 1 + test/c/Results/qsort-mppa_k1c | 1 + test/c/Results/sha1-mppa_k1c | 2 + test/c/Results/spectral | 2 +- test/c/Results/spectral-mppa_k1c | 1 + test/c/Results/vmach | 4 +- test/c/Results/vmach-mppa_k1c | 2 + test/c/Runtest | 71 ++++++++++++++++++++++++++++++++++++ test/c/binarytrees.c | 4 ++ test/c/chomp.c | 5 +++ test/c/fannkuch.c | 4 ++ test/c/fft.c | 4 ++ test/c/fftsp.c | 4 ++ test/c/fftw.c | 4 ++ test/c/fib.c | 4 ++ test/c/integr.c | 4 ++ test/c/lists.c | 5 +++ test/c/mandelbrot.c | 8 ++++ test/c/nbody.c | 4 ++ test/c/nsieve.c | 8 ++++ test/c/nsievebits.c | 8 ++++ test/c/perlin.c | 6 +++ test/c/qsort.c | 4 ++ test/c/spectral.c | 4 ++ test/c/vmach.c | 10 +++++ 53 files changed, 330 insertions(+), 60 deletions(-) create mode 100644 test/c/Results/binarytrees-mppa_k1c create mode 100644 test/c/Results/chomp-mppa_k1c create mode 100644 test/c/Results/fannkuch-mppa_k1c create mode 100644 test/c/Results/fft-mppa_k1c create mode 100644 test/c/Results/fftsp-mppa_k1c create mode 100644 test/c/Results/fftw-mppa_k1c create mode 100644 test/c/Results/fib-mppa_k1c create mode 100644 test/c/Results/integr-mppa_k1c create mode 100644 test/c/Results/knucleotide-mppa_k1c create mode 100644 test/c/Results/lists-mppa_k1c create mode 100644 test/c/Results/mandelbrot-mppa_k1c create mode 100644 test/c/Results/nbody-mppa_k1c create mode 100644 test/c/Results/nsieve-mppa_k1c create mode 100644 test/c/Results/nsievebits-mppa_k1c create mode 100644 test/c/Results/perlin-mppa_k1c create mode 100644 test/c/Results/qsort-mppa_k1c create mode 100644 test/c/Results/sha1-mppa_k1c create mode 100644 test/c/Results/spectral-mppa_k1c create mode 100644 test/c/Results/vmach-mppa_k1c create mode 100755 test/c/Runtest (limited to 'test/c') diff --git a/test/c/Makefile b/test/c/Makefile index b7db48ed..6bd05718 100644 --- a/test/c/Makefile +++ b/test/c/Makefile @@ -46,20 +46,12 @@ all_gcc: $(PROGS:%=%.gcc) test: all @for i in $(PROGS); do \ - $(EXECUTE) ./$$i.compcert > $$i.compcert.out;\ - if cmp -s $$i.compcert.out Results/$$i; \ - then echo "$$i: passed"; \ - else echo "$$i: FAILED"; exit 2; \ - fi; \ + SIMU='$(EXECUTE)' ./Runtest $$i ./$$i.compcert;\ done test_gcc: all_gcc @for i in $(PROGS); do \ - $(EXECUTE) ./$$i.gcc > $$i.gcc.out;\ - if cmp -s $$i.gcc.out Results/$$i; \ - then echo "$$i: passed"; \ - else echo "$$i: FAILED"; exit 2;\ - fi; \ + SIMU='$(EXECUTE)' ./Runtest $$i ./$$i.gcc;\ done bench_gcc: all_gcc diff --git a/test/c/Results/binarytrees b/test/c/Results/binarytrees index 72654db9..9dfe1355 100644 --- a/test/c/Results/binarytrees +++ b/test/c/Results/binarytrees @@ -1,4 +1,7 @@ -stretch tree of depth 7 check: -1 -128 trees of depth 4 check: -128 -32 trees of depth 6 check: -32 -long lived tree of depth 6 check: -1 +stretch tree of depth 13 check: -1 +8192 trees of depth 4 check: -8192 +2048 trees of depth 6 check: -2048 +512 trees of depth 8 check: -512 +128 trees of depth 10 check: -128 +32 trees of depth 12 check: -32 +long lived tree of depth 12 check: -1 diff --git a/test/c/Results/binarytrees-mppa_k1c b/test/c/Results/binarytrees-mppa_k1c new file mode 100644 index 00000000..72654db9 --- /dev/null +++ b/test/c/Results/binarytrees-mppa_k1c @@ -0,0 +1,4 @@ +stretch tree of depth 7 check: -1 +128 trees of depth 4 check: -128 +32 trees of depth 6 check: -32 +long lived tree of depth 6 check: -1 diff --git a/test/c/Results/chomp b/test/c/Results/chomp index 7898d32f..145b603a 100644 --- a/test/c/Results/chomp +++ b/test/c/Results/chomp @@ -1,4 +1,10 @@ player 0 plays at (1,1) +player 1 plays at (6,0) +player 0 plays at (0,6) +player 1 plays at (5,0) +player 0 plays at (0,5) +player 1 plays at (4,0) +player 0 plays at (0,4) player 1 plays at (3,0) player 0 plays at (0,3) player 1 plays at (2,0) diff --git a/test/c/Results/chomp-mppa_k1c b/test/c/Results/chomp-mppa_k1c new file mode 100644 index 00000000..7898d32f --- /dev/null +++ b/test/c/Results/chomp-mppa_k1c @@ -0,0 +1,9 @@ +player 0 plays at (1,1) +player 1 plays at (3,0) +player 0 plays at (0,3) +player 1 plays at (2,0) +player 0 plays at (0,2) +player 1 plays at (1,0) +player 0 plays at (0,1) +player 1 plays at (0,0) +player 1 loses diff --git a/test/c/Results/fannkuch b/test/c/Results/fannkuch index 09ecc715..be1815d4 100644 --- a/test/c/Results/fannkuch +++ b/test/c/Results/fannkuch @@ -1,31 +1,31 @@ -123456 -213456 -231456 -321456 -312456 -132456 -234156 -324156 -342156 -432156 -423156 -243156 -341256 -431256 -413256 -143256 -134256 -314256 -412356 -142356 -124356 -214356 -241356 -421356 -234516 -324516 -342516 -432516 -423516 -243516 -Pfannkuchen(6) = 10 +12345678910 +21345678910 +23145678910 +32145678910 +31245678910 +13245678910 +23415678910 +32415678910 +34215678910 +43215678910 +42315678910 +24315678910 +34125678910 +43125678910 +41325678910 +14325678910 +13425678910 +31425678910 +41235678910 +14235678910 +12435678910 +21435678910 +24135678910 +42135678910 +23451678910 +32451678910 +34251678910 +43251678910 +42351678910 +24351678910 +Pfannkuchen(10) = 38 diff --git a/test/c/Results/fannkuch-mppa_k1c b/test/c/Results/fannkuch-mppa_k1c new file mode 100644 index 00000000..09ecc715 --- /dev/null +++ b/test/c/Results/fannkuch-mppa_k1c @@ -0,0 +1,31 @@ +123456 +213456 +231456 +321456 +312456 +132456 +234156 +324156 +342156 +432156 +423156 +243156 +341256 +431256 +413256 +143256 +134256 +314256 +412356 +142356 +124356 +214356 +241356 +421356 +234516 +324516 +342516 +432516 +423516 +243516 +Pfannkuchen(6) = 10 diff --git a/test/c/Results/fft b/test/c/Results/fft index 0fc1c969..a48608b0 100644 --- a/test/c/Results/fft +++ b/test/c/Results/fft @@ -1 +1 @@ -1024 points, result OK +262144 points, result OK diff --git a/test/c/Results/fft-mppa_k1c b/test/c/Results/fft-mppa_k1c new file mode 100644 index 00000000..0fc1c969 --- /dev/null +++ b/test/c/Results/fft-mppa_k1c @@ -0,0 +1 @@ +1024 points, result OK diff --git a/test/c/Results/fftsp b/test/c/Results/fftsp index 2b5711a6..cbeb0999 100644 --- a/test/c/Results/fftsp +++ b/test/c/Results/fftsp @@ -1 +1 @@ -8 points, result OK +4096 points, result OK diff --git a/test/c/Results/fftsp-mppa_k1c b/test/c/Results/fftsp-mppa_k1c new file mode 100644 index 00000000..2b5711a6 --- /dev/null +++ b/test/c/Results/fftsp-mppa_k1c @@ -0,0 +1 @@ +8 points, result OK diff --git a/test/c/Results/fftw-mppa_k1c b/test/c/Results/fftw-mppa_k1c new file mode 100644 index 00000000..a1b6130c --- /dev/null +++ b/test/c/Results/fftw-mppa_k1c @@ -0,0 +1,16 @@ +o[0] = 2.918193e+01 +o[1] = -3.230611e+01 +o[2] = 1.271687e+01 +o[3] = -1.099040e+01 +o[4] = 5.728673e+00 +o[5] = -4.918940e+00 +o[6] = 1.880764e+00 +o[7] = -1.292782e+00 +o[8] = 1.104073e+02 +o[9] = -5.867858e+01 +o[10] = 2.768382e+01 +o[11] = -2.073843e+01 +o[12] = 1.229410e+01 +o[13] = -9.195029e+00 +o[14] = 4.307537e+00 +o[15] = -2.080713e+00 diff --git a/test/c/Results/fib b/test/c/Results/fib index 0e0fa4d1..84ce6474 100644 --- a/test/c/Results/fib +++ b/test/c/Results/fib @@ -1 +1 @@ -fib(15) = 987 +fib(35) = 14930352 diff --git a/test/c/Results/fib-mppa_k1c b/test/c/Results/fib-mppa_k1c new file mode 100644 index 00000000..0e0fa4d1 --- /dev/null +++ b/test/c/Results/fib-mppa_k1c @@ -0,0 +1 @@ +fib(15) = 987 diff --git a/test/c/Results/integr b/test/c/Results/integr index c61fdcc2..973806c9 100644 --- a/test/c/Results/integr +++ b/test/c/Results/integr @@ -1 +1 @@ -integr(square, 0.0, 1.0, 100000) = 0.333328 +integr(square, 0.0, 1.0, 10000000) = 0.333333 diff --git a/test/c/Results/integr-mppa_k1c b/test/c/Results/integr-mppa_k1c new file mode 100644 index 00000000..c61fdcc2 --- /dev/null +++ b/test/c/Results/integr-mppa_k1c @@ -0,0 +1 @@ +integr(square, 0.0, 1.0, 100000) = 0.333328 diff --git a/test/c/Results/knucleotide b/test/c/Results/knucleotide index e69de29b..d13ae7dc 100644 --- a/test/c/Results/knucleotide +++ b/test/c/Results/knucleotide @@ -0,0 +1,27 @@ +A 30.284 +T 29.796 +C 20.312 +G 19.608 + +AA 9.212 +AT 8.950 +TT 8.948 +TA 8.936 +CA 6.166 +CT 6.100 +AC 6.086 +TC 6.042 +AG 6.036 +GA 5.968 +TG 5.868 +GT 5.798 +CC 4.140 +GC 4.044 +CG 3.906 +GG 3.798 + +562 GGT +152 GGTA +15 GGTATT +0 GGTATTTTAATT +0 GGTATTTTAATTTATAGT diff --git a/test/c/Results/knucleotide-mppa_k1c b/test/c/Results/knucleotide-mppa_k1c new file mode 100644 index 00000000..e69de29b diff --git a/test/c/Results/lists-mppa_k1c b/test/c/Results/lists-mppa_k1c new file mode 100644 index 00000000..2c94e483 --- /dev/null +++ b/test/c/Results/lists-mppa_k1c @@ -0,0 +1,2 @@ +OK +OK diff --git a/test/c/Results/mandelbrot b/test/c/Results/mandelbrot index 246f7ce1..b81e96bf 100644 Binary files a/test/c/Results/mandelbrot and b/test/c/Results/mandelbrot differ diff --git a/test/c/Results/mandelbrot-mppa_k1c b/test/c/Results/mandelbrot-mppa_k1c new file mode 100644 index 00000000..246f7ce1 Binary files /dev/null and b/test/c/Results/mandelbrot-mppa_k1c differ diff --git a/test/c/Results/nbody b/test/c/Results/nbody index 99ad4fd1..41b648fd 100644 --- a/test/c/Results/nbody +++ b/test/c/Results/nbody @@ -1,2 +1,2 @@ -0.169075164 --0.169050762 +-0.169086185 diff --git a/test/c/Results/nbody-mppa_k1c b/test/c/Results/nbody-mppa_k1c new file mode 100644 index 00000000..99ad4fd1 --- /dev/null +++ b/test/c/Results/nbody-mppa_k1c @@ -0,0 +1,2 @@ +-0.169075164 +-0.169050762 diff --git a/test/c/Results/nsieve b/test/c/Results/nsieve index 95fea812..bb9b87dc 100644 --- a/test/c/Results/nsieve +++ b/test/c/Results/nsieve @@ -1,3 +1,3 @@ -Primes up to 12800 1526 -Primes up to 6400 834 -Primes up to 3200 452 +Primes up to 5120000 356244 +Primes up to 2560000 187134 +Primes up to 1280000 98610 diff --git a/test/c/Results/nsieve-mppa_k1c b/test/c/Results/nsieve-mppa_k1c new file mode 100644 index 00000000..95fea812 --- /dev/null +++ b/test/c/Results/nsieve-mppa_k1c @@ -0,0 +1,3 @@ +Primes up to 12800 1526 +Primes up to 6400 834 +Primes up to 3200 452 diff --git a/test/c/Results/nsievebits b/test/c/Results/nsievebits index 2131804c..bb9b87dc 100644 --- a/test/c/Results/nsievebits +++ b/test/c/Results/nsievebits @@ -1,3 +1,3 @@ -Primes up to 40000 4203 -Primes up to 20000 2262 -Primes up to 10000 1229 +Primes up to 5120000 356244 +Primes up to 2560000 187134 +Primes up to 1280000 98610 diff --git a/test/c/Results/nsievebits-mppa_k1c b/test/c/Results/nsievebits-mppa_k1c new file mode 100644 index 00000000..2131804c --- /dev/null +++ b/test/c/Results/nsievebits-mppa_k1c @@ -0,0 +1,3 @@ +Primes up to 40000 4203 +Primes up to 20000 2262 +Primes up to 10000 1229 diff --git a/test/c/Results/perlin b/test/c/Results/perlin index 8438b53c..4503fc1c 100644 --- a/test/c/Results/perlin +++ b/test/c/Results/perlin @@ -1 +1 @@ -6.0000e+00 +-4.0543e+03 diff --git a/test/c/Results/perlin-mppa_k1c b/test/c/Results/perlin-mppa_k1c new file mode 100644 index 00000000..8438b53c --- /dev/null +++ b/test/c/Results/perlin-mppa_k1c @@ -0,0 +1 @@ +6.0000e+00 diff --git a/test/c/Results/qsort-mppa_k1c b/test/c/Results/qsort-mppa_k1c new file mode 100644 index 00000000..d86bac9d --- /dev/null +++ b/test/c/Results/qsort-mppa_k1c @@ -0,0 +1 @@ +OK diff --git a/test/c/Results/sha1-mppa_k1c b/test/c/Results/sha1-mppa_k1c new file mode 100644 index 00000000..730d5406 --- /dev/null +++ b/test/c/Results/sha1-mppa_k1c @@ -0,0 +1,2 @@ +Test `abc': passed +Test `abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq': passed diff --git a/test/c/Results/spectral b/test/c/Results/spectral index b06cd560..1e35f7e0 100644 --- a/test/c/Results/spectral +++ b/test/c/Results/spectral @@ -1 +1 @@ -1.272359925 +1.274224148 diff --git a/test/c/Results/spectral-mppa_k1c b/test/c/Results/spectral-mppa_k1c new file mode 100644 index 00000000..b06cd560 --- /dev/null +++ b/test/c/Results/spectral-mppa_k1c @@ -0,0 +1 @@ +1.272359925 diff --git a/test/c/Results/vmach b/test/c/Results/vmach index a95237a6..9caa2e51 100644 --- a/test/c/Results/vmach +++ b/test/c/Results/vmach @@ -1,2 +1,2 @@ -fib(15) = 987 -tak(12, 9, 6) = 9 +fib(30) = 1346269 +tak(18, 12, 6) = 7 diff --git a/test/c/Results/vmach-mppa_k1c b/test/c/Results/vmach-mppa_k1c new file mode 100644 index 00000000..a95237a6 --- /dev/null +++ b/test/c/Results/vmach-mppa_k1c @@ -0,0 +1,2 @@ +fib(15) = 987 +tak(12, 9, 6) = 9 diff --git a/test/c/Runtest b/test/c/Runtest new file mode 100755 index 00000000..f693219a --- /dev/null +++ b/test/c/Runtest @@ -0,0 +1,71 @@ +#!/bin/sh + +# The name of the test +name="$1" +shift + +# The temp file for output +out="test$$.log" +rm -f $out +trap "rm -f $out" 0 INT QUIT + +# Is the test expected to fail? +expect_fail=false + +# The architecture and the bitsize +arch=`sed -n -e 's/^ARCH=//p' ../../Makefile.config` +bits=`sed -n -e 's/^BITSIZE=//p' ../../Makefile.config` + +# The reference output +if test -f "Results/$name-$arch-$bits"; then + ref="Results/$name-$arch-$bits" +elif test -f "Results/$name-$arch"; then + ref="Results/$name-$arch" +elif test -f "Results/$name-$bits"; then + ref="Results/$name-$bits" +elif test -f "Results/$name"; then + ref="Results/$name" +else + ref="" +fi + +# Special conditions + +if test -f "$name.cond"; then + RUN=0 SKIP=1 EXPECT_FAIL=2 sh "$name.cond" + case "$?" in + 1) echo "$name: skipped"; exit 0;; + 2) expect_fail=true;; + esac +fi + +# Administer the test +if $SIMU $* > $out +then + if $expect_fail; then + echo "$name: ERROR (should have failed but did not)" + exit 2 + elif test -n "$ref"; then + if cmp -s "$out" "$ref"; then + echo "$name: passed" + exit 0 + else + echo "$name: WRONG OUTPUT (diff follows)" + diff -u "$ref" "$out" + exit 2 + fi + else + echo "$name: passed" + exit 0 + fi +else + retcode=$? + if $expect_fail; then + echo "$name: passed (failed as expected)" + exit 0 + else + echo "$name: EXECUTION FAILED (status $retcode)" + exit 2 + fi +fi + diff --git a/test/c/binarytrees.c b/test/c/binarytrees.c index adc0d7b3..becae164 100644 --- a/test/c/binarytrees.c +++ b/test/c/binarytrees.c @@ -75,7 +75,11 @@ int main(int argc, char* argv[]) unsigned N, depth, minDepth, maxDepth, stretchDepth; treeNode *stretchTree, *longLivedTree, *tempTree; +#ifdef __K1C__ N = argc < 2 ? 6 : atol(argv[1]); +#else + N = argc < 2 ? 12 : atol(argv[1]); +#endif minDepth = 4; diff --git a/test/c/chomp.c b/test/c/chomp.c index 5b3c9cfb..7e2f62c1 100644 --- a/test/c/chomp.c +++ b/test/c/chomp.c @@ -338,8 +338,13 @@ int main(void) struct _play *tree; +#ifdef __K1C__ ncol = 4; nrow = 4; +#else + ncol = 7; + nrow = 7; +#endif tree = make_play(1); /* create entire tree structure, not just the */ player = 0; /* needed part for first move */ current = make_data(nrow,ncol); /* start play at full board */ diff --git a/test/c/fannkuch.c b/test/c/fannkuch.c index 6fb7912f..befccd8d 100644 --- a/test/c/fannkuch.c +++ b/test/c/fannkuch.c @@ -102,7 +102,11 @@ fannkuch( int n ) int main( int argc, char* argv[] ) { +#ifdef __K1C__ int n = (argc>1) ? atoi(argv[1]) : 6; +#else + int n = (argc>1) ? atoi(argv[1]) : 10; +#endif printf("Pfannkuchen(%d) = %ld\n", n, fannkuch(n)); return 0; diff --git a/test/c/fft.c b/test/c/fft.c index 429181b1..8ab59c9a 100644 --- a/test/c/fft.c +++ b/test/c/fft.c @@ -152,7 +152,11 @@ int main(int argc, char ** argv) double enp, t, y, z, zr, zi, zm, a; double * xr, * xi, * pxr, * pxi; +#ifdef __K1C__ if (argc >= 2) n = atoi(argv[1]); else n = 10; +#else + if (argc >= 2) n = atoi(argv[1]); else n = 18; +#endif np = 1 << n; enp = np; npm = np / 2 - 1; diff --git a/test/c/fftsp.c b/test/c/fftsp.c index 2dcd4ad2..d327a74c 100644 --- a/test/c/fftsp.c +++ b/test/c/fftsp.c @@ -153,7 +153,11 @@ int main(int argc, char ** argv) float enp, t, y, z, zr, zi, zm, a; float * xr, * xi, * pxr, * pxi; +#ifdef __K1C__ if (argc >= 2) n = atoi(argv[1]); else n = 3; +#else + if (argc >= 2) n = atoi(argv[1]); else n = 12; +#endif np = 1 << n; enp = np; npm = np / 2 - 1; diff --git a/test/c/fftw.c b/test/c/fftw.c index 755bac7f..04d896ad 100644 --- a/test/c/fftw.c +++ b/test/c/fftw.c @@ -74,7 +74,11 @@ const E KP1_847759065 = ((E) +1.847759065022573512256366378793576573644833252); /* Test harness */ +#ifdef __K1C__ #define NRUNS (10 * 10) +#else +#define NRUNS (100 * 1000) +#endif int main() { diff --git a/test/c/fib.c b/test/c/fib.c index 439b908c..168626bc 100644 --- a/test/c/fib.c +++ b/test/c/fib.c @@ -12,7 +12,11 @@ int fib(int n) int main(int argc, char ** argv) { int n, r; +#ifdef __K1C__ if (argc >= 2) n = atoi(argv[1]); else n = 15; +#else + if (argc >= 2) n = atoi(argv[1]); else n = 35; +#endif r = fib(n); printf("fib(%d) = %d\n", n, r); return 0; diff --git a/test/c/integr.c b/test/c/integr.c index 19ea78ab..cd0521f5 100644 --- a/test/c/integr.c +++ b/test/c/integr.c @@ -25,7 +25,11 @@ double test(int n) int main(int argc, char ** argv) { int n; double r; +#ifdef __K1C__ if (argc >= 2) n = atoi(argv[1]); else n = 100000; +#else + if (argc >= 2) n = atoi(argv[1]); else n = 10000000; +#endif r = test(n); printf("integr(square, 0.0, 1.0, %d) = %g\n", n, r); return 0; diff --git a/test/c/lists.c b/test/c/lists.c index a72ec398..8deb0f37 100644 --- a/test/c/lists.c +++ b/test/c/lists.c @@ -61,8 +61,13 @@ int main(int argc, char ** argv) int n, niter, i; struct list * l; +#ifdef __K1C__ if (argc >= 2) n = atoi(argv[1]); else n = 500; if (argc >= 3) niter = atoi(argv[1]); else niter = 100; +#else + if (argc >= 2) n = atoi(argv[1]); else n = 1000; + if (argc >= 3) niter = atoi(argv[1]); else niter = 20000; +#endif l = buildlist(n); if (checklist(n, reverselist(l))) { printf("OK\n"); diff --git a/test/c/mandelbrot.c b/test/c/mandelbrot.c index 84fae15c..133d55c5 100644 --- a/test/c/mandelbrot.c +++ b/test/c/mandelbrot.c @@ -17,12 +17,20 @@ int main (int argc, char **argv) { int w, h, bit_num = 0; char byte_acc = 0; +#ifdef __K1C__ int i, iter = 30; +#else + int i, iter = 50; +#endif double x, y, limit = 2.0; double Zr, Zi, Cr, Ci, Tr, Ti; if (argc < 2) { +#ifdef __K1C__ w = h = 50; +#else + w = h = 1000; +#endif } else { w = h = atoi(argv[1]); } diff --git a/test/c/nbody.c b/test/c/nbody.c index 1ce8d788..ab0ebabe 100644 --- a/test/c/nbody.c +++ b/test/c/nbody.c @@ -140,7 +140,11 @@ void setup_bodies(void) int main(int argc, char ** argv) { +#ifdef __K1C__ int n = argc < 2 ? 100 : atoi(argv[1]); +#else + int n = argc < 2 ? 1000000 : atoi(argv[1]); +#endif int i; setup_bodies(); diff --git a/test/c/nsieve.c b/test/c/nsieve.c index fc79ba69..3954bcbe 100644 --- a/test/c/nsieve.c +++ b/test/c/nsieve.c @@ -29,10 +29,18 @@ static unsigned int nsieve(int m) { #define NITER 2 int main(int argc, char * argv[]) { +#ifdef __K1C__ int m = argc < 2 ? 6 : atoi(argv[1]); +#else + int m = argc < 2 ? 9 : atoi(argv[1]); +#endif int i, j; for (i = 0; i < 3; i++) { +#ifdef __K1C__ int n = 200 << (m-i); +#else + int n = 10000 << (m-i); +#endif unsigned count; for (j = 0; j < NITER; j++) { count = nsieve(n); } printf("Primes up to %8d %8u\n", n, count); diff --git a/test/c/nsievebits.c b/test/c/nsievebits.c index 15d31417..e3b7fd43 100644 --- a/test/c/nsievebits.c +++ b/test/c/nsievebits.c @@ -30,7 +30,11 @@ nsieve(unsigned int m) return (count); } +#ifdef __K1C__ #define NITER 1 +#else +#define NITER 2 +#endif static void test(unsigned int n) @@ -48,7 +52,11 @@ main(int ac, char **av) { unsigned int n; +#ifdef __K1C__ n = ac < 2 ? 2 : atoi(av[1]); +#else + n = ac < 2 ? 9 : atoi(av[1]); +#endif test(n); if (n >= 1) test(n - 1); diff --git a/test/c/perlin.c b/test/c/perlin.c index 79d49d62..29ebf964 100644 --- a/test/c/perlin.c +++ b/test/c/perlin.c @@ -63,9 +63,15 @@ static void init(void) { p[256+i] = p[i] = permutation[i]; } +#ifdef __K1C__ #define INCREMENT 0.5 #define MIN -3.0 #define MAX 3.0 +#else +#define INCREMENT 0.1 +#define MIN -5.0 +#define MAX 5.0 +#endif int main(int argc, char ** argv) { init(); diff --git a/test/c/qsort.c b/test/c/qsort.c index 8a035eb5..1ebe1e11 100644 --- a/test/c/qsort.c +++ b/test/c/qsort.c @@ -34,7 +34,11 @@ int main(int argc, char ** argv) int n, i, j; int * a, * b; +#ifdef __K1C__ if (argc >= 2) n = atoi(argv[1]); else n = 500; +#else + if (argc >= 2) n = atoi(argv[1]); else n = 100000; +#endif a = malloc(n * sizeof(int)); b = malloc(n * sizeof(int)); for (j = 0; j < NITER; j++) { diff --git a/test/c/spectral.c b/test/c/spectral.c index b3a34070..dca78fe0 100644 --- a/test/c/spectral.c +++ b/test/c/spectral.c @@ -43,7 +43,11 @@ void eval_AtA_times_u(int N, const double u[], double AtAu[]) int main(int argc, char *argv[]) { int i; +#ifdef __K1C__ int N = ((argc == 2) ? atoi(argv[1]) : 11); +#else + int N = ((argc == 2) ? atoi(argv[1]) : 1000); +#endif double * u, * v, vBv, vv; u = malloc(N * sizeof(double)); v = malloc(N * sizeof(double)); diff --git a/test/c/vmach.c b/test/c/vmach.c index 4e6848d2..5858d4d6 100644 --- a/test/c/vmach.c +++ b/test/c/vmach.c @@ -159,7 +159,11 @@ long wordcode_interp(unsigned int* code) #define I(a,b,c,d) ((a) + ((b) << 8) + ((c) << 16) + ((d) << 24)) +#ifdef __K1C__ #define FIBSIZE 15 +#else +#define FIBSIZE 30 +#endif unsigned int wordcode_fib[] = { /* 0 */ I(WCONST, FIBSIZE, 0, 0), @@ -178,9 +182,15 @@ unsigned int wordcode_fib[] = { /* 13 */ I(WRETURN, 0, 2, 0) }; +#ifdef __K1C__ #define TAKSIZE1 6 #define TAKSIZE2 9 #define TAKSIZE3 12 +#else +#define TAKSIZE1 6 +#define TAKSIZE2 12 +#define TAKSIZE3 18 +#endif unsigned int wordcode_tak[] = { /* 0 */ I(WCONST, TAKSIZE1, 0, 0), -- cgit