PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Kernel code not generated because function not inlined

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
anirbanjana



Joined: 11 Aug 2012
Posts: 28

PostPosted: Tue Feb 12, 2013 6:36 am    Post subject: Kernel code not generated because function not inlined Reply with quote

Hi,
I am working on porting a large science code (MFIX) to GPUs using pgf90 (v13.1) and OpenACC. For a portion of the code, kernel code is not generated because I suspect a subroutine within it is not being inlined. The compiler also does not provide any details why it is not being inlined (assuming that is true).

The subroutine is (in file des_functions.f)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Code:
     
      SUBROUTINE DES_CROSSPRDCT_3D(AA, XX,YY)

      IMPLICIT NONE
      DOUBLE PRECISION AA(3), XX(3), YY(3)

      AA(1) = XX(2)*YY(3) - XX(3)*YY(2)
      AA(2) = XX(3)*YY(1) - XX(1)*YY(3)
      AA(3) = XX(1)*YY(2) - XX(2)*YY(1)

      RETURN
      END SUBROUTINE DES_CROSSPRDCT_3D


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The call to it is (Line 469 in calc_force_des.f):

Code:

...
468  IF(DIMN.EQ.3) THEN
469        CALL DES_CROSSPRDCT_3D(V_ROT, OMEGA_SUM, NORMAL)
470   ELSE
...


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The compilation command is

pgf90 -O -Mdalign -acc -ta=nvidia,time -Minfo=inline,accel -Mipa=inline -Munixlogical -c -I. -Mnosave -Mfreeform -Mrecursive -Mreentrant -byteswapio -Minline=name:des_crossprdct_2d,name:des_crossprdct_3d ./des/calc_force_des.f

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Excerpts of the compiler output:

PGF90-W-0155-Accelerator region ignored; see -Minfo messages (./des/calc_force_des.f: 404)
...
404, Accelerator region ignored
414, Accelerator restriction: function/procedure calls are not supported
469, Accelerator restriction: unsupported call to 'des_crossprdct_3d'


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Note: Line 414 is the beginning of the DO LOOP that contains the above subroutine call.

I can provide more details/access to the code as necessary.

Thanks very much in advance for the help
Anirban
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Feb 12, 2013 11:14 am    Post subject: Reply with quote

Hi Anirban,

Is the Minfo message when you first compile calc_force_des.f? Since des_crossprdct_3d is located in a different file, the "-Minline" wont be able to inline it.

Since you have "-Mipa=inline" enabled, does the routine get inlined during the IPA recompilation step?

I find the better method when porting code to OpenACC, is to first create an extract library (-Mextract). Then -Minline can use this library to get the definition for "des_crossprdct_3d" during the first pass of compilation.

Another option is to compile "calc_force_des.f" and "des_functions.f" on the same compilation line so that -Minline can see "des_crossprdct_3d".

For full details on Inlining, please refer to Chapter 4 of the PGI Compiler User's Guide.

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