MLIR  19.0.0git
Namespaces | Functions
ConvertConv2DToImg2Col.cpp File Reference
#include "mlir/Dialect/Affine/Utils.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Complex/IR/Complex.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Utils/ReshapeOpsUtils.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include <utility>

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::linalg
 

Functions

static bool mlir::linalg::hasAllOneValues (DenseIntElementsAttr attr)
 
static Value mlir::linalg::createAdd (Location loc, Value x, Value y, OpBuilder &builder)
 
static Value mlir::linalg::createMul (Location loc, Value x, Value y, Type accType, OpBuilder &builder)
 
static SmallVector< Value > mlir::linalg::unrollIndex (OpBuilder &b, Location loc, Value index, ArrayRef< int64_t > factors)
 
static Value mlir::linalg::getConvolvedIndex (OpBuilder &b, Location loc, Value oIndex, Value fIndex, int64_t stride)
 
FailureOr< std::pair< Operation *, Operation * > > mlir::linalg::rewriteInIm2Col (RewriterBase &rewriter, linalg::Conv2DNhwcHwcfOp convOp)
 Convert linalg.conv_2d_nhwc_hwcf into linalg.generic (for img2col packing) and linalg.matmul. More...
 
FailureOr< std::pair< Operation *, Operation * > > mlir::linalg::rewriteInIm2Col (RewriterBase &rewriter, linalg::DepthwiseConv2DNhwcHwcOp convOp)
 Similar to rewriteInIm2Col with linalg::Conv2DNhwcHwcfOp except there is no reduction among the input channels so each convolution can be a matrix-vector product and by transposing both input filter so channels are outer most the computation is a batched matrix-vector product. More...
 
FailureOr< std::pair< Operation *, Operation * > > mlir::linalg::rewriteInIm2Col (RewriterBase &rewriter, linalg::Conv2DNchwFchwOp convOp)
 Similar to rewriteInIm2Col with linalg::Conv2DNhwcHwcfOp except because the channels are to the left of the image shape dimensions, the position of the contraction dimension in the resulting matmul is reversed. More...
 
FailureOr< std::pair< Operation *, Operation * > > mlir::linalg::rewriteInIm2Col (RewriterBase &rewriter, linalg::Conv2DNhwcFhwcOp convOp)
 Same as the above but for Fhwc channel orderings in the filter. More...
 
void mlir::linalg::populateConvertConv2DToImg2ColPatterns (RewritePatternSet &patterns)
 Populates patterns to transform linalg.conv_2d_xxx operations into linalg.generic (for img2col packing) and linalg.matmul. More...