This is the mail archive of the gcc-bugs@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]

[Bug fortran/37131] inline matmul for small matrix sizes



------- Comment #12 from mikael at gcc dot gnu dot org  2010-06-05 09:31 -------
(In reply to comment #9)
> I have thought a little bit about this, and the problem is
> a bit daunting ;-)  Of course, this is at least partly because
> my experience with the scalarizer is close to non-existant, but you
> have to learn sometime.
> 
> It seems that the functions for scalarizing do not help a lot
> here, because (for example) we need three nested loops for implementing
> the case where a and b are of rank 2.
> 
> The preferred way would therefore be to state the rank 2 * rank 2 problem as
> 
>   do i=1,m
>      do j=1,n
>         c(i,j) = sum(a(i,:) * b(:,j))
>      end do
>   end do
> 
> with the inner dot product borrowed using the scalarizer (borrowing
> from dot_product), and the outer loops using either hand-crafted
> TREE code or calling the DO translation.
> 
> Comments?  Is this reasonable?
> 

The downside is that you can't use directly the matmul result in an expression. 
You will need a temporary. 

I'm working on nested scalarization loops for the sum intrinsic (pr43829) ;
inlining matmul should be straightforward after that. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37131


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