PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

declarative data error in PGI Fortran 10
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Sat Dec 19, 2009 9:23 am    Post subject: declarative data error in PGI Fortran 10 Reply with quote

I believe FULL Accelerate spec. v1.0 has been implemented in PGI Fortran 10. However, when I use with declarative data in my program, i got a compile error.
CODE.
Code:

       program test
          real, dimension(10,10) :: a, b
          integer :: i
!$ACC copyin(a), local(b)             
          i = 19
          a = 1.1
          b = 3.0
        end program


Compile ERROR:
Quote:
PGF90-S-0034-Syntax error at or near COPYIN (main.f: 4)
0 inform, 0 warnings, 1 severes, 0 fatal for test

I got the same error if I declare in a subroutine.

Tuan.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6129
Location: The Portland Group Inc.

PostPosted: Sat Dec 19, 2009 9:29 am    Post subject: Reply with quote

Hi Tuan,

The copyin and local clauses need to be part of a region or data region directive. For example:
Code:
       program test
          real, dimension(10,10) :: a, b
          integer :: i
!$ACC data region copyin(a), local(b)             
          i = 19
          a = 1.1
          b = 3.0
!$ACC end data region
        end program


Hope this helps,
Mat
Back to top
View user's profile
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Sat Dec 19, 2009 9:38 am    Post subject: Reply with quote

Hi Mat,
Thanks for the prompt response. Could you please explain me about section 2.6 (Declarative Data Directives) in the "PGI Fortran&C Accelerate Programming Model" document. In this section, the syntax is
Code:
!$acc declclause [,declclause]...

with declclause can be copy(list), copyin(list)...

As described in the docucment, programmers don't have to define a region as it is implicitly defined as the whole subprogram unit.

Tuan.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6129
Location: The Portland Group Inc.

PostPosted: Sat Dec 19, 2009 6:20 pm    Post subject: Reply with quote

Hi Tuan,

The design doc is a bit ahead of the implimentation. Declarative data directives are still under development but should be available early next year.

Thanks,
Mat
Back to top
View user's profile
sindimo



Joined: 30 Nov 2010
Posts: 29
Location: Saudi Aramco

PostPosted: Tue Nov 30, 2010 3:49 am    Post subject: Declarative data directives Reply with quote

Dear Mat, are the declarative data directives still not working?

I tried the below using PGI compiler 10.9 and I get the below warning:
[rambo@superbeast working-fortran-example-with-gpu]$ mpif90 -fast -ta=nvidia,time -Minfo=all,accel -mcmodel=medium -Minline mm.f

PGF90-W-0155-Unrecognized ACC directive: declclausecopyin (mm.f: 13)


The sample Fortran code I am testing with is below:

Code:

       program main
         call MM()
         call MM()
         end program main


         subroutine MM ()
         integer dim1, dim2, dim3
         parameter (dim1 = 10000, dim2 = 10000, dim3 = 10000)
         double precision A(dim1, dim2), B(dim2, dim3), C(dim1, dim3)
         real start, finish
!$acc declclause copyin(A) copyin(B)

      call srand(86456)
      do i = 1, dim1
        do j = 1, dim2
          A(i, j) = rand()
        enddo
      enddo
      do i = 1, dim2
        do j = 1, dim3
          B(i, j) = rand()
        enddo
      enddo

      call cpu_time(start)

!$acc data region copyout(C)

!$acc region
        do j = 1, dim3
        do i = 1, dim1
          C(i, j) = 0
        enddo
        do k = 1, dim2
          do i = 1, dim1
            C(i, j) = C(i, j) + A(i, k)*B(k, j)
          enddo
        enddo
       enddo
!$acc end region

!$acc end data region

 call cpu_time(finish)
      print *,'time for C(',dim1,',',dim3,') = A(',dim1,',',dim2,') B(',
     1dim2,',',dim3,') is',finish - start,' s'

      end subroutine MM




Thanks for your help.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group