[Mlir-commits] [mlir] [mlir][mesh] Use tensor shape notation for the shape of a cluster (PR #73826)
Boian Petkantchin
llvmlistbot at llvm.org
Thu Nov 30 09:05:52 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';
+ }
+ }
----------------
sogartar wrote:
I added the new common function.
https://github.com/llvm/llvm-project/pull/73826
More information about the Mlir-commits
mailing list