This is the mail archive of the
mailing list for the GCC project.
Re: [patch, libfortran] Speed up cshift for dim > 1
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: Thomas Koenig <tkoenig at netcologne dot de>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Jun 2017 10:19:39 -0700
- Subject: Re: [patch, libfortran] Speed up cshift for dim > 1
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
On 06/14/2017 12:41 PM, Thomas Koenig wrote:
> Hello world,
> the attached patch implements a blocked algorithm for
> improving the speed of cshift for dim > 1.
> It uses the fact that
> integer, dimension (n1,n2,n3) :: a, b
> b = cshift(a,shift,3)
> is identical, as far as the memory locations is concerned.
> integer, dimension (n1*n2*n3) :: c, d
> d = cshift(c, shift*n1*n2, 1)
> The speedup is quite large; from being really slow for
> dim > 1, this patch makes it go even faster.
> Below there are some comparisons for the attached benchmark,
> do-1.f90. gfortran-7 uses the old library version.
> Interestingly, the library version is also much faster
> than an implementation of straight DO loops.
> Regression-tested. OK for trunk?
OK for trunk.