This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran, RFC] First steps towards inlining matmul
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: Mikael Morin <mikael dot morin at sfr dot fr>, Dominique d'Humières <dominiq at lps dot ens dot fr>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, GNU GFortran <fortran at gcc dot gnu dot org>
- Date: Sat, 11 Apr 2015 19:01:12 +0200
- Subject: Re: [patch, fortran, RFC] First steps towards inlining matmul
- Authentication-results: sourceware.org; auth=none
- References: <20150405135519 dot AF21A105 at mailhost dot lps dot ens dot fr> <552147A3 dot 7000603 at netcologne dot de> <4DA1047C-92D3-485A-9457-61655ED14681 at lps dot ens dot fr> <55219D1C dot 6070507 at netcologne dot de> <9F588746-B32C-4919-AEFC-4EF5E6792001 at lps dot ens dot fr> <3916A939-23B3-4D17-B91C-8B6CC34CD7BC at lps dot ens dot fr> <5526FAAA dot 8010408 at netcologne dot de> <EB7BCB68-CD2A-4211-AC93-1EC0F475D822 at lps dot ens dot fr> <55291273 dot 6060800 at netcologne dot de> <552924F2 dot 6000406 at sfr dot fr>
Hi Mikael,
>> Still to do: Bounds checking (a rather big one),
> ... as you do a front-end to front-end transformation, you get bounds
> checking for free, don't you?
Only partially.
What the patch does is
integer i,j,k
c = 0
do j=0, size(b,2)-1
do k=0, size(a, 2)-1
do i=0, size(a, 1)-1
c(i * stride(c,1) + lbound(c,1), j * stride(c,2) +
lbound(c,2)) =
c(i * stride(c,1) + lbound(c,1), j * stride(c,2) + lbound(c,2)) +
a(i * stride(a,1) + lbound(a,1), k * stride(a,2) +
lbound(a,2)) *
b(k * stride(b,1) + lbound(b,1), j * stride(b,2) + lbound(b,2))
end do
end do
end do
If size(b,2) < size(c,2) or size(a,1) < size(c,1) or
size(a,2) < size(b,1), this will not get caught - no
array bounds violation in the DO loops, but illegal
code nonetheless.
Also, the error message is different, which should also be
changed.
What I would like to add to check before the loop, and then
add a "do not bounds-check" flag to the reference.
Thomas
- References:
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- From: Dominique Dhumieres
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- From: Dominique d'Humières
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- From: Dominique d'Humières
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- From: Dominique d'Humières
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- From: Dominique d'Humières
- Re: [patch, fortran, RFC] First steps towards inlining matmul
- Re: [patch, fortran, RFC] First steps towards inlining matmul