[mlir][linalg][python] Explicit shape and dimension order in OpDSL.
authorTobias Gysi <gysit@google.com>
Wed, 30 Jun 2021 08:59:22 +0000 (08:59 +0000)
committerTobias Gysi <gysit@google.com>
Wed, 30 Jun 2021 08:59:39 +0000 (08:59 +0000)
commit4361bd9b7b38c73b69f9a37e52d0b72989e84947
treedf001ad04c041c1cfdb057ae6db841594956d94a
parent17bcae8906949374495fb396b0baf540feafb1a5
[mlir][linalg][python] Explicit shape and dimension order in OpDSL.

Extend the OpDSL syntax with an optional `domain` function to specify an explicit dimension order. The extension is needed to provide more control over the dimension order instead of deducing it implicitly depending on the formulation of the tensor comprehension. Additionally, the patch also ensures the symbols are ordered according to the operand definitions of the operation.

Differential Revision: https://reviews.llvm.org/D105117
mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
mlir/python/mlir/dialects/linalg/opdsl/lang/config.py
mlir/python/mlir/dialects/linalg/opdsl/lang/dsl.py
mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
mlir/test/python/dialects/linalg/opdsl/arguments.py
mlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
mlir/test/python/dialects/linalg/opdsl/interfaces.py
mlir/test/python/dialects/linalg/opdsl/shape_maps_iteration.py