[Mlir-commits] [mlir] [mlir][linalg] Implement TilingInterface for winograd operators (PR #96184)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Aug 6 08:06:31 PDT 2024
================
@@ -2881,6 +2881,105 @@ LogicalResult WinogradFilterTransformOp::verify() {
return success();
}
+SmallVector<Range>
+WinogradFilterTransformOp::getIterationDomain(OpBuilder &builder) {
+ Location loc = getLoc();
+ IntegerAttr zeroAttr = builder.getIndexAttr(0);
+ IntegerAttr oneAttr = builder.getIndexAttr(1);
+ Value filter = getFilter();
+ SmallVector<Range> loopBounds;
+ Range fRange;
+ fRange.offset = zeroAttr;
+ // 0 is the index of F in the filter.
+ fRange.size = getDimValue(builder, loc, filter, 0);
+ fRange.stride = oneAttr;
+ loopBounds.emplace_back(fRange);
+ Range cRange;
+ cRange.offset = zeroAttr;
+ // 3 is the index of C in the filter.
----------------
Max191 wrote:
It might be better to add some utils like `getFDim`, `getCDim`, etc to the extra class declarations for the ops. Then it will be clear from the code what each dimension is and we don't have to explain any magic numbers with comments.
https://github.com/llvm/llvm-project/pull/96184
More information about the Mlir-commits
mailing list