[Mlir-commits] [mlir] [mlir][mesh] Use tensor shape notation for the shape of a cluster (PR #73826)
Mehdi Amini
llvmlistbot at llvm.org
Wed Nov 29 11:32:30 PST 2023
================
@@ -1822,3 +1823,43 @@ AffineMap mlir::makeStridedLinearLayoutMap(ArrayRef<int64_t> strides,
return AffineMap::get(strides.size(), nSymbols, expr);
}
+
+void mlir::printShape(OpAsmPrinter &printer, Operation *op,
+ ArrayRef<int64_t> shape) {
+ if (!shape.empty())
+ printer << "[";
+
+ for (size_t i = 0; i < shape.size(); ++i) {
+ if (ShapedType::isDynamic(shape[i]))
+ printer << '?';
+ else
+ printer << shape[i];
+ if (i != shape.size() - 1) {
+ printer << 'x';
+ }
+ }
----------------
joker-eph wrote:
We don't have a helper for this?
https://github.com/llvm/llvm-project/pull/73826
More information about the Mlir-commits
mailing list