summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-06-10 11:21:14 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-07-06 12:04:03 +0300
commit56d8b365f5944bf78a427ac65c5a0d0311e0da5e (patch)
tree2240d8b7543445bf615496ed1ac65098bb112525
parentbddff993ed734f4b9030c1960bcb3ebe1caca807 (diff)
lowlevel-blt-bench: move explanation printing
Move explanation printing to a new function. This will help with implementing a machine-readable output option. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ben Avison <bavison@riscosopen.org>
-rw-r--r--test/lowlevel-blt-bench.c60
1 files changed, 33 insertions, 27 deletions
diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c
index 69202ee..993f5db 100644
--- a/test/lowlevel-blt-bench.c
+++ b/test/lowlevel-blt-bench.c
@@ -977,6 +977,38 @@ run_default_tests (double bandwidth_)
}
static void
+print_explanation (void)
+{
+ printf ("Benchmark for a set of most commonly used functions\n");
+ printf ("---\n");
+ printf ("All results are presented in millions of pixels per second\n");
+ printf ("L1 - small Xx1 rectangle (fitting L1 cache), always blitted at the same\n");
+ printf (" memory location with small drift in horizontal direction\n");
+ printf ("L2 - small XxY rectangle (fitting L2 cache), always blitted at the same\n");
+ printf (" memory location with small drift in horizontal direction\n");
+ printf ("M - large %dx%d rectangle, always blitted at the same\n",
+ WIDTH - 64, HEIGHT);
+ printf (" memory location with small drift in horizontal direction\n");
+ printf ("HT - random rectangles with %dx%d average size are copied from\n",
+ TILEWIDTH, TILEWIDTH);
+ printf (" one %dx%d buffer to another, traversing from left to right\n",
+ WIDTH, HEIGHT);
+ printf (" and from top to bottom\n");
+ printf ("VT - random rectangles with %dx%d average size are copied from\n",
+ TILEWIDTH, TILEWIDTH);
+ printf (" one %dx%d buffer to another, traversing from top to bottom\n",
+ WIDTH, HEIGHT);
+ printf (" and from left to right\n");
+ printf ("R - random rectangles with %dx%d average size are copied from\n",
+ TILEWIDTH, TILEWIDTH);
+ printf (" random locations of one %dx%d buffer to another\n",
+ WIDTH, HEIGHT);
+ printf ("RT - as R, but %dx%d average sized rectangles are copied\n",
+ TINYWIDTH, TINYWIDTH);
+ printf ("---\n");
+}
+
+static void
usage (const char *progname)
{
printf ("Usage: %s [-b] [-n] pattern\n", progname);
@@ -1024,33 +1056,7 @@ main (int argc, char *argv[])
dst = src + (BUFSIZE / 4);
mask = dst + (BUFSIZE / 4);
- printf ("Benchmark for a set of most commonly used functions\n");
- printf ("---\n");
- printf ("All results are presented in millions of pixels per second\n");
- printf ("L1 - small Xx1 rectangle (fitting L1 cache), always blitted at the same\n");
- printf (" memory location with small drift in horizontal direction\n");
- printf ("L2 - small XxY rectangle (fitting L2 cache), always blitted at the same\n");
- printf (" memory location with small drift in horizontal direction\n");
- printf ("M - large %dx%d rectangle, always blitted at the same\n",
- WIDTH - 64, HEIGHT);
- printf (" memory location with small drift in horizontal direction\n");
- printf ("HT - random rectangles with %dx%d average size are copied from\n",
- TILEWIDTH, TILEWIDTH);
- printf (" one %dx%d buffer to another, traversing from left to right\n",
- WIDTH, HEIGHT);
- printf (" and from top to bottom\n");
- printf ("VT - random rectangles with %dx%d average size are copied from\n",
- TILEWIDTH, TILEWIDTH);
- printf (" one %dx%d buffer to another, traversing from top to bottom\n",
- WIDTH, HEIGHT);
- printf (" and from left to right\n");
- printf ("R - random rectangles with %dx%d average size are copied from\n",
- TILEWIDTH, TILEWIDTH);
- printf (" random locations of one %dx%d buffer to another\n",
- WIDTH, HEIGHT);
- printf ("RT - as R, but %dx%d average sized rectangles are copied\n",
- TINYWIDTH, TINYWIDTH);
- printf ("---\n");
+ print_explanation ();
bandwidth = x = bench_memcpy ();
printf ("reference memcpy speed = %.1fMB/s (%.1fMP/s for 32bpp fills)\n",
x / 1000000., x / 4000000);