David C. P. LaFrance-Linden wrote:
>
<SNIP>
> Now for MATMUL... Depends a lot on the compiler and the run-time. If
> I were writing the runtime <...SNIP> If I really wanted to go wild,
> I might even have a version with explicit shape dummies that the
> compiler would call when the actuals are all sequence associated, thus
> invoking whatever optimizations can be done when sequence association
> is guarenteed and without the copy-in/copy-out overhead.
Just a short question:
What is in your opinion the proportion of calls to MATMUL
in which tha sequence association is preserved to all calls
in a typical code? I don't mean some examples concocted to
confuse compilers and possibly compiler writers, but real
applications.
And three comments:
1) At least in my codes I tend to use very little irregular indexing
(e.g., vector indexing or even using an array section or an array
with more than one dimension). If the same could be said about
a significant portion of F90 codes, than having two versions of
MATMUL might make a lot of sense.
2) If a compiler came with a decent documentation of what
optimizations are possible for different input arguments, many
application writers would try to avoid the low performance
constructs. One possibility of such documentstion would be
a compiler option that would cause the compiler to list
the optimizations it cannot do and explain why.
3) Some performance-conscious computer vendors provide custom
versions of BLAS, which would take care of efficiently
executing the MATMUL when the input data is suficciently
regular. If you'd rely on BLAS to do the dirty work, you
could save yourself the effort of further optimizing
the 'special cases'.
Regards,
Artur Swietanowski
----------------------------------------------------------------------
Artur Swietanowski mailto:[log in to unmask]
Institut fuer Statistik, Operations Research und Computerverfahren,
Universitaet Wien, Universitaetsstr. 5, A-1010 Wien, Austria
tel. +43 (1) 407 63 55 - 120 fax +43 (1) 406 41 59
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|