[Openmp-commits] [PATCH] D104710: [OpenMP] Introduce an CMake find module for OpenMP Target support

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jun 22 10:37:10 PDT 2021


ye-luo added a comment.

Is this intended for libomptarget only or even to take care other offload runtime libraries?
if it is the former case, It needs to be renamed as FindLibOMPTarget to be specific about libomptarget.
If it is the later case, please upstream it to CMake directly.

User code may want to defined either own OpenMPTarget target and alias it to the target created by this module if they use libomptarget or define others if other vendor OpenMP offload runtime library is used.

OpenMP is both a language extension and library, creating a cmake module is a challenge.



================
Comment at: openmp/tools/Modules/FindOpenMPTarget.cmake:62
+
+The module will also try to provide the OpenMP version variables:
+
----------------
I don't quite follow what is `OpenMP version` especially the device specific one.
As vendors usually only implement a subset, users should not rely on OpenMP spec version anyway.
If they really need it, just invoke FindOpenMP themselves. RIght now it is an illusion there is a separate OpenMPTarget_VERSION


================
Comment at: openmp/tools/Modules/FindOpenMPTarget.cmake:99
+    set(OMPTarget_FLAG_XL "-qoffload")
+    set(OMPTarget_FLAG_PGI "-mp=${DEVICE}")
+
----------------
FLAGS, plural because you might need multiple flags.

Use NVHPC instead of PGI, the correct flag is -mp=gpu
does -mp=${DEVICE} work

GNU offload to NVIDIA is -foffload=nvptx-none
does -foffload=${DEVICE} work?



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104710/new/

https://reviews.llvm.org/D104710



More information about the Openmp-commits mailing list