Re: which is efficient
- From: Tim Prince <timothyprince@xxxxxxxxxxxxx>
- Date: Wed, 09 May 2007 07:28:23 -0700
Mark Morss wrote:
PROGRAM test
IMPLICIT NONE
INTEGER :: i,j,k,m
REAL,DIMENSION(200,200,200) :: a
REAL :: out
DO m=1,100
DO i=1,200
DO j=1,200
DO k=1,200
a(i,j,k) = 0.0
END DO
END DO
END DO
END DO
Optimizing compilers will shuffle or combine the loops so as to
get stride 1 access, even though you have written this in an
apparent attempt to ruin cache performance. Many will go further,
and truncate the outer loop to DO m=100,100, as the results can
be seen to be identical.
.
- Follow-Ups:
- Re: which is efficient
- From: Mark Morss
- Re: which is efficient
- References:
- Re: which is efficient
- From: Mark Morss
- Re: which is efficient
- Prev by Date: Re: which is efficient
- Next by Date: Re: which is efficient
- Previous by thread: Re: which is efficient
- Next by thread: Re: which is efficient
- Index(es):