PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Attibutes(host,device) - is it supported in 10.5 ?

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



Joined: 23 Nov 2009
Posts: 2
Location: Institute of Aviation, Warsaw, Poland

PostPosted: Wed May 12, 2010 7:58 am    Post subject: Attibutes(host,device) - is it supported in 10.5 ? Reply with quote

Hello,
I am working on parallelizing my CFD code using CUDA Fortran, and I want some subroutines to be called by host and device subroutines. However I got compilation error when I am trying to call (device,host) subroutine from any host subroutine or program, as in the example:
Code:

module mod_fun
use cudafor
contains
  attributes(host,device) subroutine Plus2(x,y)
    implicit none
    integer,intent(in)  :: x
    integer,intent(out) :: y
    y=x+2
  end subroutine Plus2
end module mod_fun

program test
use mod_fun
implicit none
integer :: i,j
i=7
call Plus2(i,j)
end program test

When I am trying to compile this simple code I get the following:
Code:

$ pgfortran -Mcuda=cc13 -c test_host_device.f90
PGF90-S-0188-Argument number 1 to plus2: type mismatch (test_host_device.f90: 17)
PGF90-S-0188-Argument number 2 to plus2: type mismatch (test_host_device.f90: 17)
  0 inform,   0 warnings,   2 severes, 0 fatal for test

Does anyone know if attibutes(host,device) is supported in pgfortran 10.5 ??
Back to top
View user's profile
mkcolg



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

PostPosted: Wed May 12, 2010 8:39 am    Post subject: Reply with quote

Hi Folo,

No, sorry. You'll need to create two version of the routine, one for the host and one for the device.

- Mat
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