PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Allocate derived type array on device

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



Joined: 07 Mar 2012
Posts: 20

PostPosted: Sun Aug 12, 2012 8:47 pm    Post subject: Allocate derived type array on device Reply with quote

Hi, all

I try to allocate derived type array on gpu device. However, I will get the compiling message "error S0155 : more than one device-resident object in assignment" while the statement is "allocate( g_cf(i)%a(0:j), g_cf(i)%b(0:j) )".
And I got the runtime message "Process 0: Signalled ACCESS_VIOLATION at 0x40001c8e" while using the statement instead "allocate( g_cf(i)%a(j+1), g_cf(i)%b(j+1) )".

I've tried it using PVF 10.9 on WIN 7 and 12.3 on Linux.
Did I do anything wrong?
Thank you.

Code:

      program prog
      use cudafor
      implicit none   
      ! Variables
      Type g_ch
        integer :: cst
        real*8,allocatable :: a(:)
        integer,allocatable :: b(:)
      End type
      Type(g_ch),allocatable,device :: g_cf(:)
      Type(g_ch),allocatable ::cf(:)
      Integer::num, i, j
     
      num=10
      allocate( cf(num) )
      do i=1,num
        cf(i)%cst=i+num
       allocate( cf(i)%a(0:cf(i)%cst), cf(i)%b(0:cf(i)%cst) )      
      end do
     
      allocate( g_cf(num) )
      do i=1,num
        g_cf(i)%cst=cf(i)%cst
        j=g_cf(i)%cst
       allocate( g_cf(i)%a(0:j), g_cf(i)%b(0:j) )
       !allocate( g_cf(i)%a(j+1), g_cf(i)%b(j+1) )
      end do

      end program prog


cyfeng
Back to top
View user's profile
cyfengMIT



Joined: 07 Mar 2012
Posts: 20

PostPosted: Mon Aug 13, 2012 3:56 am    Post subject: Reply with quote

Hi, all:

Is my case same as this previous post?
http://www.pgroup.com/userforum/viewtopic.php?t=2910&sid=8bade15c7941343d3f893f5041b8355b

Quote:
...user defined types used as device types can only be composed of basic types, or fixed size arrays.

Thank you in advance.
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Aug 13, 2012 9:27 am    Post subject: Reply with quote

Quote:
Is my case same as this previous post?
Yes. Once NVIDIA supports dynamic allocation on the device (coming in CUDA 5 and Kepler2) this restriction may change, but for now, only fixed size types can have the device attribute.

- Mat
Back to top
View user's profile
cyfengMIT



Joined: 07 Mar 2012
Posts: 20

PostPosted: Mon Aug 13, 2012 8:48 pm    Post subject: Reply with quote

Hi, Mat,

OK...Thank you very much.
And is there any schedule about PGI Fotran supporting CUDA 5 ?
Thank you in advance.

Feng
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Aug 14, 2012 9:59 am    Post subject: Reply with quote

Hi Feng,

We usually include the next CUDA version about a month after NVIDIA officially releases it. Though, it may take us a bit to get all the new CUDA 5 features integrated into CUDA Fortran.

- 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