28 #include "apps/bench/dilation-lena.hh"
29 #include "apps/data.hh"
34 #define DILATION_WITH_BUILTIN_WINDOW(Namespace, Suffix, Headline) \
39 for (unsigned i = 0; i < niters; ++i) \
40 d = Namespace::dilation(d); \
42 std::cout << Headline << t.read() << " s" << std::endl; \
43 io::pgm::save(d, prefix + '-' + length + '-' + Suffix + ".pgm"); \
47 #define DILATION(Namespace, Win, Suffix, Headline) \
52 for (unsigned i = 0; i < niters; ++i) \
53 d = Namespace::dilation(d, Win); \
55 std::cout << Headline << t.read() << " s" << std::endl; \
56 io::pgm::save(d, prefix + '-' + length + '-' + Suffix + ".pgm"); \
62 run(
const std::string&
filename,
const std::string& length,
unsigned niters)
74 std::string prefix =
"dilation-lena-out";
75 std::cout <<
"== " << filename << std::endl;
77 DILATION_WITH_BUILTIN_WINDOW(nongen,
"nongen",
"nongen\t\t");
78 DILATION_WITH_BUILTIN_WINDOW(nongen_2ptr,
"nongen_2ptr",
"nongen_2ptr\t");
79 DILATION_WITH_BUILTIN_WINDOW(nongen_1ptr,
"nongen_1ptr",
"nongen_1ptr\t");
81 DILATION(gen,
win_c4p(),
"gen",
"gen\t\t");
84 DILATION(fast,
win_c4p(),
"fast",
"fast\t\t");
85 DILATION(fast_noaccu,
win_c4p(),
"fast_noaccu",
"fast_noaccu\t");
86 DILATION(faster,
win_c4p(),
"faster",
"faster\t\t");
87 DILATION(faster_noaccu,
win_c4p(),
"faster_noaccu",
"faster_noaccu\t");
99 DILATION(fast_static, static_win_c4p,
"fast_static",
"fast_static\t");
100 DILATION(faster_static, static_win_c4p,
"faster_static",
"faster_static\t");
102 std::cout << std::endl;
108 unsigned niters = 10;
109 run(MLN_IMG_DIR
"/lena.pgm",
"512", niters);
110 run(MLN_APPS_DIR
"/bench/lena1024.pgm",
"1024", niters);
111 run(MLN_APPS_DIR
"/bench/lena2048.pgm",
"2048", niters);