This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [patch, fortran] Fix PR 69154, inline matmul with WHERE


On 01/12/2016 08:33 AM, Thomas Koenig wrote:
Am 12.01.2016 um 00:17 schrieb Toon Moene:
On 01/12/2016 12:01 AM, Thomas Koenig wrote:


Am I correct in assuming that your inlining of MATMUL only treats the
form MATMUL(A, B) and not MATMUL(A, TRANSPOSE(B)) ?

Our code has about half of one and half of the other ...

This is, currently, correct, as Steve pointed out.

Yep, I see.

Still, one example of our MATMUL(A, TRANSPOSE(B)) occurrences has B
being a 65*65 square matrix, with A being (roughly) 22,000 * 65.

I surely going to see what happens, performance wise, if I just change
the expression to the following lines (TMP being a 65*65 local array):

TMP = TRANSPOSE(B)
... MATMUL(A, TMP)


If you are going to do some tests, you could also test (assuming
you're on a 64-bit system)


Good idea.

I suppose I have to add a line:

   integer(kind=8) :: i, j, k

   do i=0, size(b,1)-1

        c(:,i+1) = 0.0

?
      do k=0, size(a,2)-1
         do j=0, size(a,1)-1
            c(j+1,i+1) = c(j+1,i+1) + a(j+1,k+1) * b(i+1, k+1)
         end do
      end do
   end do

because this is what the unrolling will produce for
c = matmul(a,transpose(b)).

Regards

     Thomas



--
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news


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