[Mlir-commits] [mlir] [WIP][mlir][sparse] Enable explicit and implicit value in sparse encoding (PR #88975)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Apr 16 12:49:26 PDT 2024


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 37b7207651b44743909a427b5509bed5e6c21b59 0ba7c454306c14b007a5fc4c8f48b6a0b861a6a3 -- mlir/include/mlir-c/Dialect/SparseTensor.h mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h mlir/lib/Bindings/Python/DialectSparseTensor.cpp mlir/lib/CAPI/Dialect/SparseTensor.cpp mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp mlir/test/CAPI/sparse_tensor.c
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/test/CAPI/sparse_tensor.c b/mlir/test/CAPI/sparse_tensor.c
index e387079d5d..22b7052b73 100644
--- a/mlir/test/CAPI/sparse_tensor.c
+++ b/mlir/test/CAPI/sparse_tensor.c
@@ -58,7 +58,8 @@ static int testRoundtripEncoding(MlirContext ctx) {
   fprintf(stderr, "crdWidth: %d\n", crdWidth);
 
   // CHECK: explicitVal: 1 : i64
-  MlirAttribute explicitVal = mlirSparseTensorEncodingAttrGetExplicitVal(originalAttr);
+  MlirAttribute explicitVal =
+      mlirSparseTensorEncodingAttrGetExplicitVal(originalAttr);
   fprintf(stderr, "explicitVal: ");
   mlirAttributeDump(explicitVal);
   // CHECK: implicitVal: <<NULL ATTRIBUTE>>
@@ -68,7 +69,8 @@ static int testRoundtripEncoding(MlirContext ctx) {
   mlirAttributeDump(implicitVal);
 
   MlirAttribute newAttr = mlirSparseTensorEncodingAttrGet(
-      ctx, lvlRank, lvlTypes, dimToLvl, lvlToDim, posWidth, crdWidth, explicitVal, implicitVal);
+      ctx, lvlRank, lvlTypes, dimToLvl, lvlToDim, posWidth, crdWidth,
+      explicitVal, implicitVal);
   mlirAttributeDump(newAttr); // For debugging filecheck output.
   // CHECK: equal: 1
   fprintf(stderr, "equal: %d\n", mlirAttributeEqual(originalAttr, newAttr));

``````````

</details>


https://github.com/llvm/llvm-project/pull/88975


More information about the Mlir-commits mailing list