[PATCH] D73923: [mlir] [VectorOps] refined description of vector.contract
Aart Bik via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 3 13:33:31 PST 2020
aartbik created this revision.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: nicolasvasilache.
Herald added a project: LLVM.
A few details were missing in the description. These
changes makes the documented code "compile".
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D73923
Files:
mlir/include/mlir/Dialect/VectorOps/VectorOps.td
Index: mlir/include/mlir/Dialect/VectorOps/VectorOps.td
===================================================================
--- mlir/include/mlir/Dialect/VectorOps/VectorOps.td
+++ mlir/include/mlir/Dialect/VectorOps/VectorOps.td
@@ -83,13 +83,13 @@
// 2D vector contraction with one contracting dimension (matmul).
#contraction_accesses = [
- (i, j, k) -> (i, k),
- (i, j, k) -> (k, j),
- (i, j, k) -> (i, j)
+ affine_map<(i, j, k) -> (i, k)>,
+ affine_map<(i, j, k) -> (k, j)>,
+ affine_map<(i, j, k) -> (i, j)>
]
#contraction_trait = {
indexing_maps = #contraction_accesses,
- iterator_types = [parallel, parallel, reduction]
+ iterator_types = ["parallel", "parallel", "reduction"]
}
%3 = vector.contract #contraction_trait %0, %1, %2
@@ -98,13 +98,14 @@
// 4D to 3D vector contraction with two contracting dimensions and
// one batch dimension.
#contraction_accesses = [
- (b0, f0, f1, c0, c1) -> (c0, b0, c1, f0),
- (b0, f0, f1, c0, c1) -> (b0, c1, c0, f1),
- (b0, f0, f1, c0, c1) -> (b0, f0, f1)
+ affine_map<(b0, f0, f1, c0, c1) -> (c0, b0, c1, f0)>,
+ affine_map<(b0, f0, f1, c0, c1) -> (b0, c1, c0, f1)>,
+ affine_map<(b0, f0, f1, c0, c1) -> (b0, f0, f1)>
]
#contraction_trait = {
indexing_maps = #contraction_accesses,
- iterator_types = [parallel, parallel, parallel reduction, reduction]
+ iterator_types = ["parallel", "parallel", "parallel",
+ "reduction", "reduction"]
}
%4 = vector.contract #contraction_trait %0, %1, %2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73923.242170.patch
Type: text/x-patch
Size: 1683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200203/f83dda85/attachment-0001.bin>
More information about the llvm-commits
mailing list