Lines Matching refs:PyMlirContext
449 PyMlirContext::PyMlirContext(MlirContext context) : context(context) { in PyMlirContext() function in PyMlirContext
455 PyMlirContext::~PyMlirContext() { in ~PyMlirContext()
464 py::object PyMlirContext::getCapsule() { in getCapsule()
468 py::object PyMlirContext::createFromCapsule(py::object capsule) { in createFromCapsule()
475 PyMlirContext *PyMlirContext::createNewContextForInit() { in createNewContextForInit()
477 return new PyMlirContext(context); in createNewContextForInit()
480 PyMlirContextRef PyMlirContext::forContext(MlirContext context) { in forContext()
486 PyMlirContext *unownedContextWrapper = new PyMlirContext(context); in forContext()
497 PyMlirContext::LiveContextMap &PyMlirContext::getLiveContexts() { in getLiveContexts()
502 size_t PyMlirContext::getLiveCount() { return getLiveContexts().size(); } in getLiveCount()
504 size_t PyMlirContext::getLiveOperationCount() { return liveOperations.size(); } in getLiveOperationCount()
506 size_t PyMlirContext::clearLiveOperations() { in clearLiveOperations()
514 size_t PyMlirContext::getLiveModuleCount() { return liveModules.size(); } in getLiveModuleCount()
516 pybind11::object PyMlirContext::contextEnter() { in contextEnter()
520 void PyMlirContext::contextExit(const pybind11::object &excType, in contextExit()
526 py::object PyMlirContext::attachDiagnosticHandler(py::object callback) { in attachDiagnosticHandler()
577 PyMlirContext &DefaultingPyMlirContext::resolve() { in resolve()
578 PyMlirContext *context = PyThreadContextEntry::getDefaultContext(); in resolve()
627 PyMlirContext *PyThreadContextEntry::getContext() { in getContext()
630 return py::cast<PyMlirContext *>(context); in getContext()
645 PyMlirContext *PyThreadContextEntry::getDefaultContext() { in getDefaultContext()
660 py::object PyThreadContextEntry::pushContext(PyMlirContext &context) { in pushContext()
668 void PyThreadContextEntry::popContext(PyMlirContext &context) { in popContext()
769 return PyLocation(PyMlirContext::forContext(context), loc); in getLocation()
833 return PyLocation(PyMlirContext::forContext(mlirLocationGetContext(rawLoc)), in createFromCapsule()
877 PyMlirContextRef contextRef = PyMlirContext::forContext(context); in forModule()
1094 return forOperation(PyMlirContext::forContext(rawCtxt), rawOperation) in createFromCapsule()
1654 PyMlirContext::forContext(mlirAttributeGetContext(rawAttr)), rawAttr); in createFromCapsule()
1685 return PyType(PyMlirContext::forContext(mlirTypeGetContext(rawType)), in createFromCapsule()
1710 PyOperation::forOperation(PyMlirContext::forContext(ctx), owner); in createFromCapsule()
2234 py::class_<PyMlirContext>(m, "_BaseContext", py::module_local()) in populateIRCore()
2235 .def(py::init<>(&PyMlirContext::createNewContextForInit)) in populateIRCore()
2236 .def_static("_get_live_count", &PyMlirContext::getLiveCount) in populateIRCore()
2238 [](PyMlirContext &self) { in populateIRCore()
2239 PyMlirContextRef ref = PyMlirContext::forContext(self.get()); in populateIRCore()
2242 .def("_get_live_operation_count", &PyMlirContext::getLiveOperationCount) in populateIRCore()
2243 .def("_clear_live_operations", &PyMlirContext::clearLiveOperations) in populateIRCore()
2244 .def("_get_live_module_count", &PyMlirContext::getLiveModuleCount) in populateIRCore()
2246 &PyMlirContext::getCapsule) in populateIRCore()
2247 .def(MLIR_PYTHON_CAPI_FACTORY_ATTR, &PyMlirContext::createFromCapsule) in populateIRCore()
2248 .def("__enter__", &PyMlirContext::contextEnter) in populateIRCore()
2249 .def("__exit__", &PyMlirContext::contextExit) in populateIRCore()
2261 [](PyMlirContext &self) { return PyDialects(self.getRef()); }, in populateIRCore()
2264 "d", [](PyMlirContext &self) { return PyDialects(self.getRef()); }, in populateIRCore()
2268 [=](PyMlirContext &self, std::string &name) { in populateIRCore()
2281 [](PyMlirContext &self) -> bool { in populateIRCore()
2284 [](PyMlirContext &self, bool value) { in populateIRCore()
2287 .def("attach_diagnostic_handler", &PyMlirContext::attachDiagnosticHandler, in populateIRCore()
2292 [](PyMlirContext &self, bool enable) { in populateIRCore()
2298 [](PyMlirContext &self, std::string &name) { in populateIRCore()
2305 [](PyMlirContext &self, PyDialectRegistry ®istry) { in populateIRCore()
2309 .def("load_all_available_dialects", [](PyMlirContext &self) { in populateIRCore()
3040 auto contextRef = PyMlirContext::forContext( in populateIRCore()