Re: Improving multi-dimension array access performance
- From: Glen Herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Sat, 29 Nov 2008 02:12:54 -0700
Ron Shepard wrote:
(snip)
I'm not exactly sure what you mean by "isn't possible", but the following loop structure accomplishes a matrix-matrix product and steps through all three arrays with the innermost loops corresponding to the left-most index.
do i = 1, n1
do j = 1, n2
bji = b(j,i)
do k = 1, n3
c(k,i) = c(k,i) + a(k,j) * bji
enddo
enddo
enddo
I did now try this one. It is significantly (about 20%)
slower than the more usual order summing into a temporary
variable. (Which should be in a register with a good
compiler.) Don't forget to zero c at the appropriate
point.
That compares with about 5% slower for assumed shape.
-- glen
.
- References:
- Improving multi-dimension array access performance
- From: Rajorshi Biswas
- Re: Improving multi-dimension array access performance
- From: Glen Herrmannsfeldt
- Re: Improving multi-dimension array access performance
- From: Ron Shepard
- Improving multi-dimension array access performance
- Prev by Date: RAM access limits under 64bit
- Next by Date: Re: fortran and hex readers
- Previous by thread: Re: Improving multi-dimension array access performance
- Next by thread: Re: Improving multi-dimension array access performance
- Index(es):