~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to benchmarks/multi/harness.c

  • Committer: Will Newton
  • Date: 2013-06-25 14:07:04 UTC
  • Revision ID: will.newton@linaro.org-20130625140704-jp1ad8y2p8d416qk
Support multiple runs of each benchmark.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
static void usage(const char* name)
154
154
{
155
155
  printf("%s %s: run a string related benchmark.\n"
156
 
         "usage: %s [-c block-size] [-l loop-count] [-a alignment|src_alignment:dst_alignment] [-f] [-t test-name]\n"
 
156
         "usage: %s [-c block-size] [-l loop-count] [-a alignment|src_alignment:dst_alignment] [-f] [-t test-name] [-r run-id]\n"
157
157
         , name, VERSION, name);
158
158
 
159
159
  printf("Tests:");
282
282
  /* Alignment of buffers */
283
283
  int src_alignment = 8;
284
284
  int dst_alignment = 8;
 
285
  /* Name of the run */
 
286
  const char *run_id = "0";
285
287
 
286
288
  int opt;
287
289
 
288
 
  while ((opt = getopt(argc, argv, "c:l:ft:hva:")) > 0)
 
290
  while ((opt = getopt(argc, argv, "c:l:ft:r:hva:")) > 0)
289
291
    {
290
292
      switch (opt)
291
293
        {
304
306
        case 't':
305
307
          name = strdup(optarg);
306
308
          break;
 
309
        case 'r':
 
310
          run_id = strdup(optarg);
 
311
          break;
307
312
        case 'h':
308
313
          usage(argv[0]);
309
314
          break;
391
396
  double bounced = 0.448730 * loops / 50000000;
392
397
 
393
398
  /* Dump both machine and human readable versions */
394
 
  printf("%s:%s:%u:%u:%d:%d:%.6f: took %.6f s for %u calls to %s of %u bytes.  ~%.3f MB/s corrected.\n", 
 
399
  printf("%s:%s:%u:%u:%d:%d:%s:%.6f: took %.6f s for %u calls to %s of %u bytes.  ~%.3f MB/s corrected.\n", 
395
400
         variant + 4, ptest->name,
396
 
         count, loops, src_alignment, dst_alignment,
 
401
         count, loops, src_alignment, dst_alignment, run_id,
397
402
         elapsed,
398
403
         elapsed, loops, ptest->name, count,
399
404
         (double)loops*count/(elapsed - bounced)/(1024*1024));