MLIR 23.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType Class Reference

Wrapper around the generic MlirType. More...

#include "mlir/Bindings/Python/IRCore.h"

Inheritance diagram for mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType:

Public Member Functions

 PyType (PyMlirContextRef contextRef, MlirType type)
bool operator== (const PyType &other) const
 operator MlirType () const
MlirType get () const
nanobind::object getCapsule ()
 Gets a capsule wrapping the void* within the MlirType.
nanobind::typed< nanobind::object, PyTypemaybeDownCast ()
Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::BaseContextObject
 BaseContextObject (PyMlirContextRef ref)
PyMlirContextRefgetContext ()
 Accesses the context reference.

Static Public Member Functions

static PyType createFromCapsule (nanobind::object capsule)
 Creates a PyType from the MlirType wrapped by a capsule.

Detailed Description

Wrapper around the generic MlirType.

The lifetime of a type is bound by the PyContext that created it.

Definition at line 875 of file IRCore.h.

Constructor & Destructor Documentation

◆ PyType()

Member Function Documentation

◆ createFromCapsule()

PyType mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType::createFromCapsule ( nanobind::object capsule)
static

Creates a PyType from the MlirType wrapped by a capsule.

Note that PyType instances are uniqued, so the returned object may be a pre-existing object. Ownership of the underlying MlirType is taken by calling this function.

Definition at line 1934 of file IRCore.cpp.

References mlirPythonTypeToCapsule().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ get()

MlirType mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType::get ( ) const
inline

◆ getCapsule()

nb::object mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType::getCapsule ( )

Gets a capsule wrapping the void* within the MlirType.

Definition at line 1930 of file IRCore.cpp.

References mlirTypeEqual(), and PyType().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ maybeDownCast()

◆ operator MlirType()

mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType::operator MlirType ( ) const
inline

Definition at line 880 of file IRCore.h.

◆ operator==()

bool mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType::operator== ( const PyType & other) const

Definition at line 1926 of file IRCore.cpp.


The documentation for this class was generated from the following files: