MLIR
20.0.0git
|
#include "Bindings/Python/IRModule.h"
Public Member Functions | |
PyModule (PyModule &)=delete | |
PyModule (PyMlirContext &&)=delete | |
~PyModule () | |
MlirModule | get () |
Gets the backing MlirModule. More... | |
PyModuleRef | getRef () |
Gets a strong reference to this module. More... | |
pybind11::object | getCapsule () |
Gets a capsule wrapping the void* within the MlirModule. More... | |
Public Member Functions inherited from mlir::python::BaseContextObject | |
BaseContextObject (PyMlirContextRef ref) | |
PyMlirContextRef & | getContext () |
Accesses the context reference. More... | |
Static Public Member Functions | |
static PyModuleRef | forModule (MlirModule module) |
Returns a PyModule reference for the given MlirModule. More... | |
static pybind11::object | createFromCapsule (pybind11::object capsule) |
Creates a PyModule from the MlirModule wrapped by a capsule. More... | |
Definition at line 531 of file IRModule.h.
|
delete |
Referenced by forModule().
|
delete |
PyModule::~PyModule | ( | ) |
Definition at line 1083 of file IRCore.cpp.
References mlir::python::BaseContextObject::getContext(), and mlirModuleDestroy().
|
static |
Creates a PyModule from the MlirModule wrapped by a capsule.
Note that PyModule instances are uniqued, so the returned object may be a pre-existing object. Ownership of the underlying MlirModule is taken by calling this function.
Definition at line 1118 of file IRCore.cpp.
References forModule(), mlirModuleIsNull(), mlirPythonCapsuleToModule(), and mlir::python::PyObjectRef< T >::releaseObject().
|
static |
Returns a PyModule reference for the given MlirModule.
This may return a pre-existing or new object.
Definition at line 1092 of file IRCore.cpp.
References mlir::python::PyMlirContext::forContext(), mlirModuleGetContext(), and PyModule().
Referenced by createFromCapsule().
|
inline |
py::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 1125 of file IRCore.cpp.
References get(), and mlirPythonModuleToCapsule().
|
inline |
Gets a strong reference to this module.
Definition at line 544 of file IRModule.h.