|
| View previous topic :: View next topic |
| Author |
Message |
DAVID-SPH
Joined: 23 May 2011 Posts: 28
|
Posted: Wed Aug 15, 2012 9:19 am Post subject: Used of shared memory in device function |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4995 Location: The Portland Group Inc.
|
Posted: Wed Aug 15, 2012 11:38 am Post subject: |
|
|
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 |
|
 |
DAVID-SPH
Joined: 23 May 2011 Posts: 28
|
Posted: Wed Aug 15, 2012 11:49 am Post subject: |
|
|
| Brilliant! Thanks :-) |
|
| Back to top |
|
 |
DAVID-SPH
Joined: 23 May 2011 Posts: 28
|
Posted: Wed Aug 15, 2012 11:56 am Post subject: |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4995 Location: The Portland Group Inc.
|
Posted: Wed Aug 15, 2012 12:17 pm Post subject: |
|
|
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 |
|
 |
|
|
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 © 2001, 2002 phpBB Group
|