From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124326 invoked by alias); 16 Jun 2017 17:19:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 124263 invoked by uid 89); 16 Jun 2017 17:19:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*M:charter, H*r:InterMail, H*F:D*charter.net, H*Ad:D*charter.net X-Spam-User: qpsmtpd, 2 recipients X-HELO: mtaout004-public.msg.strl.va.charter.net Received: from mtaout004-public.msg.strl.va.charter.net (HELO mtaout004-public.msg.strl.va.charter.net) (68.114.190.29) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Jun 2017 17:19:38 +0000 Received: from impout001 ([68.114.189.16]) by mtaout004.msg.strl.va.charter.net (InterMail vM.9.00.023.01 201-2473-194) with ESMTP id <20170616171941.CPW3685.mtaout004.msg.strl.va.charter.net@impout001>; Fri, 16 Jun 2017 12:19:41 -0500 Received: from [192.168.2.11] ([96.41.215.23]) by impout001 with charter.net id ZVKf1v00D0Wrkg001VKg6Z; Fri, 16 Jun 2017 12:19:41 -0500 X-Authority-Analysis: v=2.2 cv=Lv3i8jVc c=1 sm=1 tr=0 a=salB9WdMPIDduBH7JsZfrA==:117 a=salB9WdMPIDduBH7JsZfrA==:17 a=IkcTkHD0fZMA:10 a=x7bEGLp0ZPQA:10 a=WipAMsWLlbfqtQp3T3EA:9 a=QEXdDO2ut3YA:10 X-Auth-id: anZkZWxpc2xlQGNoYXJ0ZXIubmV0 Subject: Re: [patch, libfortran] Speed up cshift for dim > 1 To: Thomas Koenig , "fortran@gcc.gnu.org" , gcc-patches References: <2c24688d-22e5-efde-4429-1eab756360a5@netcologne.de> From: Jerry DeLisle Message-ID: Date: Fri, 16 Jun 2017 17:19:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <2c24688d-22e5-efde-4429-1eab756360a5@netcologne.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-06/txt/msg01224.txt.bz2 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. Thanks, Jerry