Difference in assembly code generated (gfortran vs ifort) (optimization flags missing?)

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Apr 12 14:48:00 GMT 2018


On Thu, Apr 12, 2018 at 04:00:46PM +0200, Richard Biener wrote:
> >
> >   USE ISO_C_BINDING

Move the above statement to ...

> >   !...
> >   subroutine mv_mult_4_4(mat,vec,res)

here.

> >     REAL(C_DOUBLE), INTENT(IN),  DIMENSION(4,4) :: mat
> >     REAL(C_DOUBLE), INTENT(IN),  DIMENSION(4)   :: vec
> >     REAL(C_DOUBLE), INTENT(OUT), DIMENSION(4)   :: res
> >     INTEGER(C_INT) :: iRow, iCol
> >
> >     res = 0.0
> >
> >     do iCol=1,4
> >        do iRow=1,4
> >           res(iRow) = res(iRow) + mat(iRow,iCol)*vec(iCol)
> >        end do
> >     end do
> >
> >   end subroutine mv_mult_4_4
> 
> This doesn't seem complete as it doesn't compile for me...

See above.

It would also be interesting to see the result of replacing
the loops with


   res = matmul(mat, vec)

as tkoenig (and jerryd?) works on optimizing matmul.

-- 
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow



More information about the Fortran mailing list