MLIR 23.0.0git
nanobind::detail::type_caster< MlirModule > Struct Reference

Casts object <-> MlirModule. More...

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

Public Member Functions

 NB_TYPE_CASTER (MlirModule, const_name(MAKE_MLIR_PYTHON_QUALNAME("ir.Module"))) bool from_python(handle src

Static Public Member Functions

static handle from_cpp (MlirModule v, rv_policy, cleanup_list *cleanup) noexcept

Public Attributes

uint8_t flags
uint8_t cleanup_list *cleanup noexcept

Detailed Description

Casts object <-> MlirModule.

Definition at line 255 of file NanobindAdaptors.h.

Member Function Documentation

◆ from_cpp()

handle nanobind::detail::type_caster< MlirModule >::from_cpp ( MlirModule v,
rv_policy ,
cleanup_list * cleanup )
inlinestaticnoexcept

◆ NB_TYPE_CASTER()

nanobind::detail::type_caster< MlirModule >::NB_TYPE_CASTER ( MlirModule ,
const_name(MAKE_MLIR_PYTHON_QUALNAME("ir.Module"))  )

Member Data Documentation

◆ flags

uint8_t nanobind::detail::type_caster< MlirModule >::flags

Definition at line 257 of file NanobindAdaptors.h.

◆ noexcept

uint8_t cleanup_list* cleanup nanobind::detail::type_caster< MlirModule >::noexcept
Initial value:
{
if (auto capsule = mlirApiObjectToCapsule(src)) {
value = mlirPythonCapsuleToModule(capsule->ptr());
return !mlirModuleIsNull(value);
}
return false
static MlirModule mlirPythonCapsuleToModule(PyObject *capsule)
Extracts an MlirModule from a capsule as produced from mlirPythonModuleToCapsule.
Definition Interop.h:282
static std::optional< nanobind::object > mlirApiObjectToCapsule(nanobind::handle apiObject)
Helper to convert a presumed MLIR API object to a capsule, accepting either an explicit Capsule (whic...

Definition at line 257 of file NanobindAdaptors.h.


The documentation for this struct was generated from the following file: