1 //===- DialectLinalg.cpp - Pybind module for Linalg dialect API support --===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "IRModule.h" 10 #include "mlir-c/Dialect/Linalg.h" 11 #include "mlir-c/IR.h" 12 13 #include <pybind11/pybind11.h> 14 15 namespace py = pybind11; 16 using namespace mlir; 17 using namespace mlir::python; 18 19 namespace mlir { 20 namespace python { 21 22 void populateDialectLinalgSubmodule(py::module &m) { 23 m.def( 24 "fill_builtin_region", 25 [](PyDialectDescriptor &dialect, PyOperation &op) { 26 return mlirLinalgFillBuiltinNamedOpRegion(dialect.get(), op.get()); 27 }, 28 py::arg("dialect"), py::arg("op"), 29 "Fill the region for `op`, which is assumed to be a builtin named Linalg " 30 "op."); 31 } 32 33 } // namespace python 34 } // namespace mlir 35