[Mlir-commits] [mlir] [MLIR][CAPI][python] expose the python binding for linalgOp.getIndexingMaps (PR #136054)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Apr 16 16:34:27 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- mlir/include/mlir-c/Dialect/Linalg.h mlir/lib/Bindings/Python/DialectLinalg.cpp mlir/lib/CAPI/Dialect/Linalg.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Bindings/Python/DialectLinalg.cpp b/mlir/lib/Bindings/Python/DialectLinalg.cpp
index e18d21886..8f8519a8b 100644
--- a/mlir/lib/Bindings/Python/DialectLinalg.cpp
+++ b/mlir/lib/Bindings/Python/DialectLinalg.cpp
@@ -120,10 +120,11 @@ static void populateDialectLinalgSubmodule(nb::module_ m) {
m.def("infer_convolution_dimensions", &InferConvolutionDimensions,
"Infers convolution dimensions", nb::arg("op"));
-
+
m.def("get_indexing_maps_attr", &mlirLinalgGetIndexingMapsAttribute,
- "Returns the indexing_maps or memoized_indexing_maps attribute for a Linalg op.",
- nb::arg("op"));
+ "Returns the indexing_maps or memoized_indexing_maps attribute for a "
+ "Linalg op.",
+ nb::arg("op"));
}
NB_MODULE(_mlirDialectsLinalg, m) {
diff --git a/mlir/lib/CAPI/Dialect/Linalg.cpp b/mlir/lib/CAPI/Dialect/Linalg.cpp
index f940ed857..c744a7ae4 100644
--- a/mlir/lib/CAPI/Dialect/Linalg.cpp
+++ b/mlir/lib/CAPI/Dialect/Linalg.cpp
@@ -120,7 +120,8 @@ mlirLinalgInferConvolutionDimensions(MlirOperation op) {
return result;
}
-MLIR_CAPI_EXPORTED MlirAttribute mlirLinalgGetIndexingMapsAttribute(MlirOperation op) {
+MLIR_CAPI_EXPORTED MlirAttribute
+mlirLinalgGetIndexingMapsAttribute(MlirOperation op) {
auto linalgOp = mlir::dyn_cast<mlir::linalg::LinalgOp>(unwrap(op));
if (!linalgOp)
return MlirAttribute{nullptr};
``````````
</details>
https://github.com/llvm/llvm-project/pull/136054
More information about the Mlir-commits
mailing list