#define MLIR_C_DIALECT_LINALG_H
#include "mlir-c/Registration.h"
+#include "mlir-c/Support.h"
#ifdef __cplusplus
extern "C" {
}
#endif
+#include "mlir/Dialect/Linalg/Passes.capi.h.inc"
+
#endif // MLIR_C_DIALECT_LINALG_H
set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls -name Linalg)
+mlir_tablegen(Passes.capi.h.inc -gen-pass-capi-header --prefix Linalg)
+mlir_tablegen(Passes.capi.cpp.inc -gen-pass-capi-impl --prefix Linalg)
add_public_tablegen_target(MLIRLinalgPassIncGen)
add_mlir_doc(Passes -gen-pass-doc LinalgPasses ./)
add_subdirectory(Transforms)
add_subdirectory(Conversions)
+
+add_mlir_python_extension(MLIRLinalgPassesBindingsPythonExtension _mlirLinalgPasses
+ INSTALL_DIR
+ python
+ SOURCES
+ LinalgPasses.cpp
+)
+add_dependencies(MLIRBindingsPythonExtension MLIRLinalgPassesBindingsPythonExtension)
--- /dev/null
+//===- LinalgPasses.cpp - Pybind module for the Linalg passes -------------===//
+//
+// 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 "mlir-c/Dialect/Linalg.h"
+
+#include <pybind11/pybind11.h>
+
+// -----------------------------------------------------------------------------
+// Module initialization.
+// -----------------------------------------------------------------------------
+
+PYBIND11_MODULE(_mlirLinalgPasses, m) {
+ m.doc() = "MLIR Linalg Dialect Passes";
+
+ // Register all Linalg passes on load.
+ mlirRegisterLinalgPasses();
+}
--- /dev/null
+# 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 ...._cext_loader import _load_extension
+_cextLinalgPasses = _load_extension("_mlirLinalgPasses")
# TODO: Make the check source feature optional as an argument on *_add_library.
set(LLVM_OPTIONAL_SOURCES
Linalg.cpp
+ LinalgPasses.cpp
SCF.cpp
Shape.cpp
Standard.cpp
add_mlir_public_c_api_library(MLIRCAPILinalg
Linalg.cpp
+ LinalgPasses.cpp
+
+ DEPENDS
+ MLIRLinalgPassIncGen
LINK_LIBS PUBLIC
MLIRCAPIIR
MLIRLinalg
+ MLIRPass
+ MLIRLinalgTransforms
)
add_mlir_public_c_api_library(MLIRCAPISCF
--- /dev/null
+//===- LinalgPasses.cpp - C API for Linalg Dialect Passes -----------------===//
+//
+// 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 "mlir/CAPI/Pass.h"
+#include "mlir/Dialect/Linalg/Passes.h"
+#include "mlir/Pass/Pass.h"
+
+// Must include the declarations as they carry important visibility attributes.
+#include "mlir/Dialect/Linalg/Passes.capi.h.inc"
+
+using namespace mlir;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "mlir/Dialect/Linalg/Passes.capi.cpp.inc"
+
+#ifdef __cplusplus
+}
+#endif