[Mlir-commits] [mlir] [MLIR][Complex] Add complex ops support in OPDSL. (PR #162665)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Oct 9 07:27:52 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r origin/main...HEAD mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py mlir/test/python/dialects/linalg/opdsl/emit_misc.py
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- test/python/dialects/linalg/opdsl/emit_misc.py 2025-10-08 13:55:12.000000 +0000
+++ test/python/dialects/linalg/opdsl/emit_misc.py 2025-10-09 14:27:21.126530 +0000
@@ -35,10 +35,11 @@
O=TensorDef(U, output=True),
fun=UnaryFnAttrDef(default=UnaryFn.exp),
cast=TypeFnAttrDef(default=TypeFn.cast_signed),
):
O[None] = fun(cast(U, I[None]))
+
@linalg_structured_op
def elemwise_unary_poly(
I=TensorDef(T),
O=TensorDef(U, output=True),
@@ -197,11 +198,13 @@
# CHECK-NEXT: -> tensor<4x16xcomplex<f32>>
@func.FuncOp.from_py_func(
RankedTensorType.get((4, 16), c32), RankedTensorType.get((4, 16), c32)
)
def test_c32_elemwise_conj(input, init_result):
- return elemwise_unary_poly(input, outs=[init_result], fun=UnaryFn.conj, cast=None)
+ return elemwise_unary_poly(
+ input, outs=[init_result], fun=UnaryFn.conj, cast=None
+ )
# Just check that we don't assert out on name mismatch.
# CHECK-LABEL: @test_non_default_op_name
@func.FuncOp.from_py_func(
RankedTensorType.get((42,), f32), RankedTensorType.get((42,), f32)
``````````
</details>
https://github.com/llvm/llvm-project/pull/162665
More information about the Mlir-commits
mailing list