mlir.dialects.scf¶
Classes¶
Specialization for the SCF for op class. |
|
Specialization for the SCF forall op class. |
|
Specialization of the SCF forall.in_parallel op class. |
|
Specialization for the SCF if op class. |
|
The |
Functions¶
|
|
|
|
|
Module Contents¶
- class mlir.dialects.scf.ForOp(lower_bound, upper_bound, step, iter_args: Operation | OpView | Sequence[Value] | None = None, *, loc=None, ip=None)¶
Bases:
ForOpSpecialization for the SCF for op class.
- property body¶
Returns the body (block) of the loop.
- property induction_variable¶
Returns the induction variable of the loop.
- property inner_iter_args¶
Returns the loop-carried arguments usable within the loop.
To obtain the loop-carried operands, use
iter_args.
- mlir.dialects.scf._dispatch_index_op_fold_results(ofrs: Sequence[Operation | OpView | Value | int]) Tuple[List[Value], List[int]]¶
mlir::dispatchIndexOpFoldResults
- class mlir.dialects.scf.ForallOp(lower_bounds: Sequence[Operation | OpView | Value | int], upper_bounds: Sequence[Operation | OpView | Value | int], steps: Sequence[Value | int], shared_outs: Operation | OpView | Sequence[Value] | None = None, *, mapping=None, loc=None, ip=None)¶
Bases:
ForallOpSpecialization for the SCF forall op class.
- property rank: int¶
Returns the number of induction variables the loop has.
- property induction_variables: BlockArgumentList¶
Returns the induction variables usable within the loop.
- property inner_iter_args: BlockArgumentList¶
Returns the loop-carried arguments usable within the loop.
To obtain the loop-carried operands, use
iter_args.
- terminator() InParallelOp¶
Returns the loop terminator if it exists. Otherwise, creates a new one.
- class mlir.dialects.scf.InParallelOp(loc=None, ip=None)¶
Bases:
InParallelOpSpecialization of the SCF forall.in_parallel op class.
- class mlir.dialects.scf.IfOp(cond, results_=None, *, hasElse=False, loc=None, ip=None)¶
Bases:
IfOpSpecialization for the SCF if op class.
- property then_block¶
Returns the then block of the if operation.
- property else_block¶
Returns the else block of the if operation.
- mlir.dialects.scf.for_(start, stop=None, step=None, iter_args: Sequence[Value] | None = None, *, loc=None, ip=None)¶
- class mlir.dialects.scf.IndexSwitchOp(results, arg, cases, case_body_builder=None, default_body_builder=None, loc=None, ip=None)¶
Bases:
IndexSwitchOpThe
scf.index_switchis a control-flow operation that branches to one of the given regions based on the values of the argument and the cases. The argument is always of typeindex.The operation always has a “default” region and any number of case regions denoted by integer constants. Control-flow transfers to the case region whose constant value equals the value of the argument. If the argument does not equal any of the case values, control-flow transfer to the “default” region.
Example:
%0 = scf.index_switch %arg0 : index -> i32 case 2 { %1 = arith.constant 10 : i32 scf.yield %1 : i32 } case 5 { %2 = arith.constant 20 : i32 scf.yield %2 : i32 } default { %3 = arith.constant 30 : i32 scf.yield %3 : i32 }
- __doc__¶
- mlir.dialects.scf.index_switch(results, arg, cases, case_body_builder=None, default_body_builder=None, loc=None, ip=None) OpResult | OpResultList | IndexSwitchOp¶