|
| View previous topic :: View next topic |
| Author |
Message |
anirbanjana
Joined: 11 Aug 2012 Posts: 1
|
Posted: Tue Feb 12, 2013 6:36 am Post subject: Kernel code not generated because function not inlined |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Tue Feb 12, 2013 11:14 am Post subject: |
|
|
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 |
|
 |
|
|
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
|