Skip to content

[MLIR][Linalg] Fix named structured ops yaml file #98865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ structured_op: !LinalgStructuredOpConfig
--- !LinalgOpConfig
metadata: !LinalgOpMetadata
name: erf
cpp_class_name: erfOp
cpp_class_name: ErfOp
doc: |-
Applies erf(x) elementwise.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class UnaryFn:
ceil = UnaryFnType("ceil")
floor = UnaryFnType("floor")
negf = UnaryFnType("negf")
reciprocal = UnaryFnType("reciprocal")
round = UnaryFnType("round")
sqrt = UnaryFnType("sqrt")
rsqrt = UnaryFnType("rsqrt")
Expand Down
12 changes: 12 additions & 0 deletions mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ def negf(
O[None] = UnaryFn.negf(I[None])


@linalg_structured_op(op_class_name="ReciprocalOp")
def reciprocal(
I=TensorDef(T1),
O=TensorDef(T1, output=True),
):
"""Applies reciprocal(x) elementwise.

No numeric casting is performed on the input operand.
"""
O[None] = UnaryFn.reciprocal(I[None])


@linalg_structured_op
def round(
I=TensorDef(T1),
Expand Down
Loading