function or procedure calls are not allowed

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.


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

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: function/procedure calls not supported

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