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

Casts object <-> MlirValue. More...

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

Public Member Functions

 NB_TYPE_CASTER (MlirValue, const_name(MAKE_MLIR_PYTHON_QUALNAME("ir.Value"))) bool from_python(handle src

Static Public Member Functions

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

Public Attributes

uint8_t flags
uint8_t cleanup_list *cleanup noexcept

Detailed Description

Casts object <-> MlirValue.

Definition at line 326 of file NanobindAdaptors.h.

Member Function Documentation

◆ from_cpp()

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

◆ NB_TYPE_CASTER()

nanobind::detail::type_caster< MlirValue >::NB_TYPE_CASTER ( MlirValue ,
const_name(MAKE_MLIR_PYTHON_QUALNAME("ir.Value"))  )

Member Data Documentation

◆ flags

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

Definition at line 328 of file NanobindAdaptors.h.

◆ noexcept

uint8_t cleanup_list* cleanup nanobind::detail::type_caster< MlirValue >::noexcept
Initial value:
{
if (auto capsule = mlirApiObjectToCapsule(src)) {
value = mlirPythonCapsuleToValue(capsule->ptr());
return !mlirValueIsNull(value);
}
return false
static MlirValue mlirPythonCapsuleToValue(PyObject *capsule)
Extracts an MlirValue from a capsule as produced from mlirPythonValueToCapsule.
Definition Interop.h:454
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 328 of file NanobindAdaptors.h.


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