From 14c9207063bb00823a5126131e50c93f6e288bd3 Mon Sep 17 00:00:00 2001 From: Alex Zinenko Date: Thu, 14 Oct 2021 17:18:28 +0200 Subject: [mlir] support interfaces in Python bindings 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 --- mlir/test/python/lib/PythonTestCAPI.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mlir/test/python/lib/PythonTestCAPI.cpp (limited to 'mlir/test/python/lib/PythonTestCAPI.cpp') diff --git a/mlir/test/python/lib/PythonTestCAPI.cpp b/mlir/test/python/lib/PythonTestCAPI.cpp new file mode 100644 index 000000000000..474476e74198 --- /dev/null +++ b/mlir/test/python/lib/PythonTestCAPI.cpp @@ -0,0 +1,14 @@ +//===- PythonTestCAPI.cpp - C API for the PythonTest dialect --------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#include "PythonTestCAPI.h" +#include "PythonTestDialect.h" +#include "mlir/CAPI/Registration.h" + +MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(PythonTest, python_test, + python_test::PythonTestDialect) -- cgit v1.2.3