Introduce the initial support for operation interfaces in C API and Python bindings. Interfaces are a key component of MLIR's extensibility and should be available in bindings to make use of full potential of MLIR. This initial implementation exposes InferTypeOpInterface all the way to the Python bindings since it can be later used to simplify the operation construction methods by inferring their return types instead of requiring the user to do so. The general infrastructure for binding interfaces is defined and InferTypeOpInterface can be used as an example for binding other interfaces. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D111656
22 lines
729 B
C++
22 lines
729 B
C++
//===- PythonTestDialect.h - PythonTest dialect definition ------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef MLIR_TEST_PYTHON_LIB_PYTHONTESTDIALECT_H
|
|
#define MLIR_TEST_PYTHON_LIB_PYTHONTESTDIALECT_H
|
|
|
|
#include "mlir/IR/Dialect.h"
|
|
#include "mlir/IR/OpImplementation.h"
|
|
#include "mlir/Interfaces/InferTypeOpInterface.h"
|
|
|
|
#include "PythonTestDialect.h.inc"
|
|
|
|
#define GET_OP_CLASSES
|
|
#include "PythonTestOps.h.inc"
|
|
|
|
#endif // MLIR_TEST_PYTHON_LIB_PYTHONTESTDIALECT_H
|