Add operations abs, ceil, floor, and neg to the C++ API and Python API.
Add test cases.
Paths
| Differential D121339
[mlir][linalg] Add a few unary operations. ClosedPublic Authored by bixia on Mar 9 2022, 2:04 PM.
Details Summary Add operations abs, ceil, floor, and neg to the C++ API and Python API. Add test cases.
Diff Detail
Event TimelineComment Actions Thanks for adding! There are also a couple of places on the C++ side that need to be updated.
https://github.com/llvm/llvm-project/blob/9fac110bf70896a5411cf57b3ff34fab5798ab78/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td#L62
https://github.com/llvm/llvm-project/blob/9fac110bf70896a5411cf57b3ff34fab5798ab78/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp#L138
I think it would be great to update the C++ side in the same revision. Doing it in a follow up commit is also fine for me. bixia retitled this revision from [mlir][linalg][opdsl] Add a few unary operations. to [mlir][linalg] Add a few unary operations..Mar 10 2022, 9:18 AM Comment ActionsThanks for the review and pointers for the C++ changes! I added the C++ change and modified the PR description. PTAL. This revision is now accepted and ready to land.Mar 10 2022, 9:24 AM Closed by commit rG13d330717666: [mlir][linalg] Add a few unary operations. (authored by bixia). · Explain WhyMar 10 2022, 9:39 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 414409 mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
mlir/test/Dialect/Linalg/generalize-named-polymorphic-ops.mlir
mlir/test/python/dialects/linalg/opdsl/emit_misc.py
|