This patch adds the vector.scan op which computes the
scan for a given n-d vector. It requires specifying the operator,
the identity element and whether the scan is inclusive or
exclusive.
TEST: Added test in ops.mlir
Paths
| Differential D117171
Add vector.scan op ClosedPublic Authored by harsh on Jan 12 2022, 4:02 PM.
Details
Summary This patch adds the vector.scan op which computes the TEST: Added test in ops.mlir
Diff Detail
Event TimelineComment Actions Some fly by comments. Can you say a bit more on the motivation for adding this op?
Comment Actions Hi Aart, Thanks for taking a look at this patch. Let me provide some motivation for this op. I have been working closely with the IREE folks on try to implement a scan operation that can run on the Thanks, Comment Actions
For most vector ops, we have an actual lowering to LLVM IR, just so we can run integration test on the new functionality. This also acts as extra "documentation" on what the op does. Comment Actions
Sounds good. I will add an initial lowering to LLVM IR / Standard Dialect that should showcase the use of this op in the subsequent patch. Thanks!
Comment Actions @aartbik - based on discussions with @ThomasRaoux , we felt it made more sense to do a vector to vector conversion instead of going directly to llvm. I have added the patch here along with some tests. Please take a look and let me know what you think. Thanks!
Comment Actions Thanks for adding an integration test! Few more comments.
This revision now requires changes to proceed.Jan 27 2022, 10:29 AM harsh added inline comments.
Comment Actions Looks good overall, I think you should be able to fix the syntax then it should be good to go.
harsh added inline comments.
This revision is now accepted and ready to land.Jan 28 2022, 11:47 AM Closed by commit rG80e0bf1af11c: Add vector.scan op (authored by harsh). · Explain WhyJan 28 2022, 12:08 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 404125 mlir/include/mlir/Dialect/Vector/VectorOps.td
mlir/include/mlir/Dialect/Vector/VectorRewritePatterns.h
mlir/lib/Dialect/Vector/VectorOps.cpp
mlir/lib/Dialect/Vector/VectorTransforms.cpp
mlir/test/Dialect/Vector/invalid.mlir
mlir/test/Dialect/Vector/ops.mlir
mlir/test/Dialect/Vector/vector-scan-transforms.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-scan.mlir
mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp
|
vector source and result need to have the exact same type?