]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp: Document 'GOMP_teams4'
authorThomas Schwinge <tschwinge@baylibre.com>
Tue, 16 Jul 2024 15:09:38 +0000 (17:09 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Fri, 19 Jul 2024 19:55:47 +0000 (21:55 +0200)
For reference:

  - <https://inbox.sourceware.org/20211111190313.GV2710@tucnak> "[PATCH] openmp: Honor OpenMP 5.1 num_teams lower bound"
  - <https://inbox.sourceware.org/20211112132023.GC2710@tucnak> "[PATCH] libgomp, nvptx: Honor OpenMP 5.1 num_teams lower bound"

libgomp/
* config/gcn/target.c (GOMP_teams4): Document.
* config/nvptx/target.c (GOMP_teams4): Likewise.
* target.c (GOMP_teams4): Likewise.

libgomp/config/gcn/target.c
libgomp/config/nvptx/target.c
libgomp/target.c

index e57d2e5f93f17a858967e209bfd4cacb0edb9db5..9cafea4e2cc78a0b3b00623af541455e28cca486 100644 (file)
 
 extern volatile struct gomp_offload_icvs GOMP_ADDITIONAL_ICVS;
 
+/* Implement OpenMP 'teams' construct.
+
+   Initialize upon FIRST call.  Return whether this invocation is active.
+   Depending on whether NUM_TEAMS_LOWER asks for more teams than are provided
+   in hardware, we may need to loop multiple times; in that case make sure to
+   update the team-level variable used by 'omp_get_team_num', as we then can't
+   just use '__builtin_gcn_dim_pos (0)'.  */
+
 bool
 GOMP_teams4 (unsigned int num_teams_lower, unsigned int num_teams_upper,
             unsigned int thread_limit, bool first)
index f14dcfc8ff6a3bc21b1119838020d44907460d2b..8d4dc5f661a2b23765bd4dfadd87a427e2f98de8 100644 (file)
@@ -31,6 +31,14 @@ extern int __gomp_team_num __attribute__((shared));
 extern volatile struct gomp_offload_icvs GOMP_ADDITIONAL_ICVS;
 volatile struct rev_offload *GOMP_REV_OFFLOAD_VAR;
 
+/* Implement OpenMP 'teams' construct.
+
+   Initialize upon FIRST call.  Return whether this invocation is active.
+   Depending on whether NUM_TEAMS_LOWER asks for more teams than are provided
+   in hardware, we may need to loop multiple times; in that case make sure to
+   update the team-level variable used by 'omp_get_team_num', as we then can't
+   just use '%ctaid.x'.  */
+
 bool
 GOMP_teams4 (unsigned int num_teams_lower, unsigned int num_teams_upper,
             unsigned int thread_limit, bool first)
index 48689920d4a3e60533ea1b377fab7ab1fa545fa7..aa01c1367b986bb03170f40638b5b2aaa893c7ec 100644 (file)
@@ -4352,6 +4352,8 @@ gomp_target_task_fn (void *data)
   return false;
 }
 
+/* Implement OpenMP 'teams' construct, legacy entry point.  */
+
 void
 GOMP_teams (unsigned int num_teams, unsigned int thread_limit)
 {
@@ -4364,6 +4366,13 @@ GOMP_teams (unsigned int num_teams, unsigned int thread_limit)
   (void) num_teams;
 }
 
+/* Implement OpenMP 'teams' construct.
+
+   Initialize upon FIRST call.  Return whether this invocation is active.
+   Depending on whether NUM_TEAMS_LOW asks for more teams than are provided
+   in hardware, we may need to loop multiple times; in that case make sure to
+   update the team-level variable used by 'omp_get_team_num'.  */
+
 bool
 GOMP_teams4 (unsigned int num_teams_low, unsigned int num_teams_high,
             unsigned int thread_limit, bool first)