|
MLIR 22.0.0git
|
#include "Bindings/Python/IRModule.h"
Public Member Functions | |
| PyModule (PyModule &)=delete | |
| PyModule (PyMlirContext &&)=delete | |
| ~PyModule () | |
| MlirModule | get () |
| Gets the backing MlirModule. | |
| PyModuleRef | getRef () |
| Gets a strong reference to this module. | |
| nanobind::object | getCapsule () |
| Gets a capsule wrapping the void* within the MlirModule. | |
| void | clearMlirModule () |
| Public Member Functions inherited from mlir::python::BaseContextObject | |
| BaseContextObject (PyMlirContextRef ref) | |
| PyMlirContextRef & | getContext () |
| Accesses the context reference. | |
Static Public Member Functions | |
| static PyModuleRef | forModule (MlirModule module) |
| Returns a PyModule reference for the given MlirModule. | |
| static nanobind::object | createFromCapsule (nanobind::object capsule) |
| Creates a PyModule from the MlirModule wrapped by a capsule. | |
Definition at line 512 of file IRModule.h.
|
delete |
References PyModule().
Referenced by forModule(), and PyModule().
|
delete |
| PyModule::~PyModule | ( | ) |
Definition at line 968 of file IRCore.cpp.
References mlir::python::BaseContextObject::getContext(), and mlirModuleDestroy().
|
inline |
Definition at line 540 of file IRModule.h.
|
static |
Creates a PyModule from the MlirModule wrapped by a capsule.
Note this returns a new object BUT clearMlirModule() must be called to prevent double-frees (of the underlying mlir::Module).
Definition at line 1002 of file IRCore.cpp.
References forModule(), mlirPythonCapsuleToModule(), and mlir::python::PyObjectRef< T >::releaseObject().
|
static |
Returns a PyModule reference for the given MlirModule.
This always returns a new object.
Definition at line 977 of file IRCore.cpp.
References mlir::python::PyMlirContext::forContext(), mlirModuleGetContext(), and PyModule().
Referenced by createFromCapsule().
|
inline |
| nb::object PyModule::getCapsule | ( | ) |
Gets a capsule wrapping the void* within the MlirModule.
Note that the module does not (yet) provide a corresponding factory for constructing from a capsule as that would require uniquing PyModule instances, which is not currently done.
Definition at line 1009 of file IRCore.cpp.
References get(), and mlirPythonModuleToCapsule().
|
inline |
Gets a strong reference to this module.
Definition at line 525 of file IRModule.h.