From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83396 invoked by alias); 26 Apr 2016 15:16:39 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 83371 invoked by uid 89); 26 Apr 2016 15:16:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1516, cesar, sum, H*MI:sk:2016042 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 26 Apr 2016 15:16:37 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1av4j4-0005ev-O5 from Cesar_Philippidis@mentor.com ; Tue, 26 Apr 2016 08:16:34 -0700 Received: from [127.0.0.1] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.224.2; Tue, 26 Apr 2016 08:16:34 -0700 Subject: Re: gfortran6 with OpenACC - error To: , References: <201604261508.u3QF8Edn008744@mech-as222.men.bris.ac.uk> From: Cesar Philippidis Message-ID: <571F8652.7080503@codesourcery.com> Date: Tue, 26 Apr 2016 15:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201604261508.u3QF8Edn008744@mech-as222.men.bris.ac.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00063.txt.bz2 On 04/26/2016 08:08 AM, Anton Shterenlikht wrote: > gfortran 6.0.0 20160410 on linux. > Compiling with *no* -fopenacc works fine, > and the serial program runs as expected. > Compiling with -fopenacc gives an error. > Am I using OpenACC directives wrongly? > > newblue4> cat z.f90 > program z > implicit none > integer, parameter :: d1 = 1000, d2 = 1000 > real :: tmp( (d1-2) *(d2-2) ) > real, allocatable :: arr(:,:), old(:,:) > integer :: i,j,k > > ! allocate and set all to zero > allocate( arr(d1,d2), source = 0.0 ) > allocate( old(d1,d2) ) > > ! set inner cells to random numbers > call random_number(tmp) > arr( 2:d1-1 , 2:d2-1 ) = reshape( tmp, (/ d1-2, d1-2 /) ) > > !$acc data copy(arr) > write (*,*) "before:", sum(abs(arr)) > > do i=1,1000 > old = arr > > !$acc kernels > do j=2,d1-1 > do k=2,d2-1 > arr(j,k) = 0.25 * ( old(j-1,k) + old(j+1,k) + old(j,k-1) + old(j,k+1) ) > end do > end do > !$acc end kernels > > end do > > write (*,*) "after:", sum(abs(arr)) > > end program z > newblue4> > > newblue4> gfortran -O2 z.f90 -Wall -o gfort-acc.x > newblue4> time ./gfort-acc.x > before: 497871.688 > after: 464004.844 > 9.102u 0.006s 0:09.13 99.6% 0+0k 0+0io 0pf+0w > newblue4> > > newblue4> gfortran -fopenacc -O2 z.f90 -Wall -o gfort-acc.x > z.f90:34:3: > > end program z > 1 > Error: Unexpected END statement at (1) > f951: Error: Unexpected end of file in ‘z.f90’ > newblue4> This program missing an "!$acc end data" to mark the end of the data region. Cesar