MLIR  19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::python::PyType Class Reference

Wrapper around the generic MlirType. More...

#include "Bindings/Python/IRModule.h"

+ Inheritance diagram for mlir::python::PyType:

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Wrapper around the generic MlirType.

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

Definition at line 871 of file IRModule.h.

Constructor & Destructor Documentation

◆ PyType()

mlir::python::PyType::PyType ( PyMlirContextRef  contextRef,
MlirType  type 
)
inline

Definition at line 873 of file IRModule.h.

Referenced by createFromCapsule().

Member Function Documentation

◆ createFromCapsule()

PyType PyType::createFromCapsule ( pybind11::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 1939 of file IRCore.cpp.

References mlir::python::PyMlirContext::forContext(), mlirPythonCapsuleToType(), mlirTypeGetContext(), mlirTypeIsNull(), and PyType().

◆ get()

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

Definition at line 877 of file IRModule.h.

◆ getCapsule()

py::object PyType::getCapsule ( )

Gets a capsule wrapping the void* within the MlirType.

Definition at line 1935 of file IRCore.cpp.

References mlirPythonTypeToCapsule().

◆ operator MlirType()

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

Definition at line 876 of file IRModule.h.

◆ operator==()

bool PyType::operator== ( const PyType other) const

Definition at line 1931 of file IRCore.cpp.

References mlirTypeEqual().


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