[patch, libfortran, RFC] Speed up cshift with array shift

Thomas Koenig tkoenig@netcologne.de
Mon Jun 19 22:34:00 GMT 2017


Hello world,

this is an RFC patch for speeding up the other part of cshift.
No mathematical tricks this time, just new functions which
copy the data types instead of using memcpy.

Performance improvement:

  cpu time cshift dim=1   0.277510017
  cpu time do loop dim=1   0.201206982
  cpu time cshift dim=2   0.514984965
  cpu time do loop dim=2   0.515266180
  cpu time cshift dim=3    1.01037502
  cpu time do loop dim=3    1.03989792

vs (gcc 7 without the patch).

  cpu time cshift dim=1   0.492732018
  cpu time do loop dim=1   0.188914001
  cpu time cshift dim=2   0.601395011
  cpu time do loop dim=2   0.462792039
  cpu time cshift dim=3   0.942433834
  cpu time do loop dim=3    1.07195783

for the attached test case. So, better if not quite the
performance of straightforward DO loops.

Still something to be gained for dim=1 by using
memcpy for blocks; planned before I submit.

Comments? Did I miss anything for correctness?

Regards

	Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p3.diff
Type: text/x-patch
Size: 278590 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170619/10ada38b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cshift_do.f90
Type: text/x-fortran
Size: 2672 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170619/10ada38b/attachment-0001.bin>


More information about the Gcc-patches mailing list