The linalg.index operation provides access to the iteration indexes of immediately enclosing linalg operations. It takes a dimension dim attribute and returns the iteration index in the given dimension. Having linalg.index allows us to unify linalg.generic and linalg.indexed_generic and also enables index access in named operations.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Nice, thank you for starting this unification effort!
mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td | ||
---|---|---|
622 | I see in MemRefOps.td we have something like: Confined<OptionalAttr<I64Attr>, [IntMinValue<0>]>:$alignment I am not sure whether you can use with a C++ value instead of 0, but it should at least work for >= 0 (which isn't currently check IIUC). |
mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td | ||
---|---|---|
622 | Good point! I added IntMinValue to ensure the dim value needs to be larger than or equal to zero. I left the check for the upper bound of dim in the CPP since that check if very much operation specific. |
I see in MemRefOps.td we have something like:
I am not sure whether you can use with a C++ value instead of 0, but it should at least work for >= 0 (which isn't currently check IIUC).