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: Toon Moene <toon at moene dot org>
- To: Thomas Koenig <tkoenig at netcologne dot de>, fortran at gcc dot gnu dot org
- Date: Tue, 12 Jan 2016 19:37:35 +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> <5694AC39 dot 10306 at netcologne dot de>
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
- References:
- [patch, fortran] Fix PR 69154, inline matmul with WHERE
- Re: [patch, fortran] Fix PR 69154, inline matmul with WHERE
- Re: [patch, fortran] Fix PR 69154, inline matmul with WHERE
- Re: [patch, fortran] Fix PR 69154, inline matmul with WHERE
- Re: [patch, fortran] Fix PR 69154, inline matmul with WHERE