PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

data locally defined in a kernel
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: Thu Feb 11, 2010 11:47 am    Post subject: data locally defined in a kernel Reply with quote

If I define a variable in a kernel (global, or device), would it be automatically reside in the device memory, or I have to explicitly use one appropriate attribute (shared, device).

Code:

attributes(global) subroutine dosomething()

  integer :: var1  ! where var1 locates???

end subroutine dosomething

attributes(device) subroutine dosomething()

  integer :: var2  ! where var2 locates???

end subroutine dosomething



Tuan
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Feb 11, 2010 5:47 pm    Post subject: Reply with quote

Hi Tuan,

Both variables are on the device (unless you're in emulation mode).

- Mat
Back to top
View user's profile
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Thu Feb 11, 2010 6:08 pm    Post subject: Reply with quote

mkcolg wrote:
Hi Tuan,

Both variables are on the device (unless you're in emulation mode).

- Mat


Thanks, Mat.

Tuan
Back to top
View user's profile
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Wed Feb 17, 2010 3:07 pm    Post subject: Reply with quote

mkcolg wrote:
Hi Tuan,

Both variables are on the device (unless you're in emulation mode).

- Mat


Without any explicit attribute (shared, device, local), would those variables allocated in the global memory by default or the compiler will try to allocate in the shared memory first?

Tuan
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Feb 17, 2010 7:52 pm    Post subject: Reply with quote

Hi Tuan,

They would be placed in global memory by default.

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