Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 31 additions & 6 deletions evaluation/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,45 @@
from benchmarks.mibench.automotive.bitcount.benchmark import benchmark as bitcount
from benchmarks.mibench.automotive.qsort.benchmark import benchmark as qsort
from benchmarks.mibench.automotive.susan.benchmark import benchmark as susan
from benchmarks.mibench.consumer.jpeg.benchmark import cjpeg as cjpeg
from benchmarks.mibench.consumer.jpeg.benchmark import djpeg as djpeg
from benchmarks.mibench.consumer.jpeg.benchmark import cjpeg, djpeg
from benchmarks.mibench.consumer.lame.benchmark import benchmark as lame
from benchmarks.mibench.consumer.tiff.benchmark import tiff2bw, tiff2rgba, tiff2ps, fax2ps, fax2tiff, gif2tiff, pal2rgb, \
ppm2tiff, ras2tiff, rgb2ycbcr, tiffcmp, tiffcp, tiffdither, tiffdump, tiffinfo, tiffmedian, tiffsplit

LLVM_DIR = Path(os.environ['LLVM_DIR'])
from benchmarks.mibench.consumer.typeset.benchmark import benchmark as typeset


def main():
llvm = LLVM(LLVM_DIR)
llvm_dir = Path(os.environ['LLVM_DIR'])
llvm = LLVM(llvm_dir)

benchmarks = [
sqlite,

basicmath,
bitcount,
qsort,
susan,
cjpeg,
djpeg,
lame,
tiff2bw,
tiff2rgba,
tiff2ps,
tiffcmp,
tiffcp,
tiffdither,
tiffdump,
tiffinfo,
tiffmedian,
tiffsplit,
fax2ps,
fax2tiff,
gif2tiff,
pal2rgb,
ppm2tiff,
ras2tiff,
rgb2ycbcr,
typeset
]

sizes = []
Expand Down Expand Up @@ -60,12 +79,18 @@ def run_opt_then_size(benchmark, flags):

sizes.append((before_size, after_size))

# print like a table
print(f'{"Benchmark":>15} {"constargs":>10} {"cloning":>10} {"diff(Bytes)":>12} {"diff(%)":>8}')
for benchmark, (before_size, after_size) in zip(benchmarks, sizes):
diff = -(after_size - before_size)
print(f'{benchmark.name:>15} {before_size:>10} {after_size:>10} {diff :>12} {100 * diff / before_size:>8.2f}')

with open('sizes.csv', 'w') as f:
f.write('benchmark,before,after\n')
for benchmark, (before_size, after_size) in zip(benchmarks, sizes):
f.write(f'{benchmark.name},{before_size},{after_size}\n')

print('Sizes written to sizes.csv')


if __name__ == '__main__':
main()
233 changes: 233 additions & 0 deletions evaluation/benchmarks/mibench/consumer/tiff/benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
import glob
from pathlib import Path
from benchmarking import Benchmark, Workload

DIR = Path(__file__).parent

libs = ['libtiff/tif_aux.c', 'libtiff/tif_close.c', 'libtiff/tif_codec.c', 'libtiff/tif_compress.c',
'libtiff/tif_dir.c', 'libtiff/tif_dirinfo.c', 'libtiff/tif_dirread.c', 'libtiff/tif_dirwrite.c',
'libtiff/tif_dumpmode.c', 'libtiff/tif_error.c', 'libtiff/tif_fax3.c', 'libtiff/tif_fax3sm.c',
'libtiff/tif_getimage.c', 'libtiff/tif_jpeg.c', 'libtiff/tif_flush.c', 'libtiff/tif_luv.c',
'libtiff/tif_lzw.c', 'libtiff/tif_next.c', 'libtiff/tif_open.c', 'libtiff/tif_packbits.c',
'libtiff/tif_pixarlog.c', 'libtiff/tif_predict.c', 'libtiff/tif_print.c', 'libtiff/tif_read.c',
'libtiff/tif_swab.c', 'libtiff/tif_strip.c', 'libtiff/tif_thunder.c', 'libtiff/tif_tile.c',
'libtiff/tif_unix.c', 'libtiff/tif_version.c', 'libtiff/tif_warning.c', 'libtiff/tif_write.c',
'libtiff/tif_zip.c']

# tiff2bw
tiff2bw = Benchmark(
name='tiff2bw',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiff2bw.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[
Workload(None,
[
DIR / 'tiff-data/large.tif',
DIR / 'output_largebw.tif'
],
None,
None),
]
)

# tiff2rgba
tiff2rgba = Benchmark(
name='tiff2rgba',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiff2rgba.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[
Workload(None,
[
DIR / 'tiff-data/large.tif',
DIR / 'output_large.tif'
],
None,
None),
]
)

# tiff2ps
tiff2ps = Benchmark(
name='tiff2ps',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiff2ps.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[
Workload(None,
[
DIR / 'tiff-data/large.tif',
DIR / 'output_large.ps'
],
None,
None),
]
)

# fax2ps
fax2ps = Benchmark(
name='fax2ps',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/fax2ps.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)

# fax2tiff
fax2tiff = Benchmark(
name='fax2tiff',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/fax2tiff.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)

# gif2tiff
gif2tiff = Benchmark(
name='gif2tiff',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/gif2tiff.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)

# pal2rgb
pal2rgb = Benchmark(
name='pal2rgb',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/pal2rgb.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# ppm2tiff
ppm2tiff = Benchmark(
name='ppm2tiff',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/ppm2tiff.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# ras2tiff
ras2tiff = Benchmark(
name='ras2tiff',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/ras2tiff.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# rgb2ycbcr
rgb2ycbcr = Benchmark(
name='rgb2ycbcr',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/rgb2ycbcr.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# tiffcmp
tiffcmp = Benchmark(
name='tiffcmp',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiffcmp.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# tiffcp
tiffcp = Benchmark(
name='tiffcp',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiffcp.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# tiffdither
tiffdither = Benchmark(
name='tiffdither',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiffdither.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# tiffdump
tiffdump = Benchmark(
name='tiffdump',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiffdump.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# tiffinfo
tiffinfo = Benchmark(
name='tiffinfo',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiffinfo.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# tiffmedian
tiffmedian = Benchmark(
name='tiffmedian',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiffmedian.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
# tiffsplit
tiffsplit = Benchmark(
name='tiffsplit',
path=DIR,
src_files=[DIR / 'tiff-v3.5.4' / f for f in libs + ['tools/tiffsplit.c']],
build_flags=[
f'-I{str(DIR / "tiff-v3.5.4")}',
f'-I{str(DIR / "tiff-v3.5.4" / "libtiff")}',
],
workloads=[]
)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions evaluation/benchmarks/mibench/consumer/tiff/tiff-v3.5.4/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.

Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
all copies of the software and related documentation, and (ii) the names of
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.

THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
Loading