Optimizing the vectors benchmark

Dmitriy Vyukov
Total Points:
25,462
Status Points:
25,462
Black Belt
November 25, 2008 12:51 AM PST
Rate
 
#3 Reply to #2
Quoting - tim18

There is no base non-optimized C++.  As I explained in more detail in my earlier paper, which was removed from the Intel sites (possibly on account of lack of interest), the C++ is derived from automatic translation of the original netlib Fortran.  The translation itself already introduces some source optimizations, some of which aren't typical of usual C or C++ practice. Almost by definition, it fits the quip about writing Fortran in any language.  Still, it doesn't make sense to compare in all cases the ability of C,C++ and Fortran compilers, nor to demonstrate OpenMP, on literal equivalents of the legacy Fortran, so I try to make the comparisons as fair as possible.

The purpose of the original, sometimes ugly, Fortran, was to test compilers of that era to see how much optimization they could perform.  In several cases, you might say I have perverted that purpose, by "improving" style, and sometimes introducing OpenMP.   The original authors were kind enough to agree to this use of their benchmark.

I don't have a personal position on whether the introduction of transform() could be considered an optimization.  g++ does very well with it, and icpc does well with some cases which g++ misses.  My personal position is not in favor of such use of transform() without vector classes, of which I present only a single example.  The re-organization of loops so as to fit accumulate(), inner_product(), and transform() is an important optimization, so I present both C and C++ versions of it.

And is there non-optimized Fortran code? It's just relatively difficult to extract the essence of optimization (the reusable pattern) w/o non-optimized case. It's much easier when optimizations are applied incrementally to some base code.



Intel Software Network Forums Statistics

8488 users have contributed to 31627 threads and 100752 posts to date.
In the past 24 hours, we have 33 new thread(s) 138 new posts(s), and 198 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to Crash when loading skeleton The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member chat1983