-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[MLIR][OpenMP]Adding MLIR Op definition for scan #107925
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -503,6 +503,61 @@ class OpenMP_IsDevicePtrClauseSkip< | |||||
|
|
||||||
| def OpenMP_IsDevicePtrClause : OpenMP_IsDevicePtrClauseSkip<>; | ||||||
|
|
||||||
| //===----------------------------------------------------------------------===// | ||||||
| // V5.2: [5.4.7] `inclusive` clause | ||||||
| //===----------------------------------------------------------------------===// | ||||||
|
|
||||||
| class OpenMP_InclusiveClauseSkip< | ||||||
| bit traits = false, bit arguments = false, bit assemblyFormat = false, | ||||||
| bit description = false, bit extraClassDeclaration = false | ||||||
| > : OpenMP_Clause</*isRequired=*/false, traits, arguments, assemblyFormat, | ||||||
| description, extraClassDeclaration> { | ||||||
| let arguments = (ins | ||||||
| Variadic<AnyType>:$inclusive_vars | ||||||
| ); | ||||||
|
|
||||||
| let assemblyFormat = [{ | ||||||
| `inclusive` `(` $inclusive_vars `:` type($inclusive_vars) `)` | ||||||
| }]; | ||||||
|
|
||||||
| let description = [{ | ||||||
| The inclusive clause is used on a separating directive that separates a | ||||||
| structured block into two structured block sequences. If the inclusive | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| clause is specified, the input phase includes the preceding structured block | ||||||
| sequence and the scan phase includes the following structured block sequence. | ||||||
| }]; | ||||||
| } | ||||||
|
|
||||||
| def OpenMP_InclusiveClause : OpenMP_InclusiveClauseSkip<>; | ||||||
|
|
||||||
| //===----------------------------------------------------------------------===// | ||||||
| // V5.2: [5.4.7] `exclusive` clause | ||||||
| //===----------------------------------------------------------------------===// | ||||||
|
|
||||||
| class OpenMP_ExclusiveClauseSkip< | ||||||
| bit traits = false, bit arguments = false, bit assemblyFormat = false, | ||||||
| bit description = false, bit extraClassDeclaration = false | ||||||
| > : OpenMP_Clause</*isRequired=*/false, traits, arguments, assemblyFormat, | ||||||
| description, extraClassDeclaration> { | ||||||
| let arguments = (ins | ||||||
| Variadic<AnyType>:$exclusive_vars | ||||||
| ); | ||||||
|
|
||||||
| let assemblyFormat = [{ | ||||||
| `exclusive` `(` $exclusive_vars `:` type($exclusive_vars) `)` | ||||||
| }]; | ||||||
|
|
||||||
| let description = [{ | ||||||
| The exclusive clause is used on a separating directive that separates a | ||||||
| structured block into two structured block sequences. If the exclusive clause | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| is specified, the input phase excludes the preceding structured block | ||||||
| sequence and instead includes the following structured block sequence, | ||||||
| while the scan phase includes the preceding structured block sequence. | ||||||
| }]; | ||||||
| } | ||||||
|
|
||||||
| def OpenMP_ExclusiveClause : OpenMP_ExclusiveClauseSkip<>; | ||||||
|
|
||||||
| //===----------------------------------------------------------------------===// | ||||||
| // V5.2: [5.4.6] `linear` clause | ||||||
| //===----------------------------------------------------------------------===// | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -1202,6 +1202,20 @@ def OrderedRegionOp : OpenMP_Op<"ordered.region", clauses = [ | |||
| let hasVerifier = 1; | ||||
| } | ||||
|
|
||||
| def ScanOp : OpenMP_Op<"scan", traits = [ | ||||
| AttrSizedOperandSegments | ||||
| ], clauses = [OpenMP_InclusiveClause, OpenMP_ExclusiveClause]> { | ||||
| let summary = "scan construct with the region"; | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be "scan directive"? |
||||
| let description = [{ | ||||
| The scan without region is a stand-alone directive that | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the description is not complete. |
||||
| }] # clausesDescription; | ||||
|
|
||||
| let builders = [ | ||||
| OpBuilder<(ins CArg<"const ScanOperands &">:$clauses)> | ||||
| ]; | ||||
|
|
||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| } | ||||
|
|
||||
| //===----------------------------------------------------------------------===// | ||||
| // 2.17.5 taskwait Construct | ||||
| //===----------------------------------------------------------------------===// | ||||
|
|
||||
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.
Nit: Move definitions for these new clauses to keep alphabetical sorting in the file.