[mlir][transform][gpu][python] Add .td file for bindings.
authorIngo Müller <ingomueller@google.com>
Tue, 18 Jul 2023 15:02:32 +0000 (15:02 +0000)
committerIngo Müller <ingomueller@google.com>
Wed, 19 Jul 2023 15:34:59 +0000 (15:34 +0000)
Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D155602

mlir/python/CMakeLists.txt
mlir/python/mlir/dialects/GPUTransformOps.td [new file with mode: 0644]
mlir/python/mlir/dialects/transform/gpu.py [new file with mode: 0644]

index 22a55db..e5d37b2 100644 (file)
@@ -146,6 +146,15 @@ declare_mlir_dialect_extension_python_bindings(
 declare_mlir_dialect_extension_python_bindings(
   ADD_TO_PARENT MLIRPythonSources.Dialects
   ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"
+  TD_FILE dialects/GPUTransformOps.td
+  SOURCES
+    dialects/transform/gpu.py
+  DIALECT_NAME transform
+  EXTENSION_NAME gpu_transform)
+
+declare_mlir_dialect_extension_python_bindings(
+  ADD_TO_PARENT MLIRPythonSources.Dialects
+  ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"
   TD_FILE dialects/SCFLoopTransformOps.td
   SOURCES
     dialects/_loop_transform_ops_ext.py
diff --git a/mlir/python/mlir/dialects/GPUTransformOps.td b/mlir/python/mlir/dialects/GPUTransformOps.td
new file mode 100644 (file)
index 0000000..08bd953
--- /dev/null
@@ -0,0 +1,20 @@
+//===-- GPUTransformOps.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 GPU dialect.
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef PYTHON_BINDINGS_GPU_TRANSFORM_OPS
+#define PYTHON_BINDINGS_GPU_TRANSFORM_OPS
+
+include "mlir/Dialect/GPU/TransformOps/GPUTransformOps.td"
+
+#endif // PYTHON_BINDINGS_GPU_TRANSFORM_OPS
diff --git a/mlir/python/mlir/dialects/transform/gpu.py b/mlir/python/mlir/dialects/transform/gpu.py
new file mode 100644 (file)
index 0000000..8c3de0d
--- /dev/null
@@ -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 .._gpu_transform_ops_gen import *