restriction on inlined function


Is there any restriction on function which could be inlined?

I would like to inline some routine into kernel body. I add “-Minline=foo” option to compiler, but it says

571, Accelerator region ignored
575, Accelerator restriction: function/procedure calls are not supported
601, Accelerator restriction: unsupported call to foo'


Hi Alexey,

Inlining is a big topic so I’ll first point you to Chapter 4 of the PGI Compiler User’s Guide. It does have a section on inlining restrictions.

Note “-Minfo=inline” might give you details on why a routine was not inlined. Though, this only is printed if the compiler attempted to inline the function but failed.

Also, if “foo” is not in the same source file, you will need to first create an inline library using the “-Mextract” flag (see docs for details).

Hope this helps,

Hi Mat!

It’s help, but I still have some questions.
PGI reports that reshaping is not allowed… but I doesn’t reshape arrays

601, subprogram not inlined -- array reshaping not enabled: foo, argument 1

 519       REAL, DIMENSION(kts:kte):: &
 520                           qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
 601          call foo(qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
 752       subroutine foo (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
 758       REAL, DIMENSION(kts:kte), INTENT(INOUT):: &
 759                           qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &

Any idea?

Is “kts” a variable? That would cause a reshape since the compiler can’t tell the actual and dummy argument’s lower bounds are the same.

You can try adding the flag “-Minline=reshape” to get the compiler to inline this routine.

  • Mat