IPA optimization using OMP offload

Dear Nvidia developers,

I’m using NVHPC/21.5-GCC-10.3.0 and I’m trying to enable IPa optimization im my code that uses OMP offload:

FFLAGS=“-mp=gpu -Mipa=acc -Mcuda=cc80 -mcmodel=medium -Minfo=all -Mvect=levels:5”
CFLAGS=“-mp=gpu -Mipa=acc -Mcuda=cc80 -mcmodel=medium -Minfo=all -Mvect=levels:5”

having a lot of warning like:

ipa: file bdry.o, line 1900: unknown flag F in line FUNCA FvQiQiQiQiQiQiQiQiQiQi_ facind_omp_, kx1, kx2, ky1, ky2, kz1, kz2, nx, ny, nz, iface

ipa: file math.o, line 2883: unknown flag _ in line FUNCA FvQA?dQdQi_ cfill_vec_, a, b, n

ipa: file gs_local.o, line 2212: unknown variable reference: &3&1545

The compilation ends well, but does it means the IPA are not working? Thanks.

Correct. IPA hasn’t been available since we make the switch to using LLVM for our back-end code. It needed to be rework pretty much from scratch but other projects, such as OpenMP Target Offload, were deemed much higher priority. It’s on our list to bring back, but no ETA as of yet.

Is IPA for OpenMP offload still work in progress? If possible, I would like to inline functions with OpenMP declare target directive across compilation units.

Rasmus

Hi Rasmus,

While not specific to OpenMP, you can try using the two pass method for cross-file inlining. First compile all code using the flag “-Mextract=lib:libname”, replacing “libname” with a name of your choosing. This creates an inline library of all the functions. Then recompile the code using the flag “-Minline=lib:libname” to have the compiler then use this information to inline.

This is what IPA did, i.e. perform the extract during the initial compilation and then use this info during the link time recompilation. While the two pass method is a bit more cumbersome, the effect is the same.

The inline phase comes before OpenMP is applied. Also, depending on the code, the compiler may or may not be able to apply inlining to particular routines. Be sure to add the flag “-Minfo=inline” so you can see which routines are getting inlined and you may need to add additional sub-options to -Minline, such as “reshape” if this is a Fortran code.

Hope this helps,
Mat