[Openmp-commits] [openmp] [OpenMP][DeviceRTL] implemented nteams-var ICV, omp_get_max_teams(), and omp_set_num_teams() (PR #71259)

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Mon Dec 4 11:09:24 PST 2023


================
@@ -424,6 +425,14 @@ int omp_get_num_teams(void) { return mapping::getNumberOfBlocksInKernel(); }
 
 int omp_get_team_num() { return mapping::getBlockIdInKernel(); }
 
+int omp_get_max_teams(void) { return icv::NTeams; }
+
+void omp_set_num_teams(int V) {
+  icv::NTeams = (V < 0)                        ? 0
+                : (V >= config::getMaxTeams()) ? config::getMaxTeams()
+                                               : V;
----------------
jdoerfert wrote:

Ignore negative inputs.

https://github.com/llvm/llvm-project/pull/71259


More information about the Openmp-commits mailing list