This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] Fix PR 69154, inline matmul with WHERE
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: Toon Moene <toon at moene dot org>, fortran at gcc dot gnu dot org
- Date: Tue, 12 Jan 2016 08:33:13 +0100
- Subject: Re: [patch, fortran] Fix PR 69154, inline matmul with WHERE
- Authentication-results: sourceware.org; auth=none
- References: <5692469F dot 8090906 at netcologne dot de> <56942582 dot 7000307 at moene dot org> <56943463 dot 3080703 at netcologne dot de> <56943807 dot 6040800 at moene dot org>
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)
integer(kind=8) :: i, j, k
do i=0, size(b,1)-1
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