>,
InterfaceMethod<
/*desc=*/[{
+ Return iterator types in the current operation.
+ }],
+ /*retTy=*/"SmallVector<StringRef>",
+ /*methodName=*/"getIteratorTypesArray",
+ /*args=*/(ins),
+ /*methodBody=*/"",
+ /*defaultImplementation=*/[{
+ auto range = $_op.iterator_types().template getAsValueRange<StringAttr>();
+ return {range.begin(), range.end()};
+ }]
+ >,
+ InterfaceMethod<
+ /*desc=*/[{
Return true if the indexing map is depending on the current op instance.
This means that the indexing map is dynamically synthesized by using the
op instance's concrete attributes, instead of being static for all
!indexingMaps.back().isProjectedPermutation())
return MatchConvolutionResult::NotProjectedPermutations;
- auto iteratorTypesRange =
- linalgOp.iterator_types().getAsValueRange<StringAttr>();
+ auto iteratorTypesRange = linalgOp.getIteratorTypesArray();
llvm::SmallDenseSet<unsigned> outputDims =
getPreservedDims(indexingMaps.back());
resultTypes.push_back(newInputOutputTypes[i + genericOp.getNumInputs()]);
GenericOp replacementOp = rewriter.create<GenericOp>(
loc, resultTypes, newInputs, newOutputs, newIndexingMaps,
- llvm::to_vector<4>(genericOp.getIteratorTypes()
- .template getAsValueRange<StringAttr>()));
+ genericOp.getIteratorTypesArray());
rewriter.inlineRegionBefore(genericOp.getRegion(),
replacementOp.getRegion(),
replacementOp.getRegion().begin());
.isProjectedPermutation();
}) &&
genericOp.getTiedIndexingMap(fusableOpOperand).getNumResults() > 0 &&
- llvm::all_of(genericOp.getIteratorTypes(), [](Attribute attr) {
- return attr.cast<StringAttr>().getValue() ==
- getParallelIteratorTypeName();
+ llvm::all_of(genericOp.getIteratorTypesArray(), [](StringRef it) {
+ return it == getParallelIteratorTypeName();
});
}
SmallVector<Value> inputOperands = linalgOp.getInputOperands();
SmallVector<Value> outputOperands = linalgOp.getOutputOperands();
SmallVector<AffineMap> indexingMaps = linalgOp.getIndexingMapsArray();
- SmallVector<StringRef> iterators = llvm::to_vector<4>(
- linalgOp.iterator_types().getAsValueRange<StringAttr>());
+ SmallVector<StringRef> iterators = linalgOp.getIteratorTypesArray();
SmallVector<RankedTensorType> resultTypes = linalgOp.getOutputTensorTypes();
SmallVector<Type> types(resultTypes.begin(), resultTypes.end());
SmallVector<Value> outputOperands = genericOp.getOutputOperands();
auto newOp = rewriter.create<GenericOp>(
loc, genericOp->getResultTypes(), newOperands, outputOperands,
- newIndexingMaps,
- llvm::to_vector<4>(genericOp.getIteratorTypes()
- .template getAsValueRange<StringAttr>()));
+ newIndexingMaps, genericOp.getIteratorTypesArray());
rewriter.cloneRegionBefore(genericOp.getRegion(), newOp.getRegion(),
newOp.getRegion().begin());