This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [fortran,patch] BLAS-enabled matmul


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]