summaryrefslogtreecommitdiff
path: root/mlir/examples/standalone/python/StandaloneExtensionPybind11.cpp
diff options
context:
space:
mode:
authorAiden Grossman <aidengrossman@google.com>2025-09-26 22:48:22 +0000
committerAiden Grossman <aidengrossman@google.com>2025-09-26 22:48:22 +0000
commit76533872e149395812a6d1651aa49dbf53fb4921 (patch)
tree199a669fa57a4effc3116705d2ec89c07ff36c65 /mlir/examples/standalone/python/StandaloneExtensionPybind11.cpp
parent54f5c1b2e17a9be61609d70dbbc8354ad41bb931 (diff)
parent37e7ad184d002db15f72771938755580433cf96d (diff)
[𝘀𝗽𝗿] changes introduced through rebaseusers/boomanaiden154/main.lit-remove-t-from-tests
Created using spr 1.3.6 [skip ci]
Diffstat (limited to 'mlir/examples/standalone/python/StandaloneExtensionPybind11.cpp')
-rw-r--r--mlir/examples/standalone/python/StandaloneExtensionPybind11.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/mlir/examples/standalone/python/StandaloneExtensionPybind11.cpp b/mlir/examples/standalone/python/StandaloneExtensionPybind11.cpp
index 397db4c20e74..da8c2167dc36 100644
--- a/mlir/examples/standalone/python/StandaloneExtensionPybind11.cpp
+++ b/mlir/examples/standalone/python/StandaloneExtensionPybind11.cpp
@@ -10,6 +10,7 @@
//===----------------------------------------------------------------------===//
#include "Standalone-c/Dialects.h"
+#include "mlir-c/Dialect/Arith.h"
#include "mlir/Bindings/Python/PybindAdaptors.h"
using namespace mlir::python::adaptors;
@@ -21,12 +22,16 @@ PYBIND11_MODULE(_standaloneDialectsPybind11, m) {
auto standaloneM = m.def_submodule("standalone");
standaloneM.def(
- "register_dialect",
+ "register_dialects",
[](MlirContext context, bool load) {
- MlirDialectHandle handle = mlirGetDialectHandle__standalone__();
- mlirDialectHandleRegisterDialect(handle, context);
+ MlirDialectHandle arithHandle = mlirGetDialectHandle__arith__();
+ MlirDialectHandle standaloneHandle =
+ mlirGetDialectHandle__standalone__();
+ mlirDialectHandleRegisterDialect(arithHandle, context);
+ mlirDialectHandleRegisterDialect(standaloneHandle, context);
if (load) {
- mlirDialectHandleLoadDialect(handle, context);
+ mlirDialectHandleLoadDialect(arithHandle, context);
+ mlirDialectHandleRegisterDialect(standaloneHandle, context);
}
},
py::arg("context") = py::none(), py::arg("load") = true);