summaryrefslogtreecommitdiff
path: root/libgomp/parallel.c
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2020-09-29 10:15:04 +0100
committerAndrew Stubbs <ams@codesourcery.com>2020-09-30 17:37:31 +0100
commit091ddcc1b2199cdf8146fb00cf55ef9162e237b9 (patch)
tree0e0c136ad5e5e5c7bc8224bd0fd7e3a081e7c6f2 /libgomp/parallel.c
parentecd700c1bc6b4da70a439ac233f1515131c29f86 (diff)
libgomp: Enforce 1-thread limit in subteams
Accelerators with fixed thread-counts will break if nested teams are expected to have multiple threads each. libgomp/ChangeLog: 2020-09-29 Andrew Stubbs <ams@codesourcery.com> * parallel.c (gomp_resolve_num_threads): Ignore nest_var on nvptx and amdgcn targets.
Diffstat (limited to 'libgomp/parallel.c')
-rw-r--r--libgomp/parallel.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libgomp/parallel.c b/libgomp/parallel.c
index 2423f11f44a..2fe4f573a32 100644
--- a/libgomp/parallel.c
+++ b/libgomp/parallel.c
@@ -48,7 +48,14 @@ gomp_resolve_num_threads (unsigned specified, unsigned count)
if (specified == 1)
return 1;
- else if (thr->ts.active_level >= 1 && !icv->nest_var)
+
+ if (thr->ts.active_level >= 1
+ /* Accelerators with fixed thread counts require this to return 1 for
+ nested parallel regions. */
+#if !defined(__AMDGCN__) && !defined(__nvptx__)
+ && !icv->nest_var
+#endif
+ )
return 1;
else if (thr->ts.active_level >= gomp_max_active_levels_var)
return 1;