PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

function or procedure calls are not allowed

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
THX 1138



Joined: 30 Jun 2011
Posts: 103

PostPosted: Thu Jul 05, 2012 11:54 am    Post subject: function or procedure calls are not allowed Reply with quote

In the following function when I try to compile with

#pragma acc region

i get the following errors. i am really only interested in the last one.


[code]
TRA_RAY2:
101, Accelerator restriction: size of the GPU copy of an array depends on values computed in this loop
Accelerator region ignored
102, Accelerator restriction: size of the GPU copy of 'TRD' is unknown
Accelerator restriction: one or more arrays have unknown size
162, Accelerator restriction: size of the GPU copy of an array depends on values computed in this loop
Accelerator region ignored
163, Accelerator restriction: size of the GPU copy of 'Env' is unknown
Accelerator restriction: function/procedure calls are not supported
Accelerator restriction: one or more arrays have unknown size
165, Accelerator restriction: function/procedure calls are not supported
[code/=]

Since it does ot support function or procesdure call I guess thta is why it is giving me the error. Is this something that could possibly be changed in the future?

The code in question is:



for(i=0;i<(*Env).Nfreq;i=i+1)
LWR_VTX2( (*Env).frequency_Hz[i], &Gzv, RRAYb, &((*TRD).ZRAY),
&((*TRD).FRAY[i]), IRb, Env);
(*TRD).NLWR = (*TRD).NLWR + 1;

where the line that begins with & is the line 165.

In addition, how do I put in code in a forum post. Put in like this or use a code box? i

If use a code box how does one make a code box?

Thanks in advance.

THX 1138
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Jul 05, 2012 2:51 pm    Post subject: Reply with quote

Functions called within an accelerator region must first be inlined before the region can be accelerated. The restriction is mostly due to the lack of a linker for device code as well as limited calling support on the device. NVIDIA will begin shipping a device linker with CUDA 5 and the Kepler K20 will have several improvements with will make function calling more feasible. We'll begin looking on how to extend the PGI Accelerator Model to allow for function calling later this year.

So in the meantime, you will need to inline your routines, either automatically using compiler optimisation, or manually. For help on automatic Inlining into accelerator regions, you may find this post helpful: https://www.pgroup.com/userforum/viewtopic.php?t=2984

Quote:
If use a code box how does one make a code box?
Three ways.
1) Press the "Code" button (the fifth one from the left) to open the tag. Type in your code. Then press "Code" again to close the tag.
2) Type in your code and then highlight it using your mouse. Press the "Code" button. This will put in both an open and close tag.
3) Manually type the open tag "[ code ]" and close tag "[ /code ]" surrounding your code. (Note remove the extra spaces in the tags and the quotes around the tags. I needed to put them in so the forum didn't make a code box.).

Hope this helps,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling 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