Re: [patch, libfortran] Speed up cshift for dim > 1

2017-06-19 Thread Thomas Koenig
Hi Dominique, For the record, the following CSHIFT is still 4 times slower than the DO loop I have looked into this a bit. The main reason is that, unlike cshift0 (without the array as shift) we do not generate individual functions to call for the usual data types, we use memcpy with a size

Re: [patch, libfortran] Speed up cshift for dim > 1

2017-06-18 Thread Thomas Koenig
Hi Jerry, OK for trunk. Committed as r249350. Thanks for the review, and thanks to Dominique for testing. Doing the same for eoshift should be straightforward, I'll do that later (but certainly before the 8.1 release). Next, on to cshift with an array as shift. I have some ideas there,

Re: [patch, libfortran] Speed up cshift for dim > 1

2017-06-16 Thread Jerry DeLisle
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

Re: [patch, libfortran] Speed up cshift for dim > 1

2017-06-16 Thread Dominique d'Humières
Hi Thomas, Your patch works as advertised! For the record, the following CSHIFT is still 4 times slower than the DO loop td(:,:) = cshift(array=t(:,:), shift=vect(:), dim=1) Thanks for working on this issue. Dominique

[patch, libfortran] Speed up cshift for dim > 1

2017-06-14 Thread Thomas Koenig
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) ::