[patch] Diag mode for benchmarks

Jules Bergmann jules at codesourcery.com
Wed Feb 14 21:10:36 UTC 2007


This patch has been "rotting" in my directory for a while, and now that
the release is out, I want to try to get it checked in.

This patch adds a "diag" mode for the benchmarks.  In particular, if
you run a benchmark program with the '-diag' option, instead of
running the actual benchmark, it will attempt to display information
about what is being benchmarked.

For example, if you want to find out what backend is being used for
complex vector multiply (vmul -2), you would type:

% benchmarks/vmul -2 -diag
diagnose_eval_list
   dst expr: 
N4vsip5DenseILj1ESt7complexIfENS_5tupleILj0ELj1ELj2EEENS_9Local_mapEEE
   src expr: 
N4vsip4impl17Binary_expr_blockILj1ENS0_2op4MultENS_5DenseILj1ESt7complexIfENS_5tupleILj0ELj1ELj2EEENS_9Local_mapEEES6_SA_S6_EE
   -        Intel_ipp_tag  ct:  true  rt:  true  (Expr_IPP_VV-ipp::vmul)
   -        Transpose_tag  ct: false  rt: false
   -      Mercury_sal_tag  ct: false  rt: false
   -              unknown  ct: false  rt: false
   -     Simd_builtin_tag  ct:  true  rt:  true  (Expr_SIMD_VV-simd::vmul)
   -       Dense_expr_tag  ct: false  rt: false
   -             Copy_tag  ct: false  rt: false
   -          Op_expr_tag  ct: false  rt: false
   - Simd_loop_fusion_tag  ct: false  rt: false
   -      Loop_fusion_tag  ct:  true  rt:  true  (Expr_Loop)

This shows the source and destination expression types, and walks
through the back-ends to show which apply (using the
diagnose_eval_list_std() function).

In this particular case, the Intel_ipp_tag, Simd_builtin_tag, and
Loop_fusion_tag backends apply.

Of course, generating this output requires modifying the benchmark
cases to report something useful.  This patch modifies several benchmarks
to do this.  Unfortunately, the remaining benchmarks that have not
been modified will now fail to compile.

To make fixing these benchmarks easier to do, and to make future
changes like this easier, the patch also includes a new base class for
benchmarks called Benchmark_base.  This class defines a 'diag()'
member function, so modifying a benchmark class to derive from it will
fix the compilation error (but will not generate any useful diag info
of course!).

-- 
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bm.diff
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20070214/972dc432/attachment.ksh>


More information about the vsipl++ mailing list