[PATCH] D80657: [mlir][Linalg] Fix build failure from D80188

Mahesh Ravishankar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 13:02:55 PDT 2020


mravishankar created this revision.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: nicolasvasilache.
Herald added a project: LLVM.
nicolasvasilache accepted this revision.
This revision is now accepted and ready to land.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80657

Files:
  mlir/lib/Dialect/Linalg/Utils/Utils.cpp


Index: mlir/lib/Dialect/Linalg/Utils/Utils.cpp
===================================================================
--- mlir/lib/Dialect/Linalg/Utils/Utils.cpp
+++ mlir/lib/Dialect/Linalg/Utils/Utils.cpp
@@ -129,25 +129,29 @@
 template struct mlir::linalg::GenerateLoopNest<scf::ParallelOp>;
 template struct mlir::linalg::GenerateLoopNest<AffineForOp>;
 
+namespace mlir {
+namespace linalg {
 /// Specialization of loop nest generator for scf.parallel loops to handle
 /// iterator types that are not parallel. These are generated as sequential
 /// loops.
 template <>
-void mlir::linalg::GenerateLoopNest<scf::ForOp>::doit(
-    MutableArrayRef<Value> allIvs, ArrayRef<SubViewOp::Range> loopRanges,
-    ArrayRef<Attribute> iteratorTypes, std::function<void(void)> fun) {
+void GenerateLoopNest<scf::ForOp>::doit(MutableArrayRef<Value> allIvs,
+                                        ArrayRef<SubViewOp::Range> loopRanges,
+                                        ArrayRef<Attribute> iteratorTypes,
+                                        std::function<void(void)> fun) {
   edsc::GenericLoopNestRangeBuilder<scf::ForOp>(allIvs, loopRanges)(fun);
 }
 
 template <>
-void mlir::linalg::GenerateLoopNest<AffineForOp>::doit(
-    MutableArrayRef<Value> allIvs, ArrayRef<SubViewOp::Range> loopRanges,
-    ArrayRef<Attribute> iteratorTypes, std::function<void(void)> fun) {
+void GenerateLoopNest<AffineForOp>::doit(MutableArrayRef<Value> allIvs,
+                                         ArrayRef<SubViewOp::Range> loopRanges,
+                                         ArrayRef<Attribute> iteratorTypes,
+                                         std::function<void(void)> fun) {
   edsc::GenericLoopNestRangeBuilder<AffineForOp>(allIvs, loopRanges)(fun);
 }
 
 template <>
-void mlir::linalg::GenerateLoopNest<scf::ParallelOp>::doit(
+void GenerateLoopNest<scf::ParallelOp>::doit(
     MutableArrayRef<Value> allIvs, ArrayRef<SubViewOp::Range> loopRanges,
     ArrayRef<Attribute> iteratorTypes, std::function<void(void)> fun) {
   // Check if there is nothing to do here. This is also the recursion
@@ -190,3 +194,5 @@
       allIvs.take_front(nOuterPar), loopRanges.take_front(nOuterPar),
       iteratorTypes.take_front(nOuterPar), nestedFn);
 }
+} // namespace linalg
+} // namespace mlir


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80657.266633.patch
Type: text/x-patch
Size: 2295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200527/fece1f94/attachment.bin>


More information about the llvm-commits mailing list