[PATCH] D76414: [mlir][Linalg] Introduce linalg.pooling_min/max/sum op.

Mahesh Ravishankar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 11:57:07 PDT 2020


mravishankar accepted this revision.
mravishankar added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: grosul1.

LGTM. Please wait for @nicolasvasilache to accept.



================
Comment at: mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:957
+SmallVector<AffineExpr, 4>
+mlir::linalg::weightedPoolingInputIndex(PoolingMaxOp op,
+                                        ArrayRef<AffineExpr> outputDims,
----------------
NIT: Just add a macro  for the indirection.

You could achieve the same thing by making the weightedPoolingInputIndex function extern template function.

So make the definition

```
template <typename PoolingOp>
extern SmallVector<AffineExpr, 4> weightedPoolingInputIndex(PoolingOp op, ...);
```

and make this

```
template <typename PoolingOp>
SmallVector<AffineExpr, 4> weightedPolingInputIndex(PoolingOp op, ...) { .. }

#define INSTANTIATE_WEIGHTED_POOLING_INPUT_INDEX(opname) \
template SmallVector<AffineExpr, 4> weightedPoolingInputIndex<opname>(opname op, ...);

INSTANTIATE_WEIGHTED_POOLING_INPUT_INDEX(PoolingMinOp);
...
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76414/new/

https://reviews.llvm.org/D76414





More information about the llvm-commits mailing list