[Mlir-commits] [mlir] [mlir][SCF] Minor fixes in documentation examples (PR #69802)
Boian Petkantchin
llvmlistbot at llvm.org
Fri Oct 20 17:32:22 PDT 2023
https://github.com/sogartar created https://github.com/llvm/llvm-project/pull/69802
scf.forall.parallel_insert_slice -> tensor.parallel_insert_slice add -> linalg.add
map -> linalg.map
matmul -> linalg.matmul
>From 8145fdf68214c2d1f5d27deafcc8101c480d247e Mon Sep 17 00:00:00 2001
From: Boian Petkantchin <boian at nod-labs.com>
Date: Fri, 20 Oct 2023 17:11:19 -0700
Subject: [PATCH] [mlir][SCF] Minor fixes in documentation examples
scf.forall.parallel_insert_slice -> tensor.parallel_insert_slice
add -> linalg.add
map -> linalg.map
matmul -> linalg.matmul
---
mlir/include/mlir/Dialect/SCF/IR/SCFOps.td | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
index 6ac0912f6f706c5..044ca756b31062c 100644
--- a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
+++ b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
@@ -411,17 +411,19 @@ def ForallOp : SCF_Op<"forall", [
tensor<?x?xT> to tensor<?x?xT>
%sC = tensor.extract_slice %o1[h((%thread_id_1, %thread_id_2))]:
tensor<?x?xT> to tensor<?x?xT>
- %sD = matmul ins(%sA, %sB) outs(%sC)
+ %sD = linalg.matmul
+ ins(%sA, %sB : tensor<?x?xT>, tensor<?x?xT>)
+ outs(%sC : tensor<?x?xT>)
%spointwise = subtensor %o2[i((%thread_id_1, %thread_id_2))]:
tensor<?xT> to tensor<?xT>
- %sE = add ins(%spointwise) outs(%sD)
+ %sE = linalg.add ins(%spointwise : tensor<?xT>) outs(%sD : tensor<?xT>)
scf.forall.in_parallel {
- scf.forall.parallel_insert_slice %sD into %o1[h((%thread_id_1, %thread_id_2))]:
+ tensor.parallel_insert_slice %sD into %o1[h((%thread_id_1, %thread_id_2))]:
tensor<?x?xT> into tensor<?x?xT>
- scf.forall.parallel_insert_slice %spointwise into %o2[i((%thread_id_1, %thread_id_2))]:
+ tensor.parallel_insert_slice %spointwise into %o2[i((%thread_id_1, %thread_id_2))]:
tensor<?xT> into tensor<?xT>
}
}
@@ -449,10 +451,12 @@ def ForallOp : SCF_Op<"forall", [
%sC = tensor.extract_slice %o[%i, %j][%tileSize1, %tileSize2][1, 1]
: tensor<?x?xT> to tensor<?x?xT>
- %add = map {"arith.addf"} ins(%sA, %sB) outs(%sC)
+ %add = linalg.map {"arith.addf"}
+ ins(%sA, %sB : tensor<?x?xT>, tensor<?x?xT>)
+ outs(%sC : tensor<?x?xT>)
scf.forall.in_parallel {
- scf.forall.parallel_insert_slice %add into
+ tensor.parallel_insert_slice %add into
%o[%i, %j][%tileSize1, %tileSize2][1, 1]
: tensor<?x?xT> into tensor<?x?xT>
}
More information about the Mlir-commits
mailing list