[Openmp-commits] [PATCH] D95820: [OpenMP] Add bounds to num_teams clause (OpenMP 5.1)

Nawrin Sultana via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 2 14:49:23 PST 2021


Nawrin added inline comments.


================
Comment at: openmp/runtime/src/kmp_runtime.cpp:7537
+      num_teams = __kmp_teams_max_nth;
+    }
+  } else if (num_teams_lb == num_teams_ub) { // required exact number of teams
----------------
jdoerfert wrote:
> IIRC, this is not correct anymore in 5.1. We cannot cap the number of teams. We need to implement a loop if the number of physical teams is smaller than the number requested teams to basically emulate as many as have been requested.
According to the spec, when num_teams clause is not present, the number of teams created should be implementation defined, but it will be greater or equal to 1.

5.1 spec - "If the num_teams clause is not specified and the value of the nteams-var ICV is greater than zero, the number of teams created is less or equal to the value of the nteams-var ICV. Otherwise, the number of teams created is implementation defined, but it will be greater than or equal to 1."


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95820



More information about the Openmp-commits mailing list