@@ -56,8 +56,8 @@ LinearLayout identityND(StringAttr inDimName, ArrayRef<unsigned> shape,
5656 LinearLayout ret = LinearLayout::empty ();
5757 for (int i = 0 ; i < shape.size (); i++) {
5858 // Start with the most-minor dimension, which is order[0].
59- std::cout << " i: " << i << " shape[i]: " << shape[i]
60- << " order[i]: " << order[i] << std::endl;
59+ // std::cout << "i: " << i << " shape[i]: " << shape[i]
60+ // << " order[i]: " << order[i] << std::endl;
6161 int dim = order[i];
6262 ret *= LinearLayout::identity1D (shape[dim], inDimName, outDimNames[dim]);
6363 }
@@ -291,15 +291,16 @@ LinearLayout ensureLayoutNotSmallerThan(
291291 assert (actualSize > desiredSize ||
292292 desiredSize % actualSize == 0 && " bad shape" );
293293 ret *= LinearLayout::identity1D (desiredSize / actualSize, kDim , outDimName);
294- std::cout << " actualSize: " << actualSize << " desiredSize: " << desiredSize
295- << std::endl;
296- std::cout << " outDimName: " << outDimName.str () << std::endl;
297- std::cout << " identity1D: "
298- << LinearLayout::identity1D (desiredSize / actualSize, kDim ,
299- outDimName)
300- .toString ()
301- << std::endl;
302- std::cout << " ret: " << ret.toString () << std::endl;
294+ // std::cout << "actualSize: " << actualSize << " desiredSize: " <<
295+ // desiredSize
296+ // << std::endl;
297+ // std::cout << "outDimName: " << outDimName.str() << std::endl;
298+ // std::cout << "identity1D: "
299+ // << LinearLayout::identity1D(desiredSize / actualSize, kDim,
300+ // outDimName)
301+ // .toString()
302+ // << std::endl;
303+ // std::cout << "ret: " << ret.toString() << std::endl;
303304 assert (ret.getOutDimSize (outDimName) >= desiredSize && " bad grow" );
304305 }
305306 return ret;
@@ -327,8 +328,8 @@ LinearLayout combineCtaCgaWithShape(LinearLayout ctaLayout,
327328 for (auto s : shape) {
328329 std::cout << s << " , " ;
329330 }
330-
331331 std::cout << std::endl;
332+
332333 llvm::SmallDenseMap<StringAttr, int64_t > labeledShape;
333334 for (auto [dim, size] : llvm::zip (outDimNames, shape)) {
334335 labeledShape[dim] = size;
@@ -337,7 +338,7 @@ LinearLayout combineCtaCgaWithShape(LinearLayout ctaLayout,
337338 LinearLayout cgaLayout =
338339 ensureLayoutNotLargerThan (makeCgaLayout (cgaLayoutAttr), labeledShape)
339340 .transposeOuts (llvm::to_vector (ctaLayout.getOutDimNames ()));
340- std::cout << " \n cgaLayout: " << cgaLayout.toString () << std::endl;
341+ // std::cout << "\ncgaLayout: " << cgaLayout.toString() << std::endl;
341342
342343 // Calculate the shape of the ctaLayout, which is `shape` divided by the
343344 // cgaLayout's size.
@@ -346,29 +347,32 @@ LinearLayout combineCtaCgaWithShape(LinearLayout ctaLayout,
346347 llvm::to_vector (cgaLayout.getOutDimNames ()) &&
347348 " bad layout" );
348349
349- std::cout << " ctaShape: " ;
350+ // std::cout << "ctaShape: ";
350351 for (auto dim : ctaLayout.getOutDimNames ()) {
351352 ctaShape[dim] =
352353 std::max (int64_t {1 }, labeledShape[dim] / cgaLayout.getOutDimSize (dim));
353- std::cout << ctaShape[dim] << " , " ;
354+ // std::cout << ctaShape[dim] << ", ";
354355 }
355- std::cout << std::endl;
356+ // std::cout << std::endl;
356357
358+ std::cout << " ensureLayoutNotSmallerThan start" << std::endl;
357359 ctaLayout = ensureLayoutNotSmallerThan (ctaLayout, ctaShape);
358- std::cout << " \n ctaLayout not smaller than: " << ctaLayout.toString ()
359- << std::endl;
360+ // std::cout << "\nctaLayout not smaller than: " << ctaLayout.toString()
361+ // << std::endl;
362+ std::cout << " ensureLayoutNotLargerThan start" << std::endl;
360363 ctaLayout = ensureLayoutNotLargerThan (ctaLayout, ctaShape);
361- std::cout << " \n ctaLayout not larger than: " << ctaLayout.toString ()
362- << std::endl;
364+ // std::cout << "\nctaLayout not larger than: " << ctaLayout.toString()
365+ // << std::endl;
363366
364- std::cout << " \n cta * cga: " << (ctaLayout * cgaLayout).toString ()
365- << std::endl;
367+ // std::cout << "\ncta * cga: " << (ctaLayout * cgaLayout).toString()
368+ // << std::endl;
366369 LinearLayout ret =
367370 (std::move (ctaLayout) * std::move (cgaLayout)).transposeOuts (outDimNames);
368371 for (auto dim : ret.getOutDimNames ()) {
369372 assert (ret.getOutDimSize (dim) == labeledShape[dim] && " bad shape" );
370373 }
371- std::cout << " \n combineCtaCgaWithShape: " << ret.toString () << std::endl;
374+ // std::cout << "\ncombineCtaCgaWithShape: " << ret.toString() << std::endl;
375+ std::cout << " combineCtaCgaWithShape end" << std::endl;
372376 return ret;
373377}
374378
@@ -593,26 +597,26 @@ LinearLayout DPAStoLinearLayout(ArrayRef<int64_t> shape, Attribute layout,
593597 DPASLaneBasesC (repeatCount, executionSize, threadsPerWarp);
594598 tileLayout = LinearLayout ({{kRegister , regBasesC}, {kLane , laneBasesC}},
595599 ArrayRef (outDimNames).take_back (2 ));
596- std::cout << tileLayout.toString () << std::endl;
600+ // std::cout << tileLayout.toString() << std::endl;
597601 // The per-inst layout is repeated at each repCluster.
598602 // Hence, multiply with the identity layouts starting from the
599603 // least significant dimension.
600604 dimNonK = rank - 2 ;
601605 dimK = rank - 1 ;
602606 tileLayout *= LinearLayout::identity1D (repCluster[dimK], kRegister ,
603607 outDimNames[dimK]);
604- std::cout << (LinearLayout::identity1D (repCluster[dimK], kRegister ,
605- outDimNames[dimK])
606- .toString ())
607- << std::endl;
608- std::cout << (tileLayout.toString ()) << std::endl;
608+ // std::cout << (LinearLayout::identity1D(repCluster[dimK], kRegister,
609+ // outDimNames[dimK])
610+ // .toString())
611+ // << std::endl;
612+ // std::cout << (tileLayout.toString()) << std::endl;
609613 tileLayout *= LinearLayout::identity1D (repCluster[dimNonK], kRegister ,
610614 outDimNames[dimNonK]);
611- std::cout << (LinearLayout::identity1D (repCluster[dimNonK], kRegister ,
612- outDimNames[dimNonK])
613- .toString ())
614- << std::endl;
615- std::cout << (tileLayout.toString ()) << std::endl;
615+ // std::cout << (LinearLayout::identity1D(repCluster[dimNonK], kRegister,
616+ // outDimNames[dimNonK])
617+ // .toString())
618+ // << std::endl;
619+ // std::cout << (tileLayout.toString()) << std::endl;
616620
617621 // // The identical layout is repeated among warps
618622 tileLayout *=
@@ -622,7 +626,7 @@ LinearLayout DPAStoLinearLayout(ArrayRef<int64_t> shape, Attribute layout,
622626 if (rank == 3 )
623627 tileLayout *=
624628 LinearLayout::identity1D (warpsPerCTA[0 ], kWarp , outDimNames[0 ]);
625- std::cout << (tileLayout.toString ()) << std::endl;
629+ // std::cout << (tileLayout.toString()) << std::endl;
626630 }
627631
628632 // Lastly, the layout repeats to match the shape.
@@ -647,8 +651,9 @@ LinearLayout DPAStoLinearLayout(ArrayRef<int64_t> shape, Attribute layout,
647651 if (rank == 3 )
648652 tileLayout *=
649653 LinearLayout::identity1D (numReps[0 ], kRegister , outDimNames[0 ]);
650- std::cout << " \n tileLayout with DPASRepetition: " << (tileLayout.toString ())
651- << std::endl;
654+ // std::cout << "\ntileLayout with DPASRepetition: " <<
655+ // (tileLayout.toString())
656+ // << std::endl;
652657
653658 return combineCtaCgaWithShape (std::move (tileLayout),
654659 CTALayoutAttr::getDefault (ctx, rank), shape);
0 commit comments