[Mlir-commits] [mlir] 2db190f - [mlir][tensor][NFC] Move function comments to where they are declared. (#94002)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri May 31 13:21:48 PDT 2024
Author: Han-Chung Wang
Date: 2024-05-31T13:21:44-07:00
New Revision: 2db190fda609b4df3aa0bf17336ab64bc15f6115
URL: https://github.com/llvm/llvm-project/commit/2db190fda609b4df3aa0bf17336ab64bc15f6115
DIFF: https://github.com/llvm/llvm-project/commit/2db190fda609b4df3aa0bf17336ab64bc15f6115.diff
LOG: [mlir][tensor][NFC] Move function comments to where they are declared. (#94002)
According to LLVM style guide, we prefer putting the documentation
comments for public APIs into the header file.
See
https://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments
for more details.
Added:
Modified:
mlir/include/mlir/Dialect/Tensor/Utils/Utils.h
mlir/lib/Dialect/Tensor/Utils/Utils.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Tensor/Utils/Utils.h b/mlir/include/mlir/Dialect/Tensor/Utils/Utils.h
index d09c9e36f6ff8..84d06d456bb68 100644
--- a/mlir/include/mlir/Dialect/Tensor/Utils/Utils.h
+++ b/mlir/include/mlir/Dialect/Tensor/Utils/Utils.h
@@ -32,9 +32,22 @@ FailureOr<RankedTensorType>
computeTransposedType(RankedTensorType rankedTensorType,
ArrayRef<int64_t> transposeVector);
+/// Shell function to compute the Destination Permutation of PackOp
+/// This function uses the helper function `computePackUnPackPerm` to get
+/// the permutation vector. Only major
diff erence between UnPack and Pack is
+/// that packOp uses destination rank whereas unpack Uses source rank.
SmallVector<int64_t> getPackInverseDestPerm(tensor::PackOp packOp);
+
+/// Shell function to compute the Source Permutation of unPackOp.
+/// This function, like the getPackInverseDestPerm uses the helper function
+/// computePackUnPackPerm` to get the permutation vector.
+/// Only major
diff erence between UnPack and Pack is that packOp uses
+/// destination rank whereas unpack Uses source rank.
SmallVector<int64_t> getUnPackInverseSrcPerm(tensor::UnPackOp unpackOp);
+/// Shell function to compute the Source rank permutation for unpackOp
+/// Unpack requires some packing metadata data information, so created
+/// another function where this value is passed by reference.
SmallVector<int64_t> getUnPackInverseSrcPerm(tensor::UnPackOp,
PackingMetadata &metadata);
diff --git a/mlir/lib/Dialect/Tensor/Utils/Utils.cpp b/mlir/lib/Dialect/Tensor/Utils/Utils.cpp
index 15381ec520e21..8909c5879774a 100644
--- a/mlir/lib/Dialect/Tensor/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/Tensor/Utils/Utils.cpp
@@ -72,6 +72,7 @@ mlir::tensor::computeTransposedType(RankedTensorType rankedTensorType,
RTTBuilder(rankedTensorType).setShape(transposedShape);
return transposedTensorType;
}
+
/// The permutation can be obtained from two permutations:
/// a) Compute the permutation vector to move the last `numPackedDims` into
/// the `innerPosDims` of a shape of rank `rank`.
@@ -100,10 +101,6 @@ computePackUnPackPerm(int64_t rank, ArrayRef<int64_t> &innerDimsPos,
return packInverseDestPermutation;
}
-/// Shell function to compute the Destination Permutation of PackOp
-/// This function uses the helper function `computePackUnPackPerm` to get
-/// the permutation vector. Only major
diff erence between UnPack and Pack is
-/// that packOp uses destination rank whereas unpack Uses source rank.
SmallVector<int64_t> mlir::tensor::getPackInverseDestPerm(PackOp packOp) {
PackingMetadata pMetadata;
@@ -115,19 +112,11 @@ SmallVector<int64_t> mlir::tensor::getPackInverseDestPerm(PackOp packOp) {
return packInvDestPerm;
}
-/// Shell function to compute the Source Permutation of unPackOp.
-/// This function, like the getPackInverseDestPerm uses the helper function
-/// computePackUnPackPerm` to get the permutation vector.
-/// Only major
diff erence between UnPack and Pack is that packOp uses
-/// destination rank whereas unpack Uses source rank.
SmallVector<int64_t> mlir::tensor::getUnPackInverseSrcPerm(UnPackOp unpackOp) {
PackingMetadata metadata;
return mlir::tensor::getUnPackInverseSrcPerm(unpackOp, metadata);
}
-/// Shell function to compute the Source rank permutation for unpackOp
-/// Unpack requires some packing metadata data information, so created
-/// another function where this value is passed by reference.
SmallVector<int64_t>
mlir::tensor::getUnPackInverseSrcPerm(UnPackOp unpackOp,
PackingMetadata &metadata) {
More information about the Mlir-commits
mailing list