[mlir][transform][tensor][python] Add .td files for bindings.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D156914
This commit is contained in:
Ingo Müller 2023-08-02 16:58:44 +00:00
parent a093598e50
commit 1b5a3c90cc
4 changed files with 54 additions and 0 deletions

View File

@ -202,6 +202,15 @@ declare_mlir_dialect_extension_python_bindings(
DIALECT_NAME transform
EXTENSION_NAME structured_transform)
declare_mlir_dialect_extension_python_bindings(
ADD_TO_PARENT MLIRPythonSources.Dialects
ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"
TD_FILE dialects/TensorTransformOps.td
SOURCES
dialects/transform/tensor.py
DIALECT_NAME transform
EXTENSION_NAME tensor_transform)
declare_mlir_dialect_extension_python_bindings(
ADD_TO_PARENT MLIRPythonSources.Dialects
ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"

View File

@ -0,0 +1,20 @@
//===-- TensorTransformOps.td ------------------------------*- tablegen -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// Entry point of the Python bindings generator for the transform ops provided
// by the tensor dialect.
//
//===----------------------------------------------------------------------===//
#ifndef PYTHON_BINDINGS_TENSOR_TRANSFORM_OPS
#define PYTHON_BINDINGS_TENSOR_TRANSFORM_OPS
include "mlir/Dialect/Tensor/TransformOps/TensorTransformOps.td"
#endif // PYTHON_BINDINGS_TENSOR_TRANSFORM_OPS

View File

@ -0,0 +1,5 @@
# 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
from .._tensor_transform_ops_gen import *

View File

@ -909,6 +909,25 @@ gentbl_filegroup(
],
)
gentbl_filegroup(
name = "TensorTransformOpsPyGen",
tbl_outs = [
(
[
"-gen-python-op-bindings",
"-bind-dialect=transform",
"-dialect-extension=tensor_transform",
],
"mlir/dialects/_tensor_transform_ops_gen.py",
),
],
tblgen = "//mlir:mlir-tblgen",
td_file = "mlir/dialects/TensorTransformOps.td",
deps = [
"//mlir:TensorTransformOpsTdFiles",
],
)
gentbl_filegroup(
name = "VectorTransformEnumPyGen",
tbl_outs = [
@ -964,6 +983,7 @@ filegroup(
":MemRefTransformOpsPyGen",
":PDLTransformOpsPyGen",
":StructuredTransformOpsPyGen",
":TensorTransformOpsPyGen",
":TransformEnumPyGen",
":TransformOpsPyGen",
":VectorTransformEnumPyGen",