PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Used of shared memory in device function
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
DAVID-SPH



Joined: 23 May 2011
Posts: 28

PostPosted: Wed Aug 15, 2012 9:19 am    Post subject: Used of shared memory in device function Reply with quote

Hi,

I'm trying to use shared memory in a device function but I get the message:

SHARED attribute ignored on dummy argument totals_shared

and then:
Error 3 Internal compiler error. Unexpected runtime function call 0

The shared memory is declared properly in the kernel (size known at compile time) and passed as reference to the function, I have tried all different ways to declare the shared memory, but I don't seem to be able to get around this problem.
Code:

 attributes(global) subroutine multiScanTestBox()
    integer,volatile, shared      :: reduction_shared(3256)
    integer,volatile, shared      :: totals_shared(48)
............................................
 totalsSum = Multiscan Multiscan(tid, x, total, reduction_shared, totals_shared)

.....

!The function multiscan goes:

attributes(device) integer function Multiscan(tid, x, total, reduction_shared, totals_shared)
  integer,volatile, shared   :: reduction_shared(3256)!(SCANSIZE)!(*)!(:)!(3256)

!...etc etc
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Aug 15, 2012 11:38 am    Post subject: Reply with quote

Hi David,

Dummy arguments can't have the shared attribute, so you'll need to remove it from the declarations in the Multigrid function. You'll still be using shared memory since you pass in the addresses of the shared arrays so the code should function as expected.

Hope this helps,
Mat
Back to top
View user's profile
DAVID-SPH



Joined: 23 May 2011
Posts: 28

PostPosted: Wed Aug 15, 2012 11:49 am    Post subject: Reply with quote

Brilliant! Thanks :-)
Back to top
View user's profile
DAVID-SPH



Joined: 23 May 2011
Posts: 28

PostPosted: Wed Aug 15, 2012 11:56 am    Post subject: Reply with quote

By the way, do you know what the
": error F0000 : Internal compiler error. Unexpected runtime function call 0"

really means?, I get that from time to time...
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Aug 15, 2012 12:17 pm    Post subject: Reply with quote

Hi David,

In this case, the message is coming from the NVIDIA back end compiler. Most likely we're presenting it with some intermediate code it doesn't like. Though, I'd need a reproducing example to understand what "function call 0" means.

- 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, 4  Next
Page 1 of 4

 
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