[mlir-linalg-ods-yaml-gen] Fix a bug in getDpsInitsPositionRange

definition to support operators with multiple outputs.

Differential Revision: https://reviews.llvm.org/D152388
This commit is contained in:
Andrey Turetskiy 2023-05-24 20:30:22 -07:00
parent 22347afb72
commit fe8e7e30f9
2 changed files with 5 additions and 1 deletions

View File

@ -82,6 +82,10 @@ structured_op: !LinalgStructuredOpConfig
# ODS: buildStructuredOp($_builder, $_state, resultTensorTypes,
# ODS-NEXT: attributes, Test1Op::getRegionBuilder())
# ODS: std::pair<int64_t, int64_t> getDpsInitsPositionRange() {
# ODS-NEXT: int64_t getNumOperands = this->getNumOperands();
# ODS-NEXT: return {getNumOperands - getOutputs().size(), getNumOperands};
# ODS-NEXT: }
# IMPL-LABEL: void Test1Op::regionBuilder(ImplicitLocOpBuilder &b,
# IMPL-NEXT: Block &block, ArrayRef<NamedAttribute> attrs)

View File

@ -565,7 +565,7 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([AttrSizedOperandSegments],
std::pair<int64_t, int64_t> getDpsInitsPositionRange() {{
int64_t getNumOperands = this->getNumOperands();
return {{getNumOperands - 1, getNumOperands};
return {{getNumOperands - getOutputs().size(), getNumOperands};
}
// Generic methods.