Go backward to Loop Interchange Go up to Top Go forward to Transformation Result |
DO _ = 1, N C(I,J) = C(I,J)+A(I,K)*B(K,J) ENDDO
I and J are fixed
=> Scalar = Scalar + Vector*Vector
=> 1 vector reduction!
I and K are fixed
=> Vector = Vector + Scalar*Vector
=> 1 vector-vector, 1 scalar-vector
=> vector strides n
J and K are fixed
=> Vector = Vector + Vector*Scalar
=> 1 vector-vector, 1 scalar-vector
=> vector strides 1