questions on gfortran
lucatrv
lucatrv@hotmail.com
Sat May 12 12:26:00 GMT 2007
> Luca Trevisani wrote:
> >
> > PROGRAM PROVA
> > IMPLICIT NONE
> > INTEGER, PARAMETER :: WP = KIND(1.0D0)
> > INTEGER, PARAMETER :: NX=10000, NY=10000
> > INTEGER :: I, J
> > REAL(WP) :: A(NX,NY), X(NX), Y(NY)
> > REAL(WP) :: T1, T2
> > CALL CPU_TIME(T1)
> > DO I=1,NX
> > X(I)=2.0_WP/REAL((NX+1)*I-1,WP)
> > END DO
> > DO I=1,NY
> > Y(I)=2.0_WP/REAL((NY+1)*I-1,WP)
> > END DO
> > DO J=1,NY
> > DO I=1,NX
> > A(I,J)=SIN(1.0_WP+REAL(I+J,WP))
> > END DO
> > END DO
> > CALL CPU_TIME(T2)
> > PRINT *, 'Execution time:', T2-T1
> > END PROGRAM PROVA
> >
> >
> > In conclusion, now it seems to me that actually all flags other than
> > -O2 are
> > almost uninfluential on the execution speed, both under win32 and under
> > linux...
> >
> You're talking about execution speed of sin(), but I doubt you
> recompiled the sin() function or used a vectorized library.
>
Could you please explain me better? I thought I didn't have to recompile
internal fortran functions in order to have them vectorized... and I
wouldn't even know how to do that. By the way, since the sin() function is
elemental, shouldn't it be already vectorized?
Are you saying that even a SIN(X) where X is a vector is not actually
vectorized if the fortran libraries where not vectorized themselves when
they were compiled?
Thank you,
Luca
More information about the Fortran
mailing list