PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Accelerator directives dislike Fortran CONTAINS statement?

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
Alistair Hart



Joined: 06 Jul 2010
Posts: 21
Location: Cray Exascale Research Initiative, Edinburgh

PostPosted: Wed Jul 14, 2010 3:55 am    Post subject: Accelerator directives dislike Fortran CONTAINS statement? Reply with quote

Hi,

I'm accelerating some loops in a Fortran main program using PGI
directives. When I add a CONTAINS statement and a trivial
subroutine, I get error messages.

Can anyone advise, please? I'm using v10.6.0 of the compiler.

Cheers,

Alistair.

Here is my code:
Code:

PROGRAM test_trivial

  IMPLICIT NONE

  INTEGER, PARAMETER :: N = 10
  INTEGER :: u(N,N),i,j

  u = 0

!$acc region                                                                   \

  DO j = 1,N
     DO i = 1,N
        u(i,j) = u(i,j) + 1
     ENDDO
  ENDDO
!$acc end region                                                               \


#ifdef Use_contains
CONTAINS

  SUBROUTINE my_sub()

  END SUBROUTINE my_sub
#endif

END PROGRAM test_trivial

Here is the compiler output without the CONTAINS statement:
Code:

pgf90 -ta=nvidia,time -Minfo=accel test_trivial.F90
test_trivial:
     10, Generating copy(u(1:10,1:10))
         Generating compute capability 1.0 binary
         Generating compute capability 1.3 binary
     11, Loop is parallelizable
     12, Loop is parallelizable
         Accelerator kernel generated
         11, !$acc do parallel, vector(10)
         12, !$acc do parallel, vector(10)
             CC 1.0 : 6 registers; 24 shared, 20 constant, 0 local memory bytes\
; 100 occupancy                                                                 
             CC 1.3 : 6 registers; 24 shared, 20 constant, 0 local memory bytes\
; 100 occupancy                                                                 

And here is the output with a CONTAINS statement:
Code:

pgf90 -ta=nvidia,time -Minfo=accel -DUse_contains test_trivial.F90
test_trivial:
     10, No parallel kernels found, accelerator region ignored
     11, Accelerator restriction: scalar variable live-out from loop: i
         Accelerator restriction: scalar variable live-out from loop: .dY0002
     13, Accelerator restriction: induction variable live-out from loop: j
         Accelerator restriction: induction variable live-out from loop: i
     14, Accelerator restriction: induction variable live-out from loop: i
         Accelerator restriction: induction variable live-out from loop: .dY000\
2
     15, Accelerator restriction: induction variable live-out from loop: j
         Accelerator restriction: induction variable live-out from loop: .dY000\
1
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jul 14, 2010 4:44 pm    Post subject: Reply with quote

Hi Alistair,

Unfortunately, this is a known limitation. The problem is that the compiler must be conservative and assume that the main program's variables are being using in the contained routine.

Our engineers are aware of the issue and are working on a solution. However, this support will not be available for awhile.

In the 10.8 compiler, a work around will be added where you can add your index variables to a 'local' or 'private' clause to remove the dependency.

Thanks,
Mat[/code]
Back to top
View user's profile
Alistair Hart



Joined: 06 Jul 2010
Posts: 21
Location: Cray Exascale Research Initiative, Edinburgh

PostPosted: Fri Jul 16, 2010 7:29 am    Post subject: Reply with quote

Thanks. I'll try and find a workaround in the meantime.
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
Page 1 of 1

 
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