MLIR 23.0.0git
ExtensibleDialect.h File Reference
#include "mlir-c/IR.h"
#include "mlir-c/Support.h"

Go to the source code of this file.

Classes

struct  MlirDynamicOpTraitCallbacks

Macros

#define DEFINE_C_API_STRUCT(name, storage)
 Opaque type declarations (see mlir-c/IR.h for more details).

Functions

 DEFINE_C_API_STRUCT (MlirDynamicOpTrait, void)
 DEFINE_C_API_STRUCT (MlirDynamicTypeDefinition, void)
 DEFINE_C_API_STRUCT (MlirDynamicAttrDefinition, void)
MLIR_CAPI_EXPORTED bool mlirDynamicOpTraitAttach (MlirDynamicOpTrait dynamicOpTrait, MlirStringRef opName, MlirContext context)
 Attach a dynamic op trait to the given operation name.
MLIR_CAPI_EXPORTED MlirDynamicOpTrait mlirDynamicOpTraitIsTerminatorCreate (void)
 Get the dynamic op trait that indicates the operation is a terminator.
MLIR_CAPI_EXPORTED MlirDynamicOpTrait mlirDynamicOpTraitNoTerminatorCreate (void)
 Get the dynamic op trait that indicates regions have no terminator.
MLIR_CAPI_EXPORTED void mlirDynamicOpTraitDestroy (MlirDynamicOpTrait dynamicOpTrait)
 Destroy the dynamic op trait.
MLIR_CAPI_EXPORTED MlirDynamicOpTrait mlirDynamicOpTraitCreate (MlirTypeID typeID, MlirDynamicOpTraitCallbacks callbacks, void *userData)
 Create a custom dynamic op trait with the given type ID and callbacks.
MLIR_CAPI_EXPORTED bool mlirDialectIsAExtensibleDialect (MlirDialect dialect)
 Check if the given dialect is an extensible dialect.
MLIR_CAPI_EXPORTED MlirDynamicTypeDefinition mlirExtensibleDialectLookupTypeDefinition (MlirDialect dialect, MlirStringRef typeName)
 Look up a registered type definition by type name in the given dialect.
MLIR_CAPI_EXPORTED bool mlirTypeIsADynamicType (MlirType type)
 Check if the given type is a dynamic type.
MLIR_CAPI_EXPORTED MlirType mlirDynamicTypeGet (MlirDynamicTypeDefinition typeDef, MlirAttribute *attrs, intptr_t numAttrs)
 Get a dynamic type by instantiating the given type definition with the provided attributes.
MLIR_CAPI_EXPORTED intptr_t mlirDynamicTypeGetNumParams (MlirType type)
 Get the number of parameters in the given dynamic type.
MLIR_CAPI_EXPORTED MlirAttribute mlirDynamicTypeGetParam (MlirType type, intptr_t index)
 Get the parameter at the given index in the provided dynamic type.
MLIR_CAPI_EXPORTED MlirDynamicTypeDefinition mlirDynamicTypeGetTypeDef (MlirType type)
 Get the type definition of the given dynamic type.
MLIR_CAPI_EXPORTED MlirTypeID mlirDynamicTypeDefinitionGetTypeID (MlirDynamicTypeDefinition typeDef)
 Get the type ID of a dynamic type definition.
MLIR_CAPI_EXPORTED MlirStringRef mlirDynamicTypeDefinitionGetName (MlirDynamicTypeDefinition typeDef)
 Get the name of the given dynamic type definition.
MLIR_CAPI_EXPORTED MlirDialect mlirDynamicTypeDefinitionGetDialect (MlirDynamicTypeDefinition typeDef)
 Get the dialect that the given dynamic type definition belongs to.
MLIR_CAPI_EXPORTED MlirDynamicAttrDefinition mlirExtensibleDialectLookupAttrDefinition (MlirDialect dialect, MlirStringRef attrName)
 Look up a registered attribute definition by attribute name in the given dialect.
MLIR_CAPI_EXPORTED bool mlirAttributeIsADynamicAttr (MlirAttribute attr)
 Check if the given attribute is a dynamic attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirDynamicAttrGet (MlirDynamicAttrDefinition attrDef, MlirAttribute *attrs, intptr_t numAttrs)
 Get a dynamic attribute by instantiating the given attribute definition with the provided attributes.
MLIR_CAPI_EXPORTED intptr_t mlirDynamicAttrGetNumParams (MlirAttribute attr)
 Get the number of parameters in the given dynamic attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirDynamicAttrGetParam (MlirAttribute attr, intptr_t index)
 Get the parameter at the given index in the provided dynamic attribute.
MLIR_CAPI_EXPORTED MlirDynamicAttrDefinition mlirDynamicAttrGetAttrDef (MlirAttribute attr)
 Get the attribute definition of the given dynamic attribute.
MLIR_CAPI_EXPORTED MlirTypeID mlirDynamicAttrDefinitionGetTypeID (MlirDynamicAttrDefinition attrDef)
 Get the type ID of a dynamic attribute definition.
MLIR_CAPI_EXPORTED MlirStringRef mlirDynamicAttrDefinitionGetName (MlirDynamicAttrDefinition attrDef)
 Get the name of the given dynamic attribute definition.
MLIR_CAPI_EXPORTED MlirDialect mlirDynamicAttrDefinitionGetDialect (MlirDynamicAttrDefinition attrDef)
 Get the dialect that the given dynamic attribute definition belongs to.

Macro Definition Documentation

◆ DEFINE_C_API_STRUCT

#define DEFINE_C_API_STRUCT ( name,
storage )
Value:
struct name { \
storage *ptr; \
}; \
typedef struct name name

Opaque type declarations (see mlir-c/IR.h for more details).

Definition at line 28 of file ExtensibleDialect.h.

Function Documentation

◆ DEFINE_C_API_STRUCT() [1/3]

DEFINE_C_API_STRUCT ( MlirDynamicAttrDefinition ,
void  )

References MLIR_CAPI_EXPORTED.

◆ DEFINE_C_API_STRUCT() [2/3]

DEFINE_C_API_STRUCT ( MlirDynamicOpTrait ,
void  )

◆ DEFINE_C_API_STRUCT() [3/3]

DEFINE_C_API_STRUCT ( MlirDynamicTypeDefinition ,
void  )

◆ mlirAttributeIsADynamicAttr()

MLIR_CAPI_EXPORTED bool mlirAttributeIsADynamicAttr ( MlirAttribute attr)

Check if the given attribute is a dynamic attribute.

Definition at line 154 of file ExtensibleDialect.cpp.

References unwrap().

◆ mlirDialectIsAExtensibleDialect()

MLIR_CAPI_EXPORTED bool mlirDialectIsAExtensibleDialect ( MlirDialect dialect)

Check if the given dialect is an extensible dialect.

Definition at line 91 of file ExtensibleDialect.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getDynamicAttrDef(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getDynamicTypeDef().

◆ mlirDynamicAttrDefinitionGetDialect()

MLIR_CAPI_EXPORTED MlirDialect mlirDynamicAttrDefinitionGetDialect ( MlirDynamicAttrDefinition attrDef)

Get the dialect that the given dynamic attribute definition belongs to.

Definition at line 195 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicAttribute::bindDerived().

◆ mlirDynamicAttrDefinitionGetName()

MLIR_CAPI_EXPORTED MlirStringRef mlirDynamicAttrDefinitionGetName ( MlirDynamicAttrDefinition attrDef)

Get the name of the given dynamic attribute definition.

Definition at line 190 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicAttribute::bindDerived().

◆ mlirDynamicAttrDefinitionGetTypeID()

MLIR_CAPI_EXPORTED MlirTypeID mlirDynamicAttrDefinitionGetTypeID ( MlirDynamicAttrDefinition attrDef)

Get the type ID of a dynamic attribute definition.

Definition at line 185 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicAttribute::bindDerived().

◆ mlirDynamicAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirDynamicAttrGet ( MlirDynamicAttrDefinition attrDef,
MlirAttribute * attrs,
intptr_t numAttrs )

Get a dynamic attribute by instantiating the given attribute definition with the provided attributes.

Definition at line 162 of file ExtensibleDialect.cpp.

References mlir::DynamicAttr::get(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicAttribute::bindDerived().

◆ mlirDynamicAttrGetAttrDef()

MLIR_CAPI_EXPORTED MlirDynamicAttrDefinition mlirDynamicAttrGetAttrDef ( MlirAttribute attr)

Get the attribute definition of the given dynamic attribute.

Definition at line 180 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicAttribute::bindDerived().

◆ mlirDynamicAttrGetNumParams()

MLIR_CAPI_EXPORTED intptr_t mlirDynamicAttrGetNumParams ( MlirAttribute attr)

Get the number of parameters in the given dynamic attribute.

Definition at line 172 of file ExtensibleDialect.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicAttribute::bindDerived().

◆ mlirDynamicAttrGetParam()

MLIR_CAPI_EXPORTED MlirAttribute mlirDynamicAttrGetParam ( MlirAttribute attr,
intptr_t index )

Get the parameter at the given index in the provided dynamic attribute.

Definition at line 176 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicAttribute::bindDerived().

◆ mlirDynamicOpTraitAttach()

MLIR_CAPI_EXPORTED bool mlirDynamicOpTraitAttach ( MlirDynamicOpTrait dynamicOpTrait,
MlirStringRef opName,
MlirContext context )

Attach a dynamic op trait to the given operation name.

Note that the operation name must be modeled by dynamic dialect and must be registered. The ownership of the trait will be transferred to the operation name after this call.

Definition at line 21 of file ExtensibleDialect.cpp.

References mlir::OperationName::getImpl(), mlir::RegisteredOperationName::lookup(), mlirDynamicOpTraitAttach(), and unwrap().

Referenced by mlirDynamicOpTraitAttach().

◆ mlirDynamicOpTraitCreate()

MLIR_CAPI_EXPORTED MlirDynamicOpTrait mlirDynamicOpTraitCreate ( MlirTypeID typeID,
MlirDynamicOpTraitCallbacks callbacks,
void * userData )

Create a custom dynamic op trait with the given type ID and callbacks.

Definition at line 85 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

◆ mlirDynamicOpTraitDestroy()

MLIR_CAPI_EXPORTED void mlirDynamicOpTraitDestroy ( MlirDynamicOpTrait dynamicOpTrait)

Destroy the dynamic op trait.

Definition at line 49 of file ExtensibleDialect.cpp.

References unwrap().

◆ mlirDynamicOpTraitIsTerminatorCreate()

MLIR_CAPI_EXPORTED MlirDynamicOpTrait mlirDynamicOpTraitIsTerminatorCreate ( void )

Get the dynamic op trait that indicates the operation is a terminator.

Definition at line 41 of file ExtensibleDialect.cpp.

References wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicOpTraits::IsTerminator::bind().

◆ mlirDynamicOpTraitNoTerminatorCreate()

MLIR_CAPI_EXPORTED MlirDynamicOpTrait mlirDynamicOpTraitNoTerminatorCreate ( void )

Get the dynamic op trait that indicates regions have no terminator.

Definition at line 45 of file ExtensibleDialect.cpp.

References wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicOpTraits::NoTerminator::bind().

◆ mlirDynamicTypeDefinitionGetDialect()

MLIR_CAPI_EXPORTED MlirDialect mlirDynamicTypeDefinitionGetDialect ( MlirDynamicTypeDefinition typeDef)

Get the dialect that the given dynamic type definition belongs to.

Definition at line 143 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicType::bindDerived().

◆ mlirDynamicTypeDefinitionGetName()

MLIR_CAPI_EXPORTED MlirStringRef mlirDynamicTypeDefinitionGetName ( MlirDynamicTypeDefinition typeDef)

Get the name of the given dynamic type definition.

Definition at line 138 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicType::bindDerived().

◆ mlirDynamicTypeDefinitionGetTypeID()

MLIR_CAPI_EXPORTED MlirTypeID mlirDynamicTypeDefinitionGetTypeID ( MlirDynamicTypeDefinition typeDef)

Get the type ID of a dynamic type definition.

Definition at line 133 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicType::bindDerived().

◆ mlirDynamicTypeGet()

MLIR_CAPI_EXPORTED MlirType mlirDynamicTypeGet ( MlirDynamicTypeDefinition typeDef,
MlirAttribute * attrs,
intptr_t numAttrs )

Get a dynamic type by instantiating the given type definition with the provided attributes.

Definition at line 110 of file ExtensibleDialect.cpp.

References mlir::DynamicType::get(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicType::bindDerived().

◆ mlirDynamicTypeGetNumParams()

MLIR_CAPI_EXPORTED intptr_t mlirDynamicTypeGetNumParams ( MlirType type)

Get the number of parameters in the given dynamic type.

Definition at line 120 of file ExtensibleDialect.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicType::bindDerived().

◆ mlirDynamicTypeGetParam()

MLIR_CAPI_EXPORTED MlirAttribute mlirDynamicTypeGetParam ( MlirType type,
intptr_t index )

Get the parameter at the given index in the provided dynamic type.

Definition at line 124 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicType::bindDerived().

◆ mlirDynamicTypeGetTypeDef()

MLIR_CAPI_EXPORTED MlirDynamicTypeDefinition mlirDynamicTypeGetTypeDef ( MlirType type)

Get the type definition of the given dynamic type.

Definition at line 128 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDynamicType::bindDerived().

◆ mlirExtensibleDialectLookupAttrDefinition()

MLIR_CAPI_EXPORTED MlirDynamicAttrDefinition mlirExtensibleDialectLookupAttrDefinition ( MlirDialect dialect,
MlirStringRef attrName )

Look up a registered attribute definition by attribute name in the given dialect.

Note that the dialect must be an extensible dialect.

Definition at line 148 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

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

◆ mlirExtensibleDialectLookupTypeDefinition()

MLIR_CAPI_EXPORTED MlirDynamicTypeDefinition mlirExtensibleDialectLookupTypeDefinition ( MlirDialect dialect,
MlirStringRef typeName )

Look up a registered type definition by type name in the given dialect.

Note that the dialect must be an extensible dialect.

Definition at line 96 of file ExtensibleDialect.cpp.

References unwrap(), and wrap().

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

◆ mlirTypeIsADynamicType()

MLIR_CAPI_EXPORTED bool mlirTypeIsADynamicType ( MlirType type)

Check if the given type is a dynamic type.

Definition at line 102 of file ExtensibleDialect.cpp.

References unwrap().