[mlir][python] enable registering dialects with the default Context (#72488)

This commit is contained in:
Maksim Levental authored and GitHub committed 2023-11-27 19:26:05 -06:00
1 parent 7cbf9598cc
commit 17ec364b1b
5 files changed
+31 -19

No files matched your search

@@ -34,6 +34,15 @@ PYBIND11_MODULE(_mlirPythonTest, m) {
},
py::arg("context"), py::arg("load") = true);
m.def(
"register_dialect",
[](MlirDialectRegistry registry) {
MlirDialectHandle pythonTestDialect =
mlirGetDialectHandle__python_test__();
mlirDialectHandleInsertDialect(pythonTestDialect, registry);
},
py::arg("registry"));
mlir_attribute_subclass(m, "TestAttr",
mlirAttributeIsAPythonTestTestAttribute)
.def_classmethod(