diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-11-24 20:50:45 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-11-24 20:50:45 -0800 |
commit | a3eac6b430ecc1aa558a5a555552959c5e20de1b (patch) | |
tree | 588ee696c90047d7bba40b1eb7f557aaab411671 /tests/runner.py | |
parent | 13e604eb6c74f8beb2b797557406d23305094329 (diff) |
add floating-point stuff to benchmark_corrections
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py index a808681e..31b4ddb7 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -31,7 +31,7 @@ except: # Core test runner class, shared between normal tests and benchmarks class RunnerCore(unittest.TestCase): - save_dir = 0 + save_dir = os.environ.get('EM_SAVE_DIR') save_JS = 0 def setUp(self): @@ -4719,21 +4719,23 @@ else: Settings.CORRECT_SIGNS = Settings.CORRECT_OVERFLOWS = Settings.CORRECT_ROUNDINGS = 1 src = ''' #include<stdio.h> + #include<math.h> int main() { - int N = 6000; - int M = 6000; + int N = 4500; + int M = 4500; unsigned int f = 0; for (int t = 0; t < M; t++) { for (int i = 0; i < N; i++) { f += i / ((t % 5)+1); if (f > 1000) f /= (t % 3)+1; + if (i % 4 == 0) f += sqrtf(i) * (i % 8 == 0 ? 1 : -1); } } printf("final: %d.\\n", f); return 1; } ''' - self.do_benchmark(src, [], 'final: 599.') + self.do_benchmark(src, [], 'final: 451.') def test_fasta(self): src = open(path_from_root('tests', 'fasta.cpp'), 'r').read() |