public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/52473] CSHIFT slow - inline it?
Date: Sun, 16 Jun 2013 12:06:00 -0000	[thread overview]
Message-ID: <bug-52473-4-HVM7tPmLok@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52473-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52473

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-16
     Ever confirmed|0                           |1

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
I don't have access to pathf95, but the following test (modified for some IDRIS
benchmarks)

  subroutine test_cshift()
    !-----------------------------------------------------------------
    ! Test de la fonction intrinsèque "cshift"
    !-----------------------------------------------------------------
    implicit none
    integer, parameter             :: n=ordre
    integer                        :: i,j
    integer, dimension(n)          :: vect=(/ (-i, i=1,n) /)
    real(kind=prec),dimension(n,n) :: t,td,t2,t1
    real(kind=prec)                :: cste

    call impression_entete("test_cshift")
    print *, "Order of matrix:", n

    !---- Initialisations --------------------------
    cste=exp(1._prec)
    t(:,:)  = reshape( &
              source=(/ (i*cste,i=1,n*n) /) , shape = (/ n,n /) )

    td(:,:) = 0._prec
    call cpu_time( val_temps(1) )
    td(:,:) = cshift(array=t(:,:), shift=vect(:), dim=1)
    call cpu_time( val_temps(2) )
    t1(:,:)  = td(:,:)

    call temps_consomme("test_cshift> 1) CSHIFT")

    !---- Décalage selon les lignes via des boucles --------------------
    td(:,:) = 0._prec
    call cpu_time( val_temps(1) )
    do j=1,n
       do i=n+vect(j),1,-1
          td(i-vect(j),j) = t(i,j)
       end do
       do i=1,-vect(j)
          td(i,j)=t(n+vect(j)+i,j)
       end do
    end do
    call cpu_time( val_temps(2) )
    t2(:,:) = td(:,:)

    call temps_consomme("test__cshift> 2) DO loop")

    if (sum(abs(t2-t1)) /= 0._prec) then
       print *,'Mauvais résultats !!!!',sum(abs(t2-t1))
    else
        print *,'Results OK'
    end if    

  end subroutine test_cshift

gives

====================
 Call to test_cshift
====================

 Order of matrix:        1000
 test_cshift> 1) CSHIFT
                                       Used CPU time ==>         7.624 ms
 test__cshift> 2) DO loop
                                       Used CPU time ==>         4.482 ms
 Results OK

So CSHIFT is 50% slower than the DO loop.

Note that I get similar results for EOSHIFT and RESHAPE:

=====================
 Call to test_eoshift
=====================

 Order of matrix:        1000
 test_eoshift> 1) EOSHIFT
                                       Used CPU time ==>         7.443 ms
 test__eoshift> 2) DO loop
                                       Used CPU time ==>         3.775 ms
 Results OK

=====================
 Call to test_reshape
=====================

 Order of matrix:        1000
 test__reshape> 1) RESHAPE
                                       Used CPU time ==>        10.624 ms
 test__reshape> 2) DO loop
                                       Used CPU time ==>         4.442 ms
 Results OK

PR45689 should probably fixed at the same time.
>From gcc-bugs-return-424460-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jun 16 12:06:58 2013
Return-Path: <gcc-bugs-return-424460-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11959 invoked by alias); 16 Jun 2013 12:06:58 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11915 invoked by uid 48); 16 Jun 2013 12:06:55 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/45689] [F2003] Missing transformational intrinsic in the trans_func_f2003 list
Date: Sun, 16 Jun 2013 12:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dominiq at lps dot ens.fr
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-45689-4-VxjXv5IZ5e@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-45689-4@http.gcc.gnu.org/bugzilla/>
References: <bug-45689-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-06/txt/msg00839.txt.bz2
Content-length: 514

http://gcc.gnu.org/bugzilla/show_bug.cgi?idE689

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-16
     Ever confirmed|0                           |1

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Related or duplicate of PR52473.


      parent reply	other threads:[~2013-06-16 12:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03 20:00 [Bug fortran/52473] New: " burnus at gcc dot gnu.org
2012-04-10 15:22 ` [Bug fortran/52473] " burnus at gcc dot gnu.org
2012-04-11 12:52 ` burnus at gcc dot gnu.org
2013-06-16 12:06 ` dominiq at lps dot ens.fr [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-52473-4-HVM7tPmLok@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).