aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2021-11-15 15:44:11 +0100
committerTobias Burnus <tobias@codesourcery.com>2021-11-15 15:44:11 +0100
commit82ec4cb3c43c7429be6b902d96770a6435fa068b (patch)
tree9cb809e747eb18bdd4f07def4fb5178d775fce71 /gcc
parentb2e1ac548594c5f482b6e9e9cfa25f9cc090bf84 (diff)
downloadgcc-82ec4cb3c43c7429be6b902d96770a6435fa068b.zip
gcc-82ec4cb3c43c7429be6b902d96770a6435fa068b.tar.gz
gcc-82ec4cb3c43c7429be6b902d96770a6435fa068b.tar.bz2
Fortran: openmp: Add support for thread_limit clause on target
gcc/fortran/ChangeLog: * openmp.c (OMP_TARGET_CLAUSES): Add thread_limit. * trans-openmp.c (gfc_split_omp_clauses): Add thread_limit also to teams. libgomp/ChangeLog: * testsuite/libgomp.fortran/thread-limit-1.f90: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/openmp.c3
-rw-r--r--gcc/fortran/trans-openmp.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 2893ab2..d120be8 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -3563,7 +3563,8 @@ cleanup:
(omp_mask (OMP_CLAUSE_DEVICE) | OMP_CLAUSE_MAP | OMP_CLAUSE_IF \
| OMP_CLAUSE_DEPEND | OMP_CLAUSE_NOWAIT | OMP_CLAUSE_PRIVATE \
| OMP_CLAUSE_FIRSTPRIVATE | OMP_CLAUSE_DEFAULTMAP \
- | OMP_CLAUSE_IS_DEVICE_PTR | OMP_CLAUSE_IN_REDUCTION)
+ | OMP_CLAUSE_IS_DEVICE_PTR | OMP_CLAUSE_IN_REDUCTION \
+ | OMP_CLAUSE_THREAD_LIMIT)
#define OMP_TARGET_DATA_CLAUSES \
(omp_mask (OMP_CLAUSE_DEVICE) | OMP_CLAUSE_MAP | OMP_CLAUSE_IF \
| OMP_CLAUSE_USE_DEVICE_PTR | OMP_CLAUSE_USE_DEVICE_ADDR)
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index b86c7cf..5b3c310 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -5870,6 +5870,8 @@ gfc_split_omp_clauses (gfc_code *code,
= code->ext.omp_clauses->lists[OMP_LIST_IS_DEVICE_PTR];
clausesa[GFC_OMP_SPLIT_TARGET].device
= code->ext.omp_clauses->device;
+ clausesa[GFC_OMP_SPLIT_TARGET].thread_limit
+ = code->ext.omp_clauses->thread_limit;
for (int i = 0; i < OMP_DEFAULTMAP_CAT_NUM; i++)
clausesa[GFC_OMP_SPLIT_TARGET].defaultmap[i]
= code->ext.omp_clauses->defaultmap[i];