[Openmp-commits] [PATCH] D111905: [OpenMP][deviceRTLs] Fix wrong return value of `__kmpc_is_spmd_exec_mode`

Carlo Bertolli via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Oct 15 13:02:08 PDT 2021


carlo.bertolli accepted this revision.
carlo.bertolli added a comment.
This revision is now accepted and ready to land.

LGTM.

Thanks for fixing this. It would be nice if you could add a comment where it is used at the beginning of parallel_51, stating what are the initial value of parallelLevel (__kmpc_parallel_level) and those of __kmpc_is_spmd_exec_mode in the two cases of generic and spmd modes (assuming generic spmd mode is handled as a spmd). Something like:

- In SPMD mode, parallelLevel (queried by __kmpc_parallel_level()) is set to 1 at kernel initialization. __kmpc_is_spmd_exec_mode returns 1: we will need to serialize a nested parallel region only when we increment parallelLevel by one (value will be 2) when encountering the nested region.

- In generic mode, parallelLevel is set to 0 at kernel initialization. kmpc_Is_spmd_exec_mode returns 0 in this case: we will need to serialized a nested parallel region only when we increment parallelLevel by one (value will be 1) when encountering the nested region.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111905



More information about the Openmp-commits mailing list