[Mlir-commits] [mlir] [mlir][polynomial] python bindings (PR #93109)

Maksim Levental llvmlistbot at llvm.org
Sat Jun 1 09:53:29 PDT 2024


================
@@ -0,0 +1,27 @@
+# RUN: %PYTHON %s | FileCheck %s
+
+from mlir.ir import *
+from mlir.dialects import polynomial
+
+
+def constructAndPrintInModule(f):
+    print("\nTEST:", f.__name__)
+    with Context(), Location.unknown():
+        module = Module.create()
+        with InsertionPoint(module.body):
+            f()
+        print(module)
+    return f
+
+
+# CHECK-LABEL: TEST: test_smoke
+ at constructAndPrintInModule
+def test_smoke():
+    value = Attribute.parse("#polynomial.float_polynomial<0.5 + 1.3e06 x**2>")
----------------
makslevental wrote:

This was just a first pass/attempt/"just make it pass" impl. But what would a builder look like here? Since `0.5 + 1.3e06 x**2` is an arbitrary polynomial..?

https://github.com/llvm/llvm-project/pull/93109


More information about the Mlir-commits mailing list