BLAS2

As a typical BLAS2 operation, we here consider vector-matrix multiplication (the example from lecture),

\begin{displaymath}
v_2[i] = \sum_k v_1[j] M_1[j][i].
\end{displaymath} (1)

To assess the importance of the ordering of the loops, write the following routines (same prototype as mult()), uncomment their calls through timer in the main program in ``timer.c'', comment out preceding calls to timer, and run the resulting program.

  1. vecmat1(): code the multiplication (1) using the naïve sequence of loops (first i, then j)
  2. vecmat2(): code the multiplication (1) reversing the sequence of the loops



Tomas Arias 2005-04-15