[Openmp-commits] [PATCH] D105955: [NFC][OpenMP][Offloading] Replaced explicit parallel level computation with function `__kmpc_parallel_level`

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 13 18:25:26 PDT 2021


tianshilei1992 added inline comments.


================
Comment at: openmp/libomptarget/deviceRTLs/common/src/libcall.cu:132
 EXTERN int omp_get_level(void) {
-  int level = parallelLevel[GetWarpId()] & (OMP_ACTIVE_PARALLEL_LEVEL - 1);
+  int level = __kmpc_parallel_level(nullptr, 0);
   PRINT(LD_IO, "call omp_get_level() returns %d\n", level);
----------------
Because of the legacy from `libomp`, `__kmpc_parallel_level` takes two arguments: location and gtid, which are completely ignored in the function definition. As a result, we simply pass `nullptr` and `0`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105955



More information about the Openmp-commits mailing list