This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Implement blocked eoshift for eoshift0
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: "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: Sun, 2 Jul 2017 12:53:51 +0100
- Subject: Re: [patch, fortran] Implement blocked eoshift for eoshift0
- Authentication-results: sourceware.org; auth=none
- References: <7f484ee3-4cbf-4373-8f5f-d30197e1e7c6@netcologne.de>
Hi Thomas,
The timings are impressive! OK for trunk.
Thanks
Paul
On 1 July 2017 at 14:48, Thomas Koenig <tkoenig@netcologne.de> wrote:
> Hello world,
>
> the attached patch implements the blocked algorithm for
> constant shift for dim > 1 for eoshift0 (which handles
> the case of constant shift and constant fill value).
>
> Speedup, as for cshift, is large. Moving a 500*500*500
> array by -3 with eo_bench.f90 (also attached):
>
> $ gfortran -O3 eo_bench.f90 && ./a.out
> dim = 1 t = 0.451796889
> dim = 2 t = 0.183514118
> dim = 3 t = 0.184015989
> $ gfortran-7 -static-libgfortran -O3 eo_bench.f90 && ./a.out
> dim = 1 t = 0.955736041
> dim = 2 t = 1.42228103
> dim = 3 t = 3.00043702
>
> Regression-tested. OK for trunk?
>
> Regards
>
> Thomas
>
> 2017-07-01 Thomas Koenig <tkoenig@gcc.gnu.org>
>
> * intrinsics/eoshift0.c: For contiguous arrays, use
> block algorithm. Use memcpy where possible.
>
> 2017-07-01 Thomas Koenig <tkoenig@gcc.gnu.org>
>
> * gfortran/eoshift_3.f90: New test.
--
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein