MLIR  16.0.0git
Functions
Interfaces.cpp File Reference
#include "mlir-c/Interfaces.h"
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/Support.h"
#include "mlir/CAPI/Wrap.h"
#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "llvm/ADT/ScopeExit.h"
+ Include dependency graph for Interfaces.cpp:

Go to the source code of this file.

Functions

bool mlirOperationImplementsInterface (MlirOperation operation, MlirTypeID interfaceTypeID)
 Returns true if the given operation implements an interface identified by its TypeID. More...
 
bool mlirOperationImplementsInterfaceStatic (MlirStringRef operationName, MlirContext context, MlirTypeID interfaceTypeID)
 Returns true if the operation identified by its canonical string name implements the interface identified by its TypeID in the given context. More...
 
MlirTypeID mlirInferTypeOpInterfaceTypeID ()
 Returns the interface TypeID of the InferTypeOpInterface. More...
 
MlirLogicalResult mlirInferTypeOpInterfaceInferReturnTypes (MlirStringRef opName, MlirContext context, MlirLocation location, intptr_t nOperands, MlirValue *operands, MlirAttribute attributes, intptr_t nRegions, MlirRegion *regions, MlirTypesCallback callback, void *userData)
 Infers the return types of the operation identified by its canonical given the arguments that will be supplied to its generic builder. More...
 

Function Documentation

◆ mlirInferTypeOpInterfaceInferReturnTypes()

MlirLogicalResult mlirInferTypeOpInterfaceInferReturnTypes ( MlirStringRef  opName,
MlirContext  context,
MlirLocation  location,
intptr_t  nOperands,
MlirValue *  operands,
MlirAttribute  attributes,
intptr_t  nRegions,
MlirRegion *  regions,
MlirTypesCallback  callback,
void *  userData 
)

Infers the return types of the operation identified by its canonical given the arguments that will be supplied to its generic builder.

Calls callback with the types of inferred arguments, potentially several times, on success. Returns failure otherwise.

Definition at line 38 of file Interfaces.cpp.

References MlirStringRef::data, mlir::failed(), MlirStringRef::length, mlir::RegisteredOperationName::lookup(), mlirAttributeIsNull(), mlirLocationIsNull(), mlirLogicalResultFailure(), mlirLogicalResultSuccess(), unwrap(), unwrapList(), and wrap().

Referenced by mlir::python::PyInferTypeOpInterface::inferReturnTypes().

◆ mlirInferTypeOpInterfaceTypeID()

MlirTypeID mlirInferTypeOpInterfaceTypeID ( )

Returns the interface TypeID of the InferTypeOpInterface.

Definition at line 34 of file Interfaces.cpp.

References wrap().

◆ mlirOperationImplementsInterface()

bool mlirOperationImplementsInterface ( MlirOperation  operation,
MlirTypeID  interfaceTypeID 
)

Returns true if the given operation implements an interface identified by its TypeID.

Definition at line 19 of file Interfaces.cpp.

References unwrap().

Referenced by mlir::python::PyConcreteOpInterface< ConcreteIface >::PyConcreteOpInterface().

◆ mlirOperationImplementsInterfaceStatic()

bool mlirOperationImplementsInterfaceStatic ( MlirStringRef  operationName,
MlirContext  context,
MlirTypeID  interfaceTypeID 
)

Returns true if the operation identified by its canonical string name implements the interface identified by its TypeID in the given context.

Note that interfaces may be attached to operations in some contexts and not others.

Definition at line 26 of file Interfaces.cpp.

References MlirStringRef::data, MlirStringRef::length, mlir::RegisteredOperationName::lookup(), and unwrap().

Referenced by mlir::python::PyConcreteOpInterface< ConcreteIface >::PyConcreteOpInterface().