[Mlir-commits] [mlir] [mlir][python] Add bindings for OpenACC dialect (PR #163620)

Guray Ozen llvmlistbot at llvm.org
Wed Oct 15 13:47:10 PDT 2025


================
@@ -0,0 +1,138 @@
+# RUN: python %s | FileCheck %s
+from mlir.ir import (
+    Context,
+    FunctionType,
+    Location,
+    Module,
+    InsertionPoint,
+    IntegerType,
+    IndexType,
+    MemRefType,
+    F32Type,
+    Block,
+    ArrayAttr,
+    Attribute,
+    UnitAttr,
+    StringAttr,
+    DenseI32ArrayAttr,
+    ShapedType,
+)
+from mlir.dialects import openacc, func, arith, memref
+
+
+def run(f):
+    print("\n// TEST:", f.__name__)
+    with Context(), Location.unknown():
+        f()
+    return f
+
+
+ at run
+def testManualReconstructedKernel():
+    module = Module.create()
+
+    # Add required module attributes
+    module.operation.attributes["dlti.dl_spec"] = Attribute.parse("#dlti.dl_spec<>")
+    module.operation.attributes["gpu.container_module"] = UnitAttr.get()
+
+    i32 = IntegerType.get_signless(32)
----------------
grypp wrote:

Fwiw, you could use T. to create types. I think we have all the types there

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


More information about the Mlir-commits mailing list