This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Optimization of forall loops
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Date: Mon, 27 Feb 2006 13:30:08 +0100
- Subject: Optimization of forall loops
I have done the following change in the test-fpu.f90 polyhedron test:
[karma] lin/source% diff test_fpu.f90 test_fpu_v2.f90
99c99
< INTEGER :: i, j, k, m, imax(1), ipvt(n)
---
> INTEGER :: i, j, k, m, p, imax(1), ipvt(n)
117c117,119
< b(:,j) = b(:,j)-temp*c
---
> forall ( p = 1:n )
> b(p,j) = b(p,j)-temp(p)*c
> end forall
and the timings are:
Test1 - Gauss 2000 (101x101) inverts 4.7 sec Err= 0.000000000000002
for the original test and
Test1 - Gauss 2000 (101x101) inverts 10.7 sec Err= 0.000000000000002
with the forall (GNU Fortran 95 (GCC) 4.2.0 20060225 (experimental) and
gfortran -O3 -ffast-math -funroll-loops *.f90).
Dominique