Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
Show First 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | let description = [{ | ||||||||
The `alignment_values` attribute additionally specifies alignment of each | The `alignment_values` attribute additionally specifies alignment of each | ||||||||
corresponding aligned operand. Note that `$aligned_vars` and | corresponding aligned operand. Note that `$aligned_vars` and | ||||||||
`alignment_values` should contain the same number of elements. | `alignment_values` should contain the same number of elements. | ||||||||
When an if clause is present and evaluates to false, the preferred number of | When an if clause is present and evaluates to false, the preferred number of | ||||||||
iterations to be executed concurrently is one, regardless of whether | iterations to be executed concurrently is one, regardless of whether | ||||||||
a simdlen clause is specified. | a simdlen clause is specified. | ||||||||
The optional `order` attribute specifies which order the iterations of the | |||||||||
associate loops are executed in. Currently the only option for this | |||||||||
kiranchandramohanUnsubmitted Not Done ReplyInline Actions
kiranchandramohan: | |||||||||
attribute is "concurrent". | |||||||||
When a simdlen clause is present, the preferred number of iterations to be | When a simdlen clause is present, the preferred number of iterations to be | ||||||||
executed concurrently is the value provided to the simdlen clause. | executed concurrently is the value provided to the simdlen clause. | ||||||||
The safelen clause specifies that no two concurrent iterations within a | The safelen clause specifies that no two concurrent iterations within a | ||||||||
SIMD chunk can have a distance in the logical iteration space that is | SIMD chunk can have a distance in the logical iteration space that is | ||||||||
greater than or equal to the value given in the clause. | greater than or equal to the value given in the clause. | ||||||||
``` | ``` | ||||||||
omp.simdloop <clauses> | omp.simdloop <clauses> | ||||||||
for (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) { | for (%i1, %i2) : index = (%c0, %c0) to (%c10, %c10) step (%c1, %c1) { | ||||||||
// block operations | // block operations | ||||||||
omp.yield | omp.yield | ||||||||
} | } | ||||||||
``` | ``` | ||||||||
}]; | }]; | ||||||||
// TODO: Add other clauses | // TODO: Add other clauses | ||||||||
let arguments = (ins Variadic<IntLikeType>:$lowerBound, | let arguments = (ins Variadic<IntLikeType>:$lowerBound, | ||||||||
Variadic<IntLikeType>:$upperBound, | Variadic<IntLikeType>:$upperBound, | ||||||||
Variadic<IntLikeType>:$step, | Variadic<IntLikeType>:$step, | ||||||||
Variadic<OpenMP_PointerLikeType>:$aligned_vars, | Variadic<OpenMP_PointerLikeType>:$aligned_vars, | ||||||||
OptionalAttr<I64ArrayAttr>:$alignment_values, | OptionalAttr<I64ArrayAttr>:$alignment_values, | ||||||||
Optional<I1>:$if_expr, | Optional<I1>:$if_expr, | ||||||||
OptionalAttr<OrderKindAttr>:$order_val, | |||||||||
ConfinedAttr<OptionalAttr<I64Attr>, [IntPositive]>:$simdlen, | ConfinedAttr<OptionalAttr<I64Attr>, [IntPositive]>:$simdlen, | ||||||||
ConfinedAttr<OptionalAttr<I64Attr>, [IntPositive]>:$safelen, | ConfinedAttr<OptionalAttr<I64Attr>, [IntPositive]>:$safelen, | ||||||||
UnitAttr:$inclusive | UnitAttr:$inclusive | ||||||||
); | ); | ||||||||
let regions = (region AnyRegion:$region); | let regions = (region AnyRegion:$region); | ||||||||
let assemblyFormat = [{ | let assemblyFormat = [{ | ||||||||
oilist(`aligned` `(` | oilist(`aligned` `(` | ||||||||
custom<AlignedClause>($aligned_vars, type($aligned_vars), | custom<AlignedClause>($aligned_vars, type($aligned_vars), | ||||||||
$alignment_values) `)` | $alignment_values) `)` | ||||||||
|`if` `(` $if_expr `)` | |`if` `(` $if_expr `)` | ||||||||
|`order` `(` custom<ClauseAttr>($order_val) `)` | |||||||||
|`simdlen` `(` $simdlen `)` | |`simdlen` `(` $simdlen `)` | ||||||||
|`safelen` `(` $safelen `)` | |`safelen` `(` $safelen `)` | ||||||||
) `for` custom<LoopControl>($region, $lowerBound, $upperBound, $step, | ) `for` custom<LoopControl>($region, $lowerBound, $upperBound, $step, | ||||||||
type($step), $inclusive) attr-dict | type($step), $inclusive) attr-dict | ||||||||
}]; | }]; | ||||||||
let extraClassDeclaration = [{ | let extraClassDeclaration = [{ | ||||||||
/// Returns the number of loops in the simd loop nest. | /// Returns the number of loops in the simd loop nest. | ||||||||
▲ Show 20 Lines • Show All 958 Lines • Show Last 20 Lines |