Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir][Linalg][Python] Create the body of builtin named Linalg ops
This revision adds support to properly add the body of registered builtin named linalg ops. At this time, indexing_map and iterator_type support is still missing so the op is not executable yet. Differential Revision: https://reviews.llvm.org/D99578
- Loading branch information
1 parent
465b9a4
commit 43b9fa3
Showing
12 changed files
with
196 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//===- DialectLinalg.cpp - Pybind module for Linalg dialect API support --===// | ||
// | ||
// 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 "IRModule.h" | ||
#include "mlir-c/Dialect/Linalg.h" | ||
#include "mlir-c/IR.h" | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace py = pybind11; | ||
using namespace mlir; | ||
using namespace mlir::python; | ||
|
||
namespace mlir { | ||
namespace python { | ||
|
||
void populateDialectLinalgSubmodule(py::module &m) { | ||
m.def( | ||
"fill_builtin_region", | ||
[](PyDialectDescriptor &dialect, PyOperation &op) { | ||
return mlirLinalgFillBuiltinNamedOpRegion(dialect.get(), op.get()); | ||
}, | ||
py::arg("dialect"), py::arg("op"), | ||
"Fill the region for `op`, which is assumed to be a builtin named Linalg " | ||
"op."); | ||
} | ||
|
||
} // namespace python | ||
} // namespace mlir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//===- DialectLinalg.h - Linalg dialect submodule of pybind module --------===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef MLIR_BINDINGS_PYTHON_DIALECTLINALG_H | ||
#define MLIR_BINDINGS_PYTHON_DIALECTLINALG_H | ||
|
||
#include "PybindUtils.h" | ||
|
||
namespace mlir { | ||
namespace python { | ||
|
||
void populateDialectLinalgSubmodule(pybind11::module &m); | ||
|
||
} // namespace python | ||
} // namespace mlir | ||
|
||
#endif // MLIR_BINDINGS_PYTHON_DIALECTLINALG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters