This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran,patch] BLAS-enabled matmul
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: gfortran <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>, bmoses at stanford dot edu, drow at false dot org, paolo dot bonzini at lu dot unisi dot ch
- Date: Tue, 4 Apr 2006 10:00:35 -0700
- Subject: Re: [fortran,patch] BLAS-enabled matmul
- References: <44319954.7010203@gmail.com> <20060403222352.GA99591@troutmask.apl.washington.edu> <44322200.9@gmail.com>
On Tue, Apr 04, 2006 at 09:36:32AM +0200, FX Coudert wrote:
>
> Steve Kargl wrote:
> >The driver should build a list of libraries of the form
> >"-loptimized_blas -lgfortranbegin -lgfortran -lgfortran_blas -lgfortran
> >-lm"
> >with -L/some/path/to/blas in the search path.
>
> That can't be, since libgfortran needs symbols from liboptimized_blas,
> the external BLAS really needs to be used after "usercode.o -lgfortran"
>
OK, I understand the problem you need to solve with libgfortran_blas.a.
As an alternative, would be possible to translate the matmul() call
into a *gemm call in trans-intrinsics.c(gfc_conv_intrinsic_function)?
At the moment, gfc_conv_intrinsic_function has
case GFC_ISYM_MATMUL:
....
gfc_conv_intrinsic_funcall (se, expr);
break;
where *_funcall sets up the appropriate call to one of the
libgfortran routines. Could gfortran do
case GFC_ISYM_MATMUL:
conv_matmul (se, expr);
break;
where
void conv_matmul (se, expr)
{
if (Check for possible use of *gemm )
{
Set up calls to *gemm.
}
else
gfc_conv_intrinsic_funcall (se, expr);
}
This would then give
gfortran -fblas file.f90 -lblas
where, for example, the symbol dgemm_ would appear in file.o, and
so gfortran will automatically put the blas library in the right order.
BTW, two of the Polyhedron tests use matmul(). It will
be interesting to see if your patch improves the results.
--
Steve