diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-11 10:41:01 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-11 10:41:01 -0800 |
commit | fa0443ee8ef4306ee2bf848a6c18d189bafbac77 (patch) | |
tree | f16a5da21f080d3f25d22dcc3829c6ea77cfaa2d | |
parent | e238b7e11fa973cd86721e5b1ed45b50b52e3c0d (diff) |
benchmark linpack in both float and double modes
-rw-r--r-- | tests/test_benchmark.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py index e9cfee52..1c5a2d71 100644 --- a/tests/test_benchmark.py +++ b/tests/test_benchmark.py @@ -428,10 +428,15 @@ process(sys.argv[1]) src = open(path_from_root('tests', 'life.c'), 'r').read() self.do_benchmark('life', src, '''--------------------------------''', shared_args=['-std=c99'], force_c=True) - def test_linpack(self): + def test_linpack_double(self): def output_parser(output): return 100.0/float(re.search('Unrolled Double Precision +([\d\.]+) Mflops', output).group(1)) - self.do_benchmark('linpack', open(path_from_root('tests', 'linpack.c')).read(), '''Unrolled Double Precision''', force_c=True, output_parser=output_parser) + self.do_benchmark('linpack_double', open(path_from_root('tests', 'linpack.c')).read(), '''Unrolled Double Precision''', force_c=True, output_parser=output_parser) + + def test_linpack_float(self): + def output_parser(output): + return 100.0/float(re.search('Unrolled Single Precision +([\d\.]+) Mflops', output).group(1)) + self.do_benchmark('linpack_float', open(path_from_root('tests', 'linpack.c')).read(), '''Unrolled Single Precision''', force_c=True, output_parser=output_parser, shared_args=['-DSP']) def test_zzz_java_nbody(self): # tests xmlvm compiled java, including bitcasts of doubles, i64 math, etc. args = [path_from_root('tests', 'nbody-java', x) for x in os.listdir(path_from_root('tests', 'nbody-java')) if x.endswith('.c')] + \ @@ -504,4 +509,4 @@ process(sys.argv[1]) native_args = native_lib + ['-I' + path_from_root('tests', 'bullet', 'src'), '-I' + path_from_root('tests', 'bullet', 'Demos', 'Benchmarks')] - self.do_benchmark('bullet', src, '\nok.\n', emcc_args=emcc_args, native_args=native_args)
\ No newline at end of file + self.do_benchmark('bullet', src, '\nok.\n', emcc_args=emcc_args, native_args=native_args) |