mirror of
https://github.com/intel/llvm.git
synced 2026-01-15 12:25:46 +08:00
Adds __str__ support to python mlir.ir.MlirModule.
* Also raises an exception on parse error. * Removes placeholder smoketest. * Adds docstrings. Differential Revision: https://reviews.llvm.org/D86046
This commit is contained in:
@@ -11,21 +11,14 @@
|
||||
#include <pybind11/pybind11.h>
|
||||
|
||||
#include "IRModules.h"
|
||||
#include "mlir/IR/MLIRContext.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
using namespace mlir;
|
||||
using namespace mlir::python;
|
||||
|
||||
PYBIND11_MODULE(_mlir, m) {
|
||||
m.doc() = "MLIR Python Native Extension";
|
||||
|
||||
m.def("get_test_value", []() {
|
||||
// This is just calling a method on the MLIRContext as a smoketest
|
||||
// for linkage.
|
||||
MLIRContext context;
|
||||
return std::make_tuple(std::string("From the native module"),
|
||||
context.isMultithreadingEnabled());
|
||||
});
|
||||
|
||||
// Define and populate IR submodule.
|
||||
auto irModule = m.def_submodule("ir", "MLIR IR Bindings");
|
||||
populateIRSubmodule(irModule);
|
||||
|
||||
Reference in New Issue
Block a user