-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Flang][OpenMP] Enables parsing of threadset clause #169856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@llvm/pr-subscribers-flang-semantics @llvm/pr-subscribers-flang-fir-hlfir Author: Anchu Rajendran S (anchuraj) ChangesEnables parsing support for Full diff: https://github.com/llvm/llvm-project/pull/169856.diff 5 Files Affected:
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index e2da60ed19de8..45abcc13be267 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -1168,6 +1168,10 @@ TYPE_PARSER(construct<OmpTaskReductionClause>(
TYPE_PARSER(construct<OmpTransparentClause>(scalarIntExpr))
+TYPE_PARSER(construct<OmpThreadsetClause>(
+ "omp_pool" >> pure(OmpThreadsetClause::ThreadsetPolicy::Omp_Pool) ||
+ "omp_team" >> pure(OmpThreadsetClause::ThreadsetPolicy::Omp_Team)))
+
// OMP 5.0 2.11.4 allocate-clause -> ALLOCATE ([allocator:] variable-name-list)
// OMP 5.2 2.13.4 allocate-clause -> ALLOCATE ([allocate-modifier
// [, allocate-modifier] :]
@@ -1519,7 +1523,9 @@ TYPE_PARSER( //
parenthesized(nonemptyList(scalarIntExpr)))) ||
"PERMUTATION" >> construct<OmpClause>(construct<OmpClause::Permutation>(
parenthesized(nonemptyList(scalarIntExpr)))) ||
- "THREADS" >> construct<OmpClause>(construct<OmpClause::Threads>()) ||
+ "THREADS"_id >> construct<OmpClause>(construct<OmpClause::Threads>()) ||
+ "THREADSET" >> construct<OmpClause>(construct<OmpClause::Threadset>(
+ parenthesized(Parser<OmpThreadsetClause>{}))) ||
"THREAD_LIMIT" >> construct<OmpClause>(construct<OmpClause::ThreadLimit>(
parenthesized(scalarIntExpr))) ||
"TO" >> construct<OmpClause>(construct<OmpClause::To>(
diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp
index f81200d092b11..2a6d389e8ecf9 100644
--- a/flang/lib/Parser/unparse.cpp
+++ b/flang/lib/Parser/unparse.cpp
@@ -2789,6 +2789,7 @@ class UnparseVisitor {
WALK_NESTED_ENUM(OmpTaskDependenceType, Value) // OMP task-dependence-type
WALK_NESTED_ENUM(OmpScheduleClause, Kind) // OMP schedule-kind
WALK_NESTED_ENUM(OmpSeverityClause, Severity) // OMP severity
+ WALK_NESTED_ENUM(OmpThreadsetClause, ThreadsetPolicy) // OMP threadset
WALK_NESTED_ENUM(OmpAccessGroup, Value)
WALK_NESTED_ENUM(OmpDeviceModifier, Value) // OMP device modifier
WALK_NESTED_ENUM(
diff --git a/flang/test/Lower/OpenMP/Todo/threadset.f90 b/flang/test/Lower/OpenMP/Todo/threadset.f90
new file mode 100644
index 0000000000000..b022baf02654b
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/threadset.f90
@@ -0,0 +1,10 @@
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=60 -o - %s 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: THREADSET clause is not implemented yet
+
+subroutine f00(x)
+ integer :: x(10)
+ !$omp task threadset(omp_pool)
+ x = x + 1
+ !$omp end task
+end
diff --git a/flang/test/Parser/OpenMP/threadset-clause.f90 b/flang/test/Parser/OpenMP/threadset-clause.f90
new file mode 100644
index 0000000000000..dfd27aace1ed1
--- /dev/null
+++ b/flang/test/Parser/OpenMP/threadset-clause.f90
@@ -0,0 +1,79 @@
+!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=60 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
+!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=60 %s | FileCheck --check-prefix="PARSE-TREE" %s
+
+subroutine f00(x)
+ integer :: x(10)
+!$omp task threadset(omp_pool)
+ x = x + 1
+!$omp end task
+end
+
+!UNPARSE: SUBROUTINE f00 (x)
+!UNPARSE: INTEGER x(10_4)
+!UNPARSE: !$OMP TASK THREADSET(OMP_POOL)
+!UNPARSE: x=x+1_4
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = task
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Pool
+
+subroutine f001(x)
+ integer :: x(10)
+!$omp task threadset(omp_team)
+ x = x + 1
+!$omp end task
+end
+
+!UNPARSE: SUBROUTINE f001 (x)
+!UNPARSE: INTEGER x(10_4)
+!UNPARSE: !$OMP TASK THREADSET(OMP_TEAM)
+!UNPARSE: x=x+1_4
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = task
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Team
+
+
+subroutine f002(x)
+ integer :: i
+!$omp taskloop threadset(omp_team)
+ do i = 1, 10
+ end do
+!$omp end taskloop
+end
+
+!UNPARSE: SUBROUTINE f002 (x)
+!UNPARSE: INTEGER i
+!UNPARSE: !$OMP TASKLOOP THREADSET(OMP_TEAM)
+!UNPARSE: DO i=1_4,10_4
+!UNPARSE: END DO
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = taskloop
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Team
+
+subroutine f003(x)
+ integer :: i
+!$omp taskloop threadset(omp_team)
+ do i = 1, 10
+ end do
+!$omp end taskloop
+end
+
+!UNPARSE: SUBROUTINE f003 (x)
+!UNPARSE: INTEGER i
+!UNPARSE: !$OMP TASKLOOP THREADSET(OMP_POOL)
+!UNPARSE: DO i=1_4,10_4
+!UNPARSE: END DO
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = taskloop
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Pool
diff --git a/flang/test/Semantics/OpenMP/threadset-clause.f90 b/flang/test/Semantics/OpenMP/threadset-clause.f90
new file mode 100644
index 0000000000000..59cd3ef503bd9
--- /dev/null
+++ b/flang/test/Semantics/OpenMP/threadset-clause.f90
@@ -0,0 +1,9 @@
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=45
+
+subroutine f00(x)
+ integer :: x(10)
+!ERROR: THREADSET clause is not allowed on directive TASK in OpenMP v4.5, try -fopenmp-version=60
+!$omp task threadset(omp_pool)
+ x = x + 1
+!$omp end task
+end
|
|
@llvm/pr-subscribers-flang-openmp Author: Anchu Rajendran S (anchuraj) ChangesEnables parsing support for Full diff: https://github.com/llvm/llvm-project/pull/169856.diff 5 Files Affected:
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index e2da60ed19de8..45abcc13be267 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -1168,6 +1168,10 @@ TYPE_PARSER(construct<OmpTaskReductionClause>(
TYPE_PARSER(construct<OmpTransparentClause>(scalarIntExpr))
+TYPE_PARSER(construct<OmpThreadsetClause>(
+ "omp_pool" >> pure(OmpThreadsetClause::ThreadsetPolicy::Omp_Pool) ||
+ "omp_team" >> pure(OmpThreadsetClause::ThreadsetPolicy::Omp_Team)))
+
// OMP 5.0 2.11.4 allocate-clause -> ALLOCATE ([allocator:] variable-name-list)
// OMP 5.2 2.13.4 allocate-clause -> ALLOCATE ([allocate-modifier
// [, allocate-modifier] :]
@@ -1519,7 +1523,9 @@ TYPE_PARSER( //
parenthesized(nonemptyList(scalarIntExpr)))) ||
"PERMUTATION" >> construct<OmpClause>(construct<OmpClause::Permutation>(
parenthesized(nonemptyList(scalarIntExpr)))) ||
- "THREADS" >> construct<OmpClause>(construct<OmpClause::Threads>()) ||
+ "THREADS"_id >> construct<OmpClause>(construct<OmpClause::Threads>()) ||
+ "THREADSET" >> construct<OmpClause>(construct<OmpClause::Threadset>(
+ parenthesized(Parser<OmpThreadsetClause>{}))) ||
"THREAD_LIMIT" >> construct<OmpClause>(construct<OmpClause::ThreadLimit>(
parenthesized(scalarIntExpr))) ||
"TO" >> construct<OmpClause>(construct<OmpClause::To>(
diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp
index f81200d092b11..2a6d389e8ecf9 100644
--- a/flang/lib/Parser/unparse.cpp
+++ b/flang/lib/Parser/unparse.cpp
@@ -2789,6 +2789,7 @@ class UnparseVisitor {
WALK_NESTED_ENUM(OmpTaskDependenceType, Value) // OMP task-dependence-type
WALK_NESTED_ENUM(OmpScheduleClause, Kind) // OMP schedule-kind
WALK_NESTED_ENUM(OmpSeverityClause, Severity) // OMP severity
+ WALK_NESTED_ENUM(OmpThreadsetClause, ThreadsetPolicy) // OMP threadset
WALK_NESTED_ENUM(OmpAccessGroup, Value)
WALK_NESTED_ENUM(OmpDeviceModifier, Value) // OMP device modifier
WALK_NESTED_ENUM(
diff --git a/flang/test/Lower/OpenMP/Todo/threadset.f90 b/flang/test/Lower/OpenMP/Todo/threadset.f90
new file mode 100644
index 0000000000000..b022baf02654b
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/threadset.f90
@@ -0,0 +1,10 @@
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=60 -o - %s 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: THREADSET clause is not implemented yet
+
+subroutine f00(x)
+ integer :: x(10)
+ !$omp task threadset(omp_pool)
+ x = x + 1
+ !$omp end task
+end
diff --git a/flang/test/Parser/OpenMP/threadset-clause.f90 b/flang/test/Parser/OpenMP/threadset-clause.f90
new file mode 100644
index 0000000000000..dfd27aace1ed1
--- /dev/null
+++ b/flang/test/Parser/OpenMP/threadset-clause.f90
@@ -0,0 +1,79 @@
+!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=60 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
+!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=60 %s | FileCheck --check-prefix="PARSE-TREE" %s
+
+subroutine f00(x)
+ integer :: x(10)
+!$omp task threadset(omp_pool)
+ x = x + 1
+!$omp end task
+end
+
+!UNPARSE: SUBROUTINE f00 (x)
+!UNPARSE: INTEGER x(10_4)
+!UNPARSE: !$OMP TASK THREADSET(OMP_POOL)
+!UNPARSE: x=x+1_4
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = task
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Pool
+
+subroutine f001(x)
+ integer :: x(10)
+!$omp task threadset(omp_team)
+ x = x + 1
+!$omp end task
+end
+
+!UNPARSE: SUBROUTINE f001 (x)
+!UNPARSE: INTEGER x(10_4)
+!UNPARSE: !$OMP TASK THREADSET(OMP_TEAM)
+!UNPARSE: x=x+1_4
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = task
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Team
+
+
+subroutine f002(x)
+ integer :: i
+!$omp taskloop threadset(omp_team)
+ do i = 1, 10
+ end do
+!$omp end taskloop
+end
+
+!UNPARSE: SUBROUTINE f002 (x)
+!UNPARSE: INTEGER i
+!UNPARSE: !$OMP TASKLOOP THREADSET(OMP_TEAM)
+!UNPARSE: DO i=1_4,10_4
+!UNPARSE: END DO
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = taskloop
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Team
+
+subroutine f003(x)
+ integer :: i
+!$omp taskloop threadset(omp_team)
+ do i = 1, 10
+ end do
+!$omp end taskloop
+end
+
+!UNPARSE: SUBROUTINE f003 (x)
+!UNPARSE: INTEGER i
+!UNPARSE: !$OMP TASKLOOP THREADSET(OMP_POOL)
+!UNPARSE: DO i=1_4,10_4
+!UNPARSE: END DO
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = taskloop
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Pool
diff --git a/flang/test/Semantics/OpenMP/threadset-clause.f90 b/flang/test/Semantics/OpenMP/threadset-clause.f90
new file mode 100644
index 0000000000000..59cd3ef503bd9
--- /dev/null
+++ b/flang/test/Semantics/OpenMP/threadset-clause.f90
@@ -0,0 +1,9 @@
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=45
+
+subroutine f00(x)
+ integer :: x(10)
+!ERROR: THREADSET clause is not allowed on directive TASK in OpenMP v4.5, try -fopenmp-version=60
+!$omp task threadset(omp_pool)
+ x = x + 1
+!$omp end task
+end
|
|
@llvm/pr-subscribers-flang-parser Author: Anchu Rajendran S (anchuraj) ChangesEnables parsing support for Full diff: https://github.com/llvm/llvm-project/pull/169856.diff 5 Files Affected:
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index e2da60ed19de8..45abcc13be267 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -1168,6 +1168,10 @@ TYPE_PARSER(construct<OmpTaskReductionClause>(
TYPE_PARSER(construct<OmpTransparentClause>(scalarIntExpr))
+TYPE_PARSER(construct<OmpThreadsetClause>(
+ "omp_pool" >> pure(OmpThreadsetClause::ThreadsetPolicy::Omp_Pool) ||
+ "omp_team" >> pure(OmpThreadsetClause::ThreadsetPolicy::Omp_Team)))
+
// OMP 5.0 2.11.4 allocate-clause -> ALLOCATE ([allocator:] variable-name-list)
// OMP 5.2 2.13.4 allocate-clause -> ALLOCATE ([allocate-modifier
// [, allocate-modifier] :]
@@ -1519,7 +1523,9 @@ TYPE_PARSER( //
parenthesized(nonemptyList(scalarIntExpr)))) ||
"PERMUTATION" >> construct<OmpClause>(construct<OmpClause::Permutation>(
parenthesized(nonemptyList(scalarIntExpr)))) ||
- "THREADS" >> construct<OmpClause>(construct<OmpClause::Threads>()) ||
+ "THREADS"_id >> construct<OmpClause>(construct<OmpClause::Threads>()) ||
+ "THREADSET" >> construct<OmpClause>(construct<OmpClause::Threadset>(
+ parenthesized(Parser<OmpThreadsetClause>{}))) ||
"THREAD_LIMIT" >> construct<OmpClause>(construct<OmpClause::ThreadLimit>(
parenthesized(scalarIntExpr))) ||
"TO" >> construct<OmpClause>(construct<OmpClause::To>(
diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp
index f81200d092b11..2a6d389e8ecf9 100644
--- a/flang/lib/Parser/unparse.cpp
+++ b/flang/lib/Parser/unparse.cpp
@@ -2789,6 +2789,7 @@ class UnparseVisitor {
WALK_NESTED_ENUM(OmpTaskDependenceType, Value) // OMP task-dependence-type
WALK_NESTED_ENUM(OmpScheduleClause, Kind) // OMP schedule-kind
WALK_NESTED_ENUM(OmpSeverityClause, Severity) // OMP severity
+ WALK_NESTED_ENUM(OmpThreadsetClause, ThreadsetPolicy) // OMP threadset
WALK_NESTED_ENUM(OmpAccessGroup, Value)
WALK_NESTED_ENUM(OmpDeviceModifier, Value) // OMP device modifier
WALK_NESTED_ENUM(
diff --git a/flang/test/Lower/OpenMP/Todo/threadset.f90 b/flang/test/Lower/OpenMP/Todo/threadset.f90
new file mode 100644
index 0000000000000..b022baf02654b
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/threadset.f90
@@ -0,0 +1,10 @@
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=60 -o - %s 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: THREADSET clause is not implemented yet
+
+subroutine f00(x)
+ integer :: x(10)
+ !$omp task threadset(omp_pool)
+ x = x + 1
+ !$omp end task
+end
diff --git a/flang/test/Parser/OpenMP/threadset-clause.f90 b/flang/test/Parser/OpenMP/threadset-clause.f90
new file mode 100644
index 0000000000000..dfd27aace1ed1
--- /dev/null
+++ b/flang/test/Parser/OpenMP/threadset-clause.f90
@@ -0,0 +1,79 @@
+!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=60 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
+!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=60 %s | FileCheck --check-prefix="PARSE-TREE" %s
+
+subroutine f00(x)
+ integer :: x(10)
+!$omp task threadset(omp_pool)
+ x = x + 1
+!$omp end task
+end
+
+!UNPARSE: SUBROUTINE f00 (x)
+!UNPARSE: INTEGER x(10_4)
+!UNPARSE: !$OMP TASK THREADSET(OMP_POOL)
+!UNPARSE: x=x+1_4
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = task
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Pool
+
+subroutine f001(x)
+ integer :: x(10)
+!$omp task threadset(omp_team)
+ x = x + 1
+!$omp end task
+end
+
+!UNPARSE: SUBROUTINE f001 (x)
+!UNPARSE: INTEGER x(10_4)
+!UNPARSE: !$OMP TASK THREADSET(OMP_TEAM)
+!UNPARSE: x=x+1_4
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = task
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Team
+
+
+subroutine f002(x)
+ integer :: i
+!$omp taskloop threadset(omp_team)
+ do i = 1, 10
+ end do
+!$omp end taskloop
+end
+
+!UNPARSE: SUBROUTINE f002 (x)
+!UNPARSE: INTEGER i
+!UNPARSE: !$OMP TASKLOOP THREADSET(OMP_TEAM)
+!UNPARSE: DO i=1_4,10_4
+!UNPARSE: END DO
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = taskloop
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Team
+
+subroutine f003(x)
+ integer :: i
+!$omp taskloop threadset(omp_team)
+ do i = 1, 10
+ end do
+!$omp end taskloop
+end
+
+!UNPARSE: SUBROUTINE f003 (x)
+!UNPARSE: INTEGER i
+!UNPARSE: !$OMP TASKLOOP THREADSET(OMP_POOL)
+!UNPARSE: DO i=1_4,10_4
+!UNPARSE: END DO
+!UNPARSE: !$OMP END TASK
+!UNPARSE: END SUBROUTINE
+
+!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = taskloop
+!PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Pool
diff --git a/flang/test/Semantics/OpenMP/threadset-clause.f90 b/flang/test/Semantics/OpenMP/threadset-clause.f90
new file mode 100644
index 0000000000000..59cd3ef503bd9
--- /dev/null
+++ b/flang/test/Semantics/OpenMP/threadset-clause.f90
@@ -0,0 +1,9 @@
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=45
+
+subroutine f00(x)
+ integer :: x(10)
+!ERROR: THREADSET clause is not allowed on directive TASK in OpenMP v4.5, try -fopenmp-version=60
+!$omp task threadset(omp_pool)
+ x = x + 1
+!$omp end task
+end
|
🐧 Linux x64 Test Results
|
kparzysz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
flang/lib/Parser/openmp-parsers.cpp
Outdated
| "omp_pool" >> pure(OmpThreadsetClause::ThreadsetPolicy::Omp_Pool) || | ||
| "omp_team" >> pure(OmpThreadsetClause::ThreadsetPolicy::Omp_Team))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention is to spell the source names in all capitals, e.g. OMP_POOL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Thank you for reviewing!
09ecc8e to
0871074
Compare
0871074 to
8245129
Compare
Enables parsing support for
threadsetclause in OpenMP. Initial support was added in #135807